/* ==========================================================================
   STYLE.CSS — layout and components.
   Kunal: you normally do not need to edit this file. Colours, fonts and
   spacing all live in theme.css next door.
   ========================================================================== */

/* ---------- Reset & base -------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(15px, 0.55vw + 13px, 17px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--gold); text-decoration-color: rgba(224, 178, 95, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  font-variation-settings: "SOFT" 0, "WONK" 1;
}

p { margin: 0 0 1.1em; }

::selection { background: var(--gold); color: var(--ink-void); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  background: var(--gold);
  color: var(--ink-void);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { left: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout helpers ------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(72px, 11vw, 150px); position: relative; }
.section--tight { padding-block: clamp(56px, 7vw, 96px); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(224, 178, 95, 0.5), transparent);
  max-width: 120px;
}

.section-title {
  font-size: clamp(32px, 4.6vw, 60px);
  max-width: 18ch;
  margin-bottom: 20px;
}

.lede {
  font-size: clamp(17px, 1.3vw, 21px);
  color: var(--text-muted);
  max-width: 58ch;
  line-height: 1.65;
}

.rule { height: 1px; background: var(--ink-line); border: 0; margin: 0; }

/* ---------- Buttons ------------------------------------------------------- */

.btn {
  --btn-pad: 14px 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: var(--btn-pad);
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              box-shadow var(--t-base) var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--grad-gold);
  color: #1b1304;
  box-shadow: 0 10px 34px -14px rgba(224, 178, 95, 0.75);
}
.btn--primary:hover { box-shadow: 0 16px 44px -14px rgba(224, 178, 95, 0.95); }

.btn--ghost {
  border-color: var(--ink-line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn--quiet {
  padding: 10px 0;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
}
.btn--quiet .arrow { transition: transform var(--t-fast) var(--ease); }
.btn--quiet:hover .arrow { transform: translateX(5px); }

.btn .arrow { display: inline-block; }

/* ---------- Header -------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background-color var(--t-base) var(--ease),
              backdrop-filter var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--ink-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark { width: 30px; height: 30px; flex: none; }

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 6px; }

.nav a {
  position: relative;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base) var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--text); }

/* The call-to-action sits inside .nav, so it has to out-specify .nav a. */
.nav a.header-cta {
  margin-left: 10px;
  --btn-pad: 10px 22px;
  color: #1b1304;
}
.nav a.header-cta::after { display: none; }

/* Flex with a fixed gap, so the three bars sit a known 7px apart and the
   rotated bars meet exactly in the middle when the menu is open. */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: 78px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px var(--gutter) 32px;
    background: var(--ink-deep);
    border-bottom: 1px solid var(--ink-line);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  /* The stacked links get a list treatment; the call-to-action stays a pill. */
  .nav a:not(.header-cta) {
    padding: 16px 0;
    font-size: 19px;
    font-family: var(--font-display);
    border-bottom: 1px solid var(--ink-line);
    border-radius: 0;
  }
  .nav a::after { display: none; }
  .nav a.header-cta { margin: 22px 0 0; justify-content: center; }
}

/* ---------- Hero ---------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 75% at 12% 8%, rgba(125, 157, 255, 0.10), transparent 60%),
    radial-gradient(90% 60% at 88% 92%, rgba(224, 178, 95, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(4, 6, 13, 0.55) 0%, rgba(4, 6, 13, 0.2) 45%, var(--ink-deep) 97%);
  pointer-events: none;
}

.hero-inner { padding-block: 150px 120px; width: 100%; }

.hero h1 {
  font-size: clamp(46px, 9.2vw, 132px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  max-width: 14ch;
  margin-bottom: 28px;
}

.hero h1 .shine {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.1vw, 28px);
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 24ch;
  margin-bottom: 40px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-quote {
  margin-top: clamp(56px, 8vw, 96px);
  padding-left: 22px;
  border-left: 1px solid rgba(224, 178, 95, 0.4);
  max-width: 46ch;
}
.hero-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hero-quote cite {
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-decoration: none;
}
.scroll-cue .line {
  width: 1px; height: 46px;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

/* ---------- Page hero (interior pages) ------------------------------------ */

.page-hero {
  position: relative;
  padding-block: clamp(140px, 17vw, 210px) clamp(36px, 5vw, 64px);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto -10%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 18% 34%, rgba(125, 157, 255, 0.14), transparent 68%),
    radial-gradient(55% 50% at 82% 20%, rgba(224, 178, 95, 0.12), transparent 68%);
  pointer-events: none;
}
.page-hero h1 {
  font-size: clamp(42px, 7.6vw, 96px);
  letter-spacing: -0.035em;
  max-width: 16ch;
  margin-bottom: 22px;
}

/* ---------- Work cards ---------------------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(26px, 2.6vw, 38px);
  background: linear-gradient(165deg, var(--ink-raised), rgba(13, 19, 38, 0.35));
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}

.work-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--grad-rule);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%),
              rgba(224, 178, 95, 0.09), transparent 62%);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.work-card:hover,
.work-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(224, 178, 95, 0.4);
  box-shadow: var(--shadow-card);
}
.work-card:hover::before,
.work-card:focus-within::before,
.work-card:hover::after,
.work-card:focus-within::after { opacity: 1; }

.work-kind {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-line);
}
.work-kind > span:first-child { color: var(--gold); white-space: nowrap; }
.work-kind::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--gold);
  flex: none;
}

.work-card h3 {
  font-size: clamp(23px, 2vw, 30px);
  margin-bottom: 14px;
}

/* Research papers: authors and journal, set above the blurb. */
.work-byline {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-faint);
  margin: -4px 0 16px;
}
.work-byline cite { font-style: italic; }
.work-byline a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--ink-line);
  text-underline-offset: 3px;
  transition: color var(--t-base) var(--ease), text-decoration-color var(--t-base) var(--ease);
}
.work-byline a:hover { color: var(--gold); text-decoration-color: currentColor; }

/* Only the blurb stretches — .work-kind and .work-byline are <p>s too, and must not grow. */
.work-card > p:not(.work-kind):not(.work-byline) {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.68;
  flex: 1;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-line);
}

.work-meta {
  margin-left: auto;
  color: var(--text-faint);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: none;
  font-weight: 400;
  font-size: 11px;
}

.link-plain {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.link-plain:hover { color: var(--gold); border-bottom-color: currentColor; }

/* ---------- About block --------------------------------------------------- */

.about-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5.5vw, 88px);
  align-items: center;
}

.portrait {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
}
/* The source photo is very tall; crop it to a portrait rectangle so the
   layout stays balanced. Move object-position if the crop cuts the face. */
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.92) contrast(1.04);
  transition: transform var(--t-slow) var(--ease);
}
.portrait:hover img { transform: scale(1.03); }
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(4, 6, 13, 0.55));
  pointer-events: none;
}

.portrait-frame { position: relative; }
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 22px -22px -22px 22px;
  border: 1px solid rgba(224, 178, 95, 0.32);
  border-radius: var(--radius);
  z-index: -1;
}

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 2.1vw, 29px);
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 28px;
  position: relative;
}
.pull-quote::before {
  content: "\201C";
  position: absolute;
  left: -0.5em; top: -0.18em;
  font-size: 2.6em;
  line-height: 1;
  color: rgba(224, 178, 95, 0.25);
  pointer-events: none;
}

/* Two columns keeps the four facts as a tidy 2x2 with no empty cell. */
.fact-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink-line);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 48px;
}
.fact-strip div { background: var(--ink-deep); padding: 24px 26px; }
.fact-strip dt {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.fact-strip dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
}

/* ---------- Journal list -------------------------------------------------- */

.tale-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink-line); }

.tale {
  border-bottom: 1px solid var(--ink-line);
  transition: background-color var(--t-base) var(--ease);
}
.tale:hover { background: rgba(255, 255, 255, 0.016); }

.tale a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 44px);
  align-items: baseline;
  padding: clamp(26px, 3vw, 40px) 4px;
  text-decoration: none;
  color: inherit;
}

.tale-num {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  transition: color var(--t-base) var(--ease);
}

.tale h3 {
  font-size: clamp(24px, 3vw, 40px);
  margin-bottom: 10px;
  transition: color var(--t-base) var(--ease);
}

.tale p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 62ch;
  margin: 0;
}

.tale-meta {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tale a:hover h3 { color: var(--gold); }
.tale a:hover .tale-num { color: var(--gold); }

@media (max-width: 720px) {
  .tale a { grid-template-columns: 1fr; gap: 10px; }
  .tale-meta { order: -1; }
}

/* ---------- CTA band ------------------------------------------------------ */

.cta-band {
  position: relative;
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  background:
    radial-gradient(70% 140% at 50% 0%, rgba(224, 178, 95, 0.09), transparent 70%),
    var(--ink-void);
  text-align: center;
}
.cta-band h2 { font-size: clamp(32px, 5vw, 64px); margin: 0 auto 22px; max-width: 16ch; }
.cta-band .lede { margin: 0 auto 36px; }

/* ---------- Footer -------------------------------------------------------- */

.site-footer {
  background: var(--ink-void);
  padding-block: clamp(52px, 6vw, 76px) 32px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
  padding-bottom: 44px;
  border-bottom: 1px solid var(--ink-line);
}

.footer-top h4 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

.footer-blurb { max-width: 36ch; color: var(--text-faint); font-size: 14px; margin-top: 16px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 26px;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-bottom a { color: var(--text-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--gold); }

@media (max-width: 760px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- Reader overlay ------------------------------------------------ */

.reader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(4, 6, 13, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility var(--t-base);
}
.reader.is-open { opacity: 1; visibility: visible; }

.reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--ink-line);
}
.reader-bar h2 {
  font-size: clamp(17px, 2vw, 24px);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.reader-tools .btn { --btn-pad: 9px 18px; font-size: 13px; }

.reader-close {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--ink-line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.reader-close:hover { border-color: var(--gold); color: var(--gold); transform: rotate(90deg); }

.reader-stage { padding: 14px var(--gutter) var(--gutter); min-height: 0; }
.reader-stage iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  background: #22242a;
}

.reader-fallback {
  display: grid;
  place-content: center;
  text-align: center;
  gap: 16px;
  height: 100%;
  color: var(--text-muted);
}

body.reader-open { overflow: hidden; }

/* ---------- Contact ------------------------------------------------------- */

.contact-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: start;
}

.contact-card {
  background: linear-gradient(165deg, var(--ink-raised), rgba(13, 19, 38, 0.4));
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: clamp(26px, 3.2vw, 44px);
}

.field { position: relative; margin-bottom: 22px; }

.field input,
.field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 22px 16px 10px;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

.field input:hover, .field textarea:hover { border-color: #2a3450; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(224, 178, 95, 0.04);
}

.field label {
  position: absolute;
  left: 17px; top: 15px;
  font-size: 15px;
  color: var(--text-faint);
  pointer-events: none;
  transform-origin: left top;
  transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.field input:focus + label,
.field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-9px) scale(0.72);
  color: var(--gold);
}

.field-error {
  display: block;
  font-size: 12.5px;
  color: #ff9b8a;
  margin-top: 7px;
  min-height: 1px;
}

.form-status {
  margin-top: 18px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base) var(--ease), padding var(--t-base) var(--ease);
}
.form-status.is-shown { padding: 14px 16px; max-height: 240px; }
.form-status.is-ok { background: rgba(125, 157, 255, 0.1); border: 1px solid rgba(125, 157, 255, 0.4); }
.form-status.is-err { background: rgba(255, 120, 100, 0.08); border: 1px solid rgba(255, 120, 100, 0.35); }

.contact-lines { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 22px; }
.contact-lines dt {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 6px;
}
.contact-lines dd { margin: 0; font-family: var(--font-display); font-size: 19px; }
.contact-lines dd a { text-decoration: none; }

@media (max-width: 900px) {
  .contact-split, .about-split { grid-template-columns: 1fr; }
  .portrait-frame::before { inset: 16px -16px -16px 16px; }
}

@media (max-width: 460px) {
  .fact-strip { grid-template-columns: 1fr; }
}

/* ---------- Article (journal post) ---------------------------------------- */

.progress-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  background: var(--grad-gold);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.article-head {
  padding-block: clamp(130px, 15vw, 190px) clamp(28px, 4vw, 48px);
  text-align: center;
}
.article-head h1 {
  font-size: clamp(38px, 6.4vw, 82px);
  max-width: 20ch;
  margin: 0 auto 22px;
}
.article-meta {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.reading-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding: 9px 18px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.reading-toggle:hover { border-color: var(--gold); color: var(--gold); }

.article-body {
  max-width: var(--read-max);
  margin-inline: auto;
  font-family: var(--font-read);
  font-size: clamp(17px, 1.15vw, 19.5px);
  line-height: 1.85;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 14;
}
.article-body p { margin: 0 0 1.5em; }
.article-body p:first-of-type::first-letter {
  float: left;
  font-size: 4.1em;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--gold);
  font-variation-settings: "WONK" 1;
}

.article-end {
  max-width: var(--read-max);
  margin: clamp(48px, 6vw, 80px) auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--ink-line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}
.article-end a { text-decoration: none; }

/* Paper reading mode — only ever applied on journal article pages. */

body.paper {
  background: var(--paper);
  color: var(--paper-text);
}
body.paper .site-header.is-stuck {
  background: rgba(246, 242, 233, 0.92);
  border-bottom-color: var(--paper-line);
}
body.paper .brand,
body.paper .article-body,
body.paper .article-head h1 { color: var(--paper-text); }
body.paper .nav a,
body.paper .article-meta,
body.paper .reading-toggle { color: var(--paper-muted); }
body.paper .nav a:hover { color: var(--paper-text); }
body.paper .reading-toggle,
body.paper .article-end { border-color: var(--paper-line); }
body.paper .site-footer {
  background: var(--paper-raised);
  color: var(--paper-muted);
  border-top: 1px solid var(--paper-line);
}
body.paper .footer-top { border-bottom-color: var(--paper-line); }
body.paper .footer-links a,
body.paper .footer-bottom a { color: var(--paper-muted); }
body.paper .footer-top h4,
body.paper .footer-blurb,
body.paper .footer-bottom { color: #8d8474; }
body.paper .page-hero::before { opacity: 0.35; }
body.paper ::selection { background: #2b2620; color: var(--paper); }

/* ---------- Scroll reveal ------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Hero words animate in on load rather than on scroll. */
.word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word > span {
  display: inline-block;
  transform: translateY(105%);
  animation: word-rise 1s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes word-rise { to { transform: none; } }

.fade-up {
  opacity: 0;
  animation: fade-up 1s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Page transitions ---------------------------------------------- */

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out 260ms var(--ease) both; }
::view-transition-new(root) { animation: vt-in 420ms var(--ease) both; }

@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(14px); } }

/* Fallback for browsers without the View Transitions API (see main.js). */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--ink-void);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease);
}
html.is-leaving .page-veil { opacity: 1; }

/* ---------- Reduced motion ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .word > span { transform: none; }
  .fade-up { opacity: 1; }
  .scroll-cue .line { animation: none; }
  #hero-canvas { display: none; }
  .page-veil { display: none; }
}

/* Four cards read better as a 2x2 block than as a row of three plus an orphan. */
@media (min-width: 900px) {
  .work-grid--pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
