/* =========================================================
   Rohan Susarla — personal site
   Minimal & clean, editorial. Light by default, honest dark mode.
   Type: Newsreader (display serif) + Hanken Grotesk (text/UI).
   Palette, type, and rhythm live in variables up top.
   ========================================================= */

:root {
  /* warm-neutral paper — deliberately kept out of the "AI cream" range */
  --paper:     #f6f5f3;
  --ink:       #1a1917;   /* near-black, warm */
  --muted:     #57544e;   /* ≥4.5:1 on paper */
  --faint:     #8f8b83;
  --line:      #e2ded6;
  --line-soft: #ece9e2;
  --accent:    #2e5339;   /* deep spruce */
  --accent-ink:#26492f;
  --edit:      #a24b16;   /* marks placeholder copy to replace */

  --measure: 62ch;
  --pad: clamp(20px, 5vw, 40px);
  --shell: 940px;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark palette — default unless the visitor explicitly switches to light. */
:root:not([data-theme="light"]),
:root[data-theme="dark"] {
  --paper:     #171613;
  --ink:       #ecEAe3;
  --muted:     #a8a49a;
  --faint:     #6d6a61;
  --line:      #2b2924;
  --line-soft: #221f1b;
  --accent:    #9ec3a5;
  --accent-ink:#b6d5bb;
  --edit:      #e0a05a;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-synthesis: none;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.measure { max-width: var(--measure); }

/* ---------- scroll progress ---------- */
.progress {
  position: fixed; inset: 0 auto auto 0;
  height: 2px; width: 0;
  background: var(--accent);
  z-index: 100;
  transition: width .1s linear;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
/* Scroll edge effect, not a hard divider: fade a soft gradient where
   content meets the floating chrome (Apple materials guidance). */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 22px;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--paper) 55%, transparent), transparent);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.site-header.scrolled::after { opacity: 1; }

/* Materials degrade gracefully for transparency/contrast preferences */
@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-header.scrolled { border-bottom: 1px solid var(--line); }
  .site-header::after { display: none; }
}
@media (prefers-contrast: more) {
  .site-header.scrolled { border-bottom: 1px solid var(--ink); }
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: opacity .2s ease;
}
.brand:hover { opacity: 0.7; }
.brand .dot { color: var(--accent); }
.nav-links {
  display: flex; gap: 22px; list-style: none; margin: 0; padding: 0;
  flex-wrap: wrap; justify-content: flex-end;
}
.nav-links a {
  text-decoration: none; color: var(--muted);
  font-size: 0.88rem; font-weight: 500;
  position: relative; padding-block: 4px;
  transition: color .2s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 720px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.8rem; }
}

.nav-right { display: flex; align-items: center; gap: 20px; margin-left: auto; }

/* Theme toggle — only meaningful with JS, so hidden until then */
.theme-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  padding: 0; margin: 0;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--ink); background: var(--line-soft); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 19px; height: 19px; display: block; }

/* Show the icon for the theme you'd switch TO: moon in light, sun in dark */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 480px) {
  .nav-right { gap: 12px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(88vh, 840px);
  padding-block: clamp(48px, 10vh, 110px);
}
/* Text column — keeps the site's content gutter via .wrap */
.hero-inner {
  position: relative;
  z-index: 6;
  width: 100%;
  cursor: grab;
  touch-action: pan-y;
}
.hero.is-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}
/* Madison Capitol 3D dot-matrix canvas: bridges from hero into Experience 'i' */
.hero-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 4;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms var(--ease);
  transition-delay: 180ms;
}
.hero-canvas.is-ready { opacity: 1; }
.hero-canvas.is-done { opacity: 0; transition: opacity 220ms ease; }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 15vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(24px, 4vw, 40px);
}
.hero-title .l { display: block; }
.hero-title .l2 { font-style: italic; color: var(--accent); margin-left: 0.06em; }
.hero-title .dot { color: var(--accent); }
.hero-lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  line-height: 1.4;
  max-width: 22ch;
  margin: 0 0 28px;
  color: var(--ink);
}
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: clamp(36px, 8vh, 72px);
  color: var(--faint);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue-arrow {
  width: 18px;
  height: 18px;
}
html.motion-ready .scroll-cue-arrow {
  animation: cue-bob 1.8s var(--ease) infinite;
}
@keyframes cue-bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(5px); opacity: 1; }
}
.hero-meta {
  display: flex; align-items: center;
  font-size: 0.9rem; color: var(--muted);
  letter-spacing: 0.01em; margin: 0;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 10px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Narrow screens: the field becomes a quiet full-bleed backdrop behind the
   text. The JS also fades the field out toward the left so the type stays
   fully legible. */
@media (max-width: 720px) {
  .hero {
    min-height: 76vh;
    padding-block: clamp(56px, 12vh, 96px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-canvas { transition: none; }
}

/* ---------- sections ---------- */
.section {
  padding-block: clamp(56px, 10vw, 104px);
  border-top: 1px solid var(--line);
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 clamp(28px, 4vw, 44px);
}
.exp-i {
  display: inline-block;
  position: relative;
}
.exp-i-glyph {
  display: inline-block;
  transition: color 240ms ease;
}
.exp-i.is-locked .exp-i-glyph {
  color: var(--accent);
}

/* ---------- prose ---------- */
.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose .lead {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  line-height: 1.42;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
.prose p:not(.lead) { color: var(--muted); }

.tags {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 8px; padding: 0; margin: 28px 0 0;
}
.tags li {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 15px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--muted);
}

.edit { color: var(--edit); font-style: italic; }

/* ---------- places (globe) ---------- */
.globe-row {
  display: flex;
  align-items: center;
  gap: clamp(28px, 6vw, 56px);
  flex-wrap: wrap;
}
.globe-wrap {
  flex: 0 0 auto;
  width: min(280px, 60vw);
  aspect-ratio: 1 / 1;
}
.globe-canvas {
  display: none; /* needs JS to draw anything; avoid a blank box otherwise */
  width: 100%;
  height: 100%;
  cursor: grab;
}
.js .globe-canvas { display: block; }
.globe-canvas:active { cursor: grabbing; }

.globe-cities {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}
.globe-cities li { display: flex; align-items: center; }
.globe-cities li:target {
  color: var(--accent);
}
.globe-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 14px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.globe-cities li:target .globe-dot {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* ---------- experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 6px 40px;
  padding-block: clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--line-soft);
}
.entry:first-child { border-top: 0; padding-top: 0; }
.entry[id] { scroll-margin-top: 100px; }
.entry-when {
  font-size: 0.85rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  padding-top: 5px;
}
.uw-emblem {
  height: 1.6em;
  width: auto;
  margin-right: 0.5em;
  vertical-align: -0.35em;
  color: var(--ink);
}
.entry-main {
  position: relative;
  min-width: 0;
}
.entry-role {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.28rem;
  letter-spacing: -0.015em;
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 7rem;
}
.entry-role-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}
.entry-role-arrow {
  font-family: var(--sans);
  font-size: 0.82em;
  color: var(--faint);
  transition: transform 200ms var(--ease), color 180ms ease;
}
.entry-role-link:hover,
.entry-role-link:focus-visible {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.entry-role-link:hover .entry-role-arrow,
.entry-role-link:focus-visible .entry-role-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}
.entry-icon {
  width: 1.35em;
  height: 1.35em;
  flex: 0 0 auto;
  color: var(--accent);
  display: block;
}
/* small logo mark sitting just left of the org name */
.entry-org-etc {
  display: flex;
  align-items: center;
  gap: 9px;
}
.etc-logo-link {
  display: inline-flex;
  line-height: 0;
  flex: none;
  border-bottom: none !important;
  opacity: 1;
  transition: opacity 160ms ease;
}
.etc-logo-link:hover { opacity: 0.75; }
.etc-mark {
  height: 24px;
  width: auto;
  max-width: min(200px, 55vw);
  object-fit: contain;
  flex: none;
  display: block;
}
.etc-mark-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .etc-mark:not(.etc-mark-dark) { display: none; }
  :root:not([data-theme="light"]) .etc-mark-dark { display: block; }
}
:root[data-theme="dark"] .etc-mark:not(.etc-mark-dark) { display: none; }
:root[data-theme="dark"] .etc-mark-dark { display: block; }
.entry-org-sep { color: var(--faint); }
.entry-place {
  position: absolute;
  top: 6px;
  right: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.entry-org { margin: 0 0 12px; font-size: 0.92rem; color: var(--muted); }
.entry-org .org { color: var(--accent); font-weight: 500; }
.entry-org a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}
.entry-org a:hover { border-bottom-color: currentColor; }
.entry-org a.org:hover { color: var(--accent); }

/* condensed summary + "See more" reveal */
.entry-summary {
  margin: 0 0 12px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}
.entry-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin: 4px auto 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent);
  transition: color 160ms ease;
}
.entry-more:hover { color: var(--accent-ink); }
.entry-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.entry-more-arrow {
  width: 15px;
  height: 15px;
  transition: transform 240ms var(--ease);
}
.entry-more[aria-expanded="true"] .entry-more-arrow { transform: rotate(180deg); }
.entry-detail { margin-top: 16px; }
.entry-detail[hidden] { display: none; }
/* JS upgrades this to an interruptible, materializing expand:
   grid-rows animates height and can be reversed mid-flight; the
   surface blurs in rather than plain-fading (Apple "materialize"). */
.entry-detail.is-collapsible {
  margin-top: 0;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  filter: blur(6px);
  transition:
    grid-template-rows 460ms var(--ease),
    margin-top 460ms var(--ease),
    opacity 300ms ease,
    filter 300ms ease;
}
.entry-detail.is-collapsible > .entry-facets {
  overflow: hidden;
  min-height: 0;
}
.entry-detail.is-collapsible.is-open {
  margin-top: 16px;
  grid-template-rows: 1fr;
  opacity: 1;
  filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
  .entry-detail.is-collapsible {
    transition: opacity 200ms ease;
    filter: none;
  }
}

.entry-facets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.facet {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.facet:first-child { border-top: 0; padding-top: 0; }
.facet-toggle {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 12px 20px;
  width: 100%;
  margin: 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.facet-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.facet-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 2px;
}
.facet-summary {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  transition: opacity 180ms ease;
}
.facet.is-open .facet-summary,
.facet:hover .facet-summary {
  opacity: 0.45;
}
.facet-detail {
  padding: 4px 0 2px;
  grid-column: 1 / -1;
}
.facet-detail[hidden] { display: none; }
.facet-detail .bullets { margin-top: 2px; }
.facet-link {
  margin: 6px 0 0;
  font-size: 0.95rem;
}
.facet-link a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  transition: border-color 160ms ease;
}
.facet-link a:hover { border-bottom-color: var(--accent); }

@media (max-width: 560px) {
  .facet-toggle { grid-template-columns: 1fr; gap: 4px; }
}

.bullets { margin: 0; padding-left: 17px; color: var(--muted); }
.bullets li { margin-bottom: 7px; padding-left: 4px; }
.bullets li::marker { color: var(--faint); }
.bullets a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-bottom: 1px;
  transition: border-color 160ms ease, color 160ms ease;
}
.bullets a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .entry-when { padding-top: 0; order: -1; }
  .entry-role { padding-right: 4.5rem; }
  .entry-place { top: 2px; }
}

.resume-cta { margin: clamp(32px, 5vw, 48px) 0 0; }
.resume-cta a {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  transition: border-color .2s ease;
}
.resume-cta a:hover { border-bottom-color: var(--accent); }

/* ---------- detail modal overlay ---------- */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.detail-modal:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  backdrop-filter: blur(8px);
  z-index: -1;
}

.detail-modal-content {
  position: relative;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 16px 64px color-mix(in srgb, var(--ink) 12%, transparent);
  max-width: 900px;
  width: 100%;
  padding: clamp(24px, 6vw, 48px);
  max-height: 85vh;
  overflow-y: auto;
}

.detail-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms ease, background 200ms ease;
  z-index: 1;
}
.detail-modal-close:hover {
  color: var(--ink);
  background: var(--line-soft);
}
.detail-modal-close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.detail-modal-tiles {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 4vw, 32px);
  padding-top: 8px;
}

.detail-tile {
  background: var(--line-soft);
  border: 2px solid var(--muted);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: auto;
}
.detail-tile:nth-child(1) { animation-delay: 100ms; }
.detail-tile:nth-child(2) { animation-delay: 200ms; }
.detail-tile:nth-child(3) { animation-delay: 300ms; }

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-tile-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-tile-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
}

.detail-tile-summary {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.detail-tile-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-tile-bullets li {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.detail-tile-link {
  margin-top: auto;
  padding-top: 8px;
}

.detail-tile-link a {
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  transition: border-color 160ms ease;
}

.detail-tile-link a:hover {
  border-bottom-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .detail-tile {
    animation: none;
    opacity: 1;
  }
}

/* ---------- teaching ---------- */
.teaching-block {
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
}
.teaching-role {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.teaching-place {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.teaching-org {
  margin: 10px 0 28px;
  font-size: 0.92rem;
  color: var(--muted);
}
.teaching-org a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
.teaching-org a:hover { border-bottom-color: currentColor; }

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}
.course {
  position: relative;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.course:first-child { border-top: 0; padding-top: 0; }
.course-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.course-code {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.course-name {
  font-size: 0.92rem;
  color: var(--muted);
}
.course-terms {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.88rem;
  color: var(--muted);
}
.upcoming {
  color: var(--accent);
  font-style: italic;
  font-size: 0.84em;
}
.course-header {
  position: relative;
}
.course-more {
  margin-top: 10px;
}
.course-detail[hidden] { display: none; }
.course-detail.is-collapsible {
  margin-top: 0;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  filter: blur(6px);
  transition:
    grid-template-rows 420ms var(--ease),
    margin-top 420ms var(--ease),
    opacity 280ms ease,
    filter 280ms ease;
}
.course-detail.is-collapsible > .course-detail-inner {
  overflow: hidden;
  min-height: 0;
}
.course-detail.is-collapsible.is-open {
  margin-top: 12px;
  grid-template-rows: 1fr;
  opacity: 1;
  filter: blur(0);
}
.course-desc {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--muted);
}
.edu-coursework-toggle {
  margin: 10px 0 0;
}
.coursework-grid {
  list-style: none;
  margin: 0;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 24px;
  font-size: 0.9rem;
}
.coursework-grid li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.coursework-code {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.coursework-title {
  color: var(--muted);
}
.course-syllabus {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--faint);
  text-decoration: none;
  transition: color 180ms ease;
}
.course-syllabus-label {
  opacity: 0;
  transform: translateX(6px);
  border-bottom: 1px solid transparent;
  transition: opacity 200ms ease, transform 200ms var(--ease), border-color 180ms ease;
}
.course-syllabus-arrow {
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 200ms var(--ease);
}
.course:hover .course-syllabus,
.course:focus-within .course-syllabus { color: var(--accent); }
.course:hover .course-syllabus-label,
.course:focus-within .course-syllabus-label {
  opacity: 1;
  transform: translateX(0);
}
.course:hover .course-syllabus-arrow,
.course:focus-within .course-syllabus-arrow { transform: translateX(3px); }
.course-syllabus:hover .course-syllabus-label { border-bottom-color: var(--accent); }

@media (max-width: 560px) {
  .course-syllabus {
    position: static;
    transform: none;
    margin-top: 10px;
    color: var(--accent);
  }
  .course-syllabus-label {
    opacity: 1;
    transform: none;
  }
}

/* ---------- writing ---------- */
.writing-piece {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px 22px;
  max-width: 42rem;
  text-decoration: none;
  color: inherit;
  padding: 4px 0;
}
.wulr-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
  border-radius: 50%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wulr-mark { filter: invert(1); }
}
:root[data-theme="dark"] .wulr-mark { filter: invert(1); }
.writing-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.22rem;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.writing-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.writing-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 0.84rem;
  transition: color 220ms ease;
}
.writing-cta-label {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 200ms ease, transform 200ms var(--ease);
}
.writing-arrow {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 220ms var(--ease);
}
.writing-piece:hover .writing-cta,
.writing-piece:focus-visible .writing-cta { color: var(--accent); }
.writing-piece:hover .writing-cta-label,
.writing-piece:focus-visible .writing-cta-label {
  opacity: 1;
  transform: translateX(0);
}
.writing-piece:hover .writing-arrow,
.writing-piece:focus-visible .writing-arrow { transform: translateX(4px); }
.writing-piece:hover .writing-title { color: var(--accent-ink); }

/* ---------- publications ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 28px;
  padding-block: clamp(18px, 2.5vw, 26px);
  border-top: 1px solid var(--line-soft);
}
.pub:first-child { border-top: 0; padding-top: 0; }
.pub-when {
  font-size: 0.85rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.pub-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.35;
}
.pub-title a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}
.pub-title a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.pub-title--link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.pub-arrow {
  flex: none;
  color: var(--faint);
  font-size: 1.05rem;
  transition: transform 220ms var(--ease), color 220ms ease;
}
.pub-title--link:hover .pub-arrow {
  color: var(--accent);
  transform: translateX(4px);
}
.pub-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}
.pub-meta cite { font-style: italic; }
.pub-meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}
.pub-meta a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.pub-figure {
  margin: 18px 0 4px;
  max-width: 540px;
}
.pub-media {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: default;
  perspective: 1000px;
  transition:
    padding-bottom 520ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 320ms ease,
    box-shadow 420ms var(--ease);
}
.pub-media.is-poster-hover,
.pub-media.is-poster-open {
  cursor: pointer;
}
.pub-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  transition:
    filter 420ms var(--ease),
    transform 520ms var(--ease);
}
.pub-poster-spot {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.18));
  transition:
    opacity 380ms var(--ease),
    transform 520ms var(--ease),
    filter 380ms var(--ease);
}
.pub-photo-spot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(1.06) contrast(1.03);
  clip-path: polygon(
    4.53% 12.78%, 5.08% 11.81%, 9.22% 12.92%, 49.69% 25.14%,
    49.30% 29.44%, 48.91% 34.44%, 49.84% 36.81%, 50.16% 39.31%,
    49.06% 41.39%, 47.58% 42.50%, 45.47% 45.83%, 43.44% 49.17%,
    41.95% 51.39%, 38.75% 53.61%, 36.33% 54.31%, 25.94% 54.31%,
    24.38% 54.31%, 20.70% 54.72%, 18.36% 54.44%, 14.69% 54.03%,
    14.45% 54.58%, 15.23% 55.28%, 15.00% 55.97%, 16.02% 56.39%,
    16.48% 56.39%, 15.55% 57.64%, 15.62% 58.06%, 16.25% 58.33%,
    17.66% 56.67%, 17.97% 56.94%, 17.11% 58.61%, 17.11% 59.31%,
    18.05% 59.58%, 17.50% 60.42%, 17.50% 61.11%, 18.75% 61.11%,
    19.53% 59.86%, 24.38% 60.97%, 25.94% 61.39%, 34.77% 63.06%,
    40.23% 63.75%, 43.98% 64.03%, 43.59% 70.97%, 42.81% 78.75%,
    41.95% 89.17%, 5.08% 99.72%, 5.08% 20.14%, 4.53% 17.36%
  );
  transition: filter 320ms var(--ease);
}
.pub-grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  transition: opacity 380ms var(--ease);
}
.pub-media.is-dot-ready .pub-grid-canvas { opacity: 1; }
.pub-poster-reveal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  pointer-events: none;
  opacity: 0;
  transform-origin: 50% 50%;
  transform: translate3d(-23.5%, 6.5%, 0) scale(0.47, 0.80) rotateY(22deg) skewY(6.5deg);
  transition:
    transform 540ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease;
}
.pub-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.pub-media:hover .pub-grid-canvas,
.pub-media:focus-within .pub-grid-canvas,
.pub-media.is-color .pub-grid-canvas,
.pub-media.is-poster-hover .pub-grid-canvas,
.pub-media.is-poster-open .pub-grid-canvas {
  opacity: 0;
}
.pub-media:hover .pub-photo,
.pub-media:focus-within .pub-photo,
.pub-media.is-color .pub-photo,
.pub-media.is-poster-hover .pub-photo {
  filter: grayscale(0%) contrast(1.02) brightness(0.42);
  transform: scale(1.015);
}
.pub-media:hover .pub-poster-spot,
.pub-media:focus-within .pub-poster-spot,
.pub-media.is-color .pub-poster-spot,
.pub-media.is-poster-hover .pub-poster-spot {
  opacity: 1;
  transform: scale(1.015);
}
.pub-media.is-poster-hover .pub-poster-spot {
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.32));
}
.pub-media.is-poster-hover .pub-photo-spot {
  filter: brightness(1.10) contrast(1.04);
}
.pub-media.is-poster-open {
  padding-bottom: 75%;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}
.pub-media.is-poster-open .pub-poster-spot {
  opacity: 0;
}
.pub-media.is-poster-open .pub-photo {
  filter: grayscale(0%) contrast(1) blur(8px) brightness(0.35);
  transform: scale(1.05);
}
.pub-media.is-poster-open .pub-poster-reveal {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1, 1) rotateY(0deg) skewY(0deg);
}

@media (max-width: 560px) {
  .writing-piece { grid-template-columns: auto 1fr; }
  .writing-cta { display: none; }
  .pub { grid-template-columns: 1fr; gap: 2px; }
  .pub-when { padding-top: 0; }
}

/* ---------- contact ---------- */
.contacts {
  list-style: none; padding: 0;
  margin: clamp(36px, 6vw, 60px) 0 0;
  display: flex;
  justify-content: center;
  gap: clamp(32px, 8vw, 64px);
}
.contacts a {
  display: inline-flex;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease, transform .25s var(--ease);
}
.contacts a:hover { color: var(--accent); transform: translateY(-4px); }
.contacts svg {
  width: clamp(40px, 9vw, 56px);
  height: clamp(40px, 9vw, 56px);
  display: block;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 30px; margin-top: 24px; }
.footer-inner {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.86rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.footer-mark {
  font-family: var(--serif); font-weight: 500;
  width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--paper);
  font-size: 0.95rem;
}
.footer-inner > span:nth-of-type(1) { margin-right: auto; }
.footer-inner a { text-decoration: none; color: var(--muted); }
.footer-inner a:hover { color: var(--ink); }

/* ---------- motion ----------
   Hero CSS entrance is the no-JS / pre-Motion fallback.
   When Motion loads, .motion-ready takes over. */
.js .hero .l {
  opacity: 0;
  transform: translateY(18px);
  animation: rise .9s var(--ease) forwards;
}
.js .hero .l1 { animation-delay: .05s; }
.js .hero .l2 { animation-delay: .16s; }
.js .hero .l3 { animation-delay: .34s; }
.js .hero .l4 { animation-delay: .46s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

html.motion-ready .hero-title,
html.motion-ready .hero-lede,
html.motion-ready .scroll-cue {
  opacity: 0;
}
html.motion-ready .js .hero .l {
  opacity: 1;
  transform: none;
  animation: none;
}
html.motion-ready .reveal,
html.motion-ready .course-list .course {
  opacity: 0;
  filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero .l { opacity: 1; transform: none; animation: none; }
  .scroll-cue-arrow { animation: none !important; }
  html.motion-ready .hero-title,
  html.motion-ready .hero-lede,
  html.motion-ready .scroll-cue,
  html.motion-ready .reveal,
  html.motion-ready #experience .entry,
  html.motion-ready .course-list .course {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ===== Response: instant press feedback (Apple "respond on the press") =====
   Interactive controls acknowledge the press immediately, then ease back on
   release. Transforms are gated behind no-preference so reduced-motion users
   keep the (already present) color feedback without any movement. */
@media (prefers-reduced-motion: no-preference) {
  .brand { transition: opacity .2s ease, transform .14s cubic-bezier(0.2, 0, 0, 1); }
  .brand:active { transform: scale(0.94); }

  .theme-toggle { transition: color .2s ease, background .2s ease, transform .14s cubic-bezier(0.2, 0, 0, 1); }
  .theme-toggle:active { transform: scale(0.88); }

  .scroll-cue { transition: color .2s ease, transform .14s cubic-bezier(0.2, 0, 0, 1); }
  .scroll-cue:active { transform: translateY(1px) scale(0.96); }

  .entry-more { transition: color .16s ease, transform .14s cubic-bezier(0.2, 0, 0, 1); }
  .entry-more:active { transform: scale(0.95); }

  .facet-toggle { transition: transform .14s cubic-bezier(0.2, 0, 0, 1); }
  .facet-toggle:active { transform: scale(0.992); }

  .resume-cta a { transition: color .16s ease, transform .14s cubic-bezier(0.2, 0, 0, 1); }
  .resume-cta a:active { transform: scale(0.97); }

  .contacts a:active { transform: translateY(-2px) scale(0.9); }

  .writing-piece { transition: transform .16s cubic-bezier(0.2, 0, 0, 1); }
  .writing-piece:active { transform: scale(0.99); }

  .gallery-item:active { transform: translateY(-1px) scale(0.99); }
}

/* ---- EXPO gallery page ---- */
.gallery-eyebrow {
  font-family: var(--font-sans, "Hanken Grotesk", sans-serif);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.gallery-eyebrow a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.gallery-eyebrow a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.gallery-title { margin: 0 0 12px; }
.gallery-lede { color: var(--muted); margin: 0 0 32px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--hairline, color-mix(in srgb, var(--ink) 12%, transparent));
  line-height: 0;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--ink) 16%, transparent);
}
.gallery-item:hover img { transform: scale(1.03); }

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 14px; }
}
