/* ==========================================================================
   Kallie Comardelle — personal academic site
   Editorial, warm, literary. All design tokens live in :root.
   ========================================================================== */

:root {
  --paper: #f7f3ea;
  --paper-2: #efe8d9;
  --ink: #1f1b16;
  --ink-soft: #5a5247;
  --accent: #8c2f39;
  --accent-2: #5f7a6a;
  --line: rgba(31, 27, 22, 0.14);
  --card: #fffdf8;
  --on-accent: #f7f3ea;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-w: 1120px;
  --radius: 14px;
  --shadow: 0 18px 40px -24px rgba(31, 27, 22, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17140f;
    --paper-2: #1e1a14;
    --ink: #f1e9d8;
    --ink-soft: #b3a995;
    --accent: #d9808a;
    --accent-2: #8fb09c;
    --line: rgba(241, 233, 216, 0.14);
    --card: #1d1912;
    --on-accent: #17140f;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section, #top { scroll-margin-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.015em;
}
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 em, h1 em { font-style: italic; color: var(--accent); font-weight: 400; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { left: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: currentColor; }
.eyebrow--light { color: var(--on-accent); opacity: 0.85; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 999px;
  font: 600 0.95rem var(--font-body); text-decoration: none;
  border: 1.5px solid transparent; transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--ink); color: var(--paper); }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--link { padding-inline: 8px; color: var(--ink-soft); }
.btn--link:hover { color: var(--accent); }
.btn--light { background: var(--on-accent); color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font: italic 500 1rem var(--font-display);
}
.brand__name { font: 500 1.1rem var(--font-display); letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-size: 0.92rem; font-weight: 500; color: var(--ink-soft); position: relative; }
.nav a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.nav__cta { padding: 8px 18px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink) !important; }
.nav__cta:hover { background: var(--ink); color: var(--paper) !important; }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); transition: transform .25s, top .25s; }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 clamp(64px, 9vw, 120px); overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto auto; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.hero__title { font-size: clamp(3.4rem, 9.5vw, 7.2rem); font-weight: 400; line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 28px; }
.hero__lede { max-width: 30em; font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--ink-soft); margin: 0 0 36px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.portrait { margin: 0; justify-self: center; width: min(100%, 360px); }
.portrait__frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px var(--radius) var(--radius);
  background: linear-gradient(160deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 55%, var(--accent-2)) 100%);
  display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow);
}
.portrait__frame::after {
  content: ""; position: absolute; inset: 12px; border: 1.5px solid color-mix(in srgb, var(--on-accent) 45%, transparent);
  border-radius: 999px 999px 8px 8px; pointer-events: none;
}
.portrait__mono { font: italic 300 clamp(5rem, 12vw, 8rem) var(--font-display); color: var(--on-accent); opacity: 0.92; letter-spacing: -0.04em; }
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* With a real photo: soft rounded rectangle instead of the arch placeholder. */
.portrait__frame.has-photo { border-radius: var(--radius); background: var(--paper-2); }
.portrait__frame.has-photo::after { display: none; }
.portrait figcaption {
  margin-top: 16px; text-align: center; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--tint { background: var(--paper-2); }
.split { display: grid; grid-template-columns: 0.8fr 2fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.split__head { position: sticky; top: 96px; }

.prose p { margin: 0 0 1.1em; max-width: 38em; }
.prose p:first-child { font-size: 1.2rem; color: var(--ink); }
.prose p { color: var(--ink-soft); }
.subhead { font-size: 1.35rem; margin: 48px 0 18px; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--paper);
}
.timeline__years { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.timeline h4 { font-size: 1.2rem; margin: 4px 0 2px; }
.timeline p { margin: 0; color: var(--ink-soft); }

.tags { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags:empty { display: none; }
.tags li { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 0.92rem; }

/* ---------- Entries ---------- */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.entry__year { font: 400 1.6rem var(--font-display); color: var(--accent); line-height: 1; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 20%, transparent); color: var(--ink);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.entry h3 { font-size: 1.4rem; margin-bottom: 6px; }
.entry h3 a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .3s; }
.entry h3 a:hover { background-size: 100% 1.5px; }
.entry__sub { font-style: italic; color: var(--ink-soft); margin: 0 0 8px; }
.entry p { margin: 0 0 8px; color: var(--ink-soft); }

.empty {
  list-style: none; text-align: center; padding: 44px 24px;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--card);
}
.empty__ornament { display: block; font-size: 1.8rem; color: var(--accent); margin-bottom: 8px; }
.empty p { margin: 0; color: var(--ink-soft); font-family: var(--font-display); font-style: italic; font-size: 1.15rem; }

/* ---------- Contact ---------- */
.contact { background: var(--accent); color: var(--on-accent); padding: clamp(72px, 10vw, 128px) 0; text-align: center; }
.contact h2 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 400; }
.contact h2 em { color: inherit; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__inner .eyebrow { justify-content: center; }
.contact__lede { max-width: 30em; margin: 20px 0 32px; font-size: 1.15rem; opacity: 0.9; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.links { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }
.links a { text-decoration: none; font-weight: 500; border-bottom: 1.5px solid color-mix(in srgb, var(--on-accent) 50%, transparent); padding-bottom: 2px; }
.links a:hover { border-bottom-color: var(--on-accent); }

.site-footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--ink-soft); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; }
.footer-inner p { margin: 0; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }
.noscript { text-align: center; padding: 16px; margin: 0; background: var(--paper-2); }

/* ---------- Reveal ---------- */
.will-reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
.will-reveal.is-visible { opacity: 1; transform: none; }
.hero__copy .will-reveal:nth-child(2) { transition-delay: .08s; }
.hero__copy .will-reveal:nth-child(3) { transition-delay: .16s; }
.hero__copy .will-reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(70%, 260px); justify-self: start; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split__head { position: static; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; width: 100%; font-size: 1.05rem; }
  .nav a::after { display: none; }
  .nav__cta { width: auto !important; margin-top: 8px; padding: 10px 22px !important; }
  .brand__name { font-size: 1rem; }
}

@media (max-width: 600px) {
  .entry { grid-template-columns: 1fr; gap: 10px; }
  .entry__meta { flex-direction: row; align-items: center; gap: 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
