/* ============================================================
   DESIGN TOKENS
   Palette: dark violet void + a sunset gradient (ember/magenta/violet)
   used sparingly as the single signature accent.
   ============================================================ */
:root {
  --void:      #120C1E;   /* page background */
  --surface:   #1C1330;   /* panels, cards */
  --surface-2: #251A3D;   /* raised panels, table stripes */
  --line:      #3A2A54;   /* hairline borders */
  --ink:       #F5EFFB;   /* primary text */
  --ink-muted: #c5b5e4;   /* secondary text */
  --ink-faint: #6E6188;   /* tertiary text, captions */
  --ink-faint: #A899C4;

  --ember:   #FF7A4D;     /* sunset orange */
  --magenta: #D94F8C;     /* sunset magenta */
  --violet:  #8A5CF6;     /* bright violet accent */

  --gradient: linear-gradient(115deg, #6E42C9 0%, #D94F8C 55%, #FF7A4D 100%);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --max-text: 640px;
  --max-page: 1180px;
  --radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }
/* html { scroll-behavior: smooth; } */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.2em; color: var(--ink-muted); }
p:last-child { margin-bottom: 0; }

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

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 12, 30, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  display: inline-block;
  transform: translateY(-1px);
}

.site-nav {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--magenta);
}

/* ---------------- Hero ---------------- */
.hero {
  /* background: linear-gradient(180deg, var(--violet) 0%, #120C1E 100%); */
  background: linear-gradient(0deg, var(--violet) 0%, var(--void)50%);
  padding: 96px 0 88px;
  position: relative;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

/* .hero .wrap {
  text-align: center;
} */

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

.hero h1 {
  background-image: var(--gradient);
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
  /* max-width: 12ch; */
  max-width: 25ch; 
  margin-left: auto;
  margin-right: auto;
}

.hero .lede {
  max-width: 65ch;
  font-size: 1.1rem;
  color: var(--ink-muted);
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--gradient);
  color: #14091C;
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background-color: var(--line);
}
.btn-ghost:hover { border-color: var(--violet); }

.btn-icon-linkedin { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-muted); background-color: var(--line); transition: border-color 0.15s ease, color 0.15s ease; } .btn-icon-linkedin:hover { border-color: var(--violet); color: var(--ink); }
.btn-icon-linkedin svg { fill: #4fc3f7; }

.btn-icon-substack { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-muted); background-color: var(--line); transition: border-color 0.15s ease, color 0.15s ease; } .btn-icon-substack:hover { border-color: var(--violet); color: var(--ink); }
.btn-icon-substack svg { fill: #ff6719; }

.hero-figure svg { width: 100%; height: auto; }
.hero-figure img { width: 70%; margin: 0 auto; display: block; -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent), linear-gradient(to bottom, transparent, black 12%, black 88%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent), linear-gradient(to bottom, transparent, black 12%, black 88%, transparent); mask-composite: intersect; }
/* .hero-figure img { width: 70%; } */

.hero-figure .orbit-ring {
  transform-origin: 250px 250px;
  animation: orbit-spin linear infinite;
}
.hero-figure .orbit-ring.r1 { animation-duration: 34s; }
.hero-figure .orbit-ring.r2 { animation-duration: 52s; animation-direction: reverse; }
.hero-figure .orbit-ring.r3 { animation-duration: 74s; }

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------------- Sections ---------------- */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-head h2 { font-size: 1.6rem; }
/* .section-head .section-note { color: var(--ink-faint); font-size: 0.95rem; max-width: 40ch; } */
.section-head .section-note { color: var(--ink-faint); font-size: 0.95rem; max-width: 50ch; }

/* ---------------- Focus areas (home) ---------------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.focus-card {
  background: var(--void);
  padding: 28px 26px;
}

.focus-card .index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.focus-card h3 { font-size: 1.15rem; margin-top: 10px; }
.focus-card p { font-size: 0.95rem; }

/* ---------------- Portfolio preview strip (home) ---------------- */
.preview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.preview-card {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  display: block;
}

.preview-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.preview-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.preview-card:hover .thumb img { transform: scale(1.04); }

.preview-card .meta { padding: 16px 18px; }
.preview-card .meta .tag { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ember); }
.preview-card .meta h3 { font-size: 1.02rem; margin: 6px 0 0; }

/* ---------------- Portfolio grid (portfolio page) ---------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  gap: 18px;
}

.tile {
  position: relative;
  grid-column: span 2;
  grid-row: span 1;
  overflow: hidden;
  border: 1px solid var(--line);
  text-decoration: none;
  display: block;
  background: var(--surface);
}

.tile.size-lg { grid-column: span 2; grid-row: span 2; }
.tile.size-sm { grid-column: span 1; grid-row: span 1; }

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.tile .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  background: linear-gradient(0deg, rgba(18,12,30,0.92) 0%, rgba(18,12,30,0.15) 55%, rgba(18,12,30,0) 100%);
}

.tile .tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ember);
  margin-bottom: 4px;
}

.tile h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--ink);
}

.tile:hover img { transform: scale(1.06); filter: saturate(1.15); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
  pointer-events: none;
}
.tile:hover::after { border-color: var(--magenta); }

@media (max-width: 720px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .tile, .tile.size-lg, .tile.size-sm { grid-column: span 1; grid-row: span 1; }
}

/* ---------------- About page ---------------- */
.about-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
}

.about-photo {
  aspect-ratio: 3/4;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.about-photo svg { width: 100%; height: 100%; }

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

.stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}

.stat-list li span:first-child { color: var(--ink-faint); }
.stat-list li span:last-child { font-family: var(--font-mono); color: var(--ink); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
}

.timeline li:first-child { border-top: none; }
.timeline time { font-family: var(--font-mono); color: var(--ink-faint); font-size: 0.85rem; }
.timeline h3 { font-size: 1.02rem; margin-bottom: 4px; }
.timeline p { font-size: 0.95rem; margin: 0; }

/* ---------------- Article (portfolio entry) ---------------- */
.article-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.article-hero .wrap { text-align: center; }

.article-hero .tag { font-family: var(--font-mono); color: /*var(--ember)*/ var(--ink-muted); font-size: 0.85rem; }
.article-hero h1 { 
  /* max-width: 20ch;  */
  max-width: 25ch;
  font-size: clamp(2rem, 3.6vw, 2.8rem); 
  margin-top: 14px; 
  background-image: var(--gradient); 
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent;
  margin-left: auto; 
  margin-right: auto; 
  /* color: var(--ink);  */
}
.article-hero .summary { max-width: var(--max-text); font-size: 1.15rem; color: var(--ink-muted); margin-top: 18px; margin-left: auto; margin-right: auto; }

.article-meta {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  justify-content: center; 
  margin-left: auto; 
  margin-right: auto;
}

.article-body {
  /* max-width: var(--max-text); */
  max-width: 750px;
  position: relative;
  padding: 56px 0;
  margin: 0 auto; 

}

.article-body h2 { font-size: 1.35rem; margin-top: 2.2em; }
.article-body h2:first-child { margin-top: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0 40px;
}

.gallery figure { margin: 0; border: 1px solid var(--line); background: var(--surface); }
.gallery figure img { width: 100%; }
.gallery figcaption {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 40px;
  font-size: 0.92rem;
}

caption {
  text-align: left;
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

tbody tr:nth-child(odd) { background: var(--surface); }

.article-nav {
  display: flex;
  justify-content: space-between;
  padding: 32px 0 72px;
  border-top: 1px solid var(--line);
}

.article-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.article-nav a:hover { color: var(--ember); }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.site-footer a { color: var(--ink-faint); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 320px; }
  .focus-grid, .preview-strip { grid-template-columns: 1fr; }
  .about-layout { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .site-nav { gap: 16px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

.footnote-ref a { color: var(--ink-faint); text-decoration: none; font-size: 0.75em; vertical-align: super; } 
.footnotes { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--ink-faint); } 
.footnotes li { margin-bottom: 10px; } .footnote-back { margin-left: 6px; color: var(--ink-faint); text-decoration: none; }

.footnote-link { color: var(--ink-muted); text-decoration: underline; text-decoration-color: var(--ink-muted); } 
.footnote-link:hover { color: var(--ember); text-decoration-color: var(--ember); }


.gallery figure.wide { grid-column: 1 / -1; } 

.portfolio-section { margin-bottom: 56px; } 
.portfolio-section:last-child { margin-bottom: 0; } 
.portfolio-section-title { 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  color: var(--ember); 
  margin-bottom: 20px; 
  padding-bottom: 10px; 
  border-bottom: 1px solid var(--line); 
}

li {
  color: var(--ink-muted);
}

#portfolio .section-head { display: block; text-align: center; margin-bottom: 40px; } #portfolio .section-head .section-note { max-width: 70ch; margin: 8px auto 0; }

.keywords { text-align: center; font-weight: 400; color: var(--ink-muted); letter-spacing: 0.02em; margin: 32px auto 32px; max-width: 50ch; }

#publications .section-head { display: block; text-align: center; margin-bottom: 40px; }

.pub-list { list-style: none; margin: 0 auto; padding: 0; max-width: var(--max-text); } .pub-list li { padding: 20px 0; border-top: 1px solid var(--line); } .pub-list li:first-child { border-top: none; } .pub-citation { color: var(--ink-muted); font-size: 0.95rem; margin: 0 0 6px; } .pub-link { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ember); text-decoration: none; } .pub-link:hover { color: var(--magenta); }

