/* ------------------------------------------------------------------
   sarah-allec.github.io — stylesheet
   Colors live in the :root block below. Change them there.
   ------------------------------------------------------------------ */

:root {
  /* Dark is the default theme. The light palette is applied by the toggle in the nav. */
  --bg: #0d1219;
  --bg-elev: #141b26;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --line: #243040;
  --accent: #5cc4dd;
  --accent-soft: #14303c;
  --accent-ink: #8fd8ea;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 72rem;
  --prose: 44rem;
  --grad: linear-gradient(90deg, #5cc4dd, #8caaff 55%, #d66ebe);
  --radius: 999px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbfaf7;
  --bg-elev: #ffffff;
  --text: #1c1c1a;
  --muted: #5f5e58;
  --line: #e4e2db;
  --accent: #0f6e8c;
  --accent-soft: #e3f0f4;
  --accent-ink: #0b5871;
  color-scheme: light;
}

/* Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 600; }
h2 { font-size: 2rem; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
h2 .num { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; color: var(--accent); }
h3 { font-size: 1.2rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 0.5rem 1rem; }
.skip-link:focus { left: 1rem; z-index: 10; }

.muted { color: var(--muted); }

/* Header ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav {
  max-width: var(--measure); margin: 0 auto; padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { font-family: var(--font-serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem 1.1rem; flex-wrap: wrap; }
.site-nav ul a { text-decoration: none; color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.site-nav ul a:hover, .site-nav ul a.is-active { color: var(--accent-ink); }
.site-nav ul a { position: relative; padding-bottom: 2px; }
.site-nav ul a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 1px; background: var(--grad); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--muted);
  cursor: pointer; padding: 0; margin-left: 0.5rem;
}
.theme-toggle:hover { color: var(--accent-ink); border-color: var(--accent); }
.theme-toggle svg { width: 1rem; height: 1rem; fill: currentColor; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.card:hover { box-shadow: 0 14px 34px -18px rgba(0,0,0,0.6); }

/* Layout ---------------------------------------------------------- */
main { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem 4rem; }
.section { display: grid; grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr); gap: 2rem 4rem; padding: 5rem 0; }
.section + .section { border-top: 1px solid var(--line); }
main > .hero + .section { padding-top: 4rem; }
.section-head { align-self: start; position: sticky; top: 5rem; }
.section-head h2 { display: block; margin-bottom: 0.75rem; }
.section-head h2 .num { display: inline-block; vertical-align: 0.35em; margin-right: 0.6rem; }
.section-head h2::after { content: ""; display: block; width: 3rem; height: 3px; margin-top: 0.85rem; border-radius: 2px; background: var(--grad); }
.lede { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 16rem; }
.side-links { margin: 0.75rem 0 0; font-size: 0.9rem; }
@media (max-width: 860px) {
  .section { grid-template-columns: 1fr; gap: 1.5rem; padding: 3.5rem 0; }
  .section-head { position: static; }
  .section-head h2 { flex-wrap: wrap; }
  .section-head h2::after { display: none; }
  .lede { max-width: none; }
}

/* Hero ------------------------------------------------------------ */
.hero {
  position: relative; isolation: isolate;
  color: #f2f4f7;
  /* full-bleed band regardless of the centred column */
  width: 100vw; margin-left: calc(50% - 50vw);
  padding: 7rem 0 5.5rem;
  min-height: min(78vh, 42rem);
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8,14,26,0.60) 0%, rgba(8,14,26,0.48) 55%, var(--bg) 100%),
    url("../img/header.jpg") center 40% / cover no-repeat,
    #0b1220;
}
.hero-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-inner { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }
.hero h1 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.45); }
.eyebrow { margin: 0 0 0.75rem; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(242,244,247,0.75); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: #fff; }
.tagline { font-family: var(--font-serif); font-size: clamp(1.2rem, 2.6vw, 1.5rem); color: rgba(242,244,247,0.88); max-width: 34rem; margin: 1.25rem 0 1.75rem; line-height: 1.4; text-shadow: 0 1px 12px rgba(0,0,0,0.5); }
.hero .pill { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.28); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero .pill:hover { background: rgba(255,255,255,0.22); border-color: #fff; color: #fff; }

.link-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: border-color 120ms, background 120ms;
}
.pill:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.pill svg { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }

/* About ----------------------------------------------------------- */
.prose { max-width: var(--prose); }
.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }
.label { margin: 2.5rem 0 0.9rem; font-size: 0.8rem; font-family: var(--font-sans); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.section-body > .label:first-child, .cols .label { margin-top: 0; }
.tag-rows { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
.tag-rows .label { margin-top: 0; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.85rem; padding: 0.3rem 0.75rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); border: 1px solid transparent; transition: border-color 120ms; }
.tags li:hover { border-color: var(--accent); }

/* Cards ----------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative; display: block;
  padding: 1.35rem 1.35rem 1.25rem; border-radius: 16px;
  background: var(--bg-elev); border: 1px solid var(--line);
  color: inherit; text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.card::before { content: ""; position: absolute; inset: -1px; border-radius: 17px; padding: 1px; background: var(--grad); opacity: 0; transition: opacity 160ms ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -18px rgba(15,110,140,0.45); }
.card:hover::before { opacity: 1; }
.card h3 { margin: 0.85rem 0 0.4rem; font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); }
.card p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.card-icon { display: inline-flex; width: 2.6rem; height: 2.6rem; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.card-icon svg { width: 1.5rem; height: 1.5rem; }
.card-link { display: inline-block; margin-top: 0.85rem; font-size: 0.88rem; font-weight: 500; text-decoration: none; color: var(--accent-ink); }
.card-link:hover { text-decoration: underline; }
.cards.software { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .cards.software { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards.software { grid-template-columns: 1fr; } }
.sw-card { display: grid; gap: 0.6rem; align-content: start; padding: 1.15rem 1.2rem; }
.sw-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sw-head svg { width: 1.1rem; height: 1.1rem; fill: currentColor; color: var(--muted); }
.sw-name { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; }
.sw-role { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); }
.sw-text { font-size: 0.9rem; color: var(--muted); }
.pub-card { display: grid; gap: 0.35rem; align-content: start; }
.pub-card-venue { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pub-card-title { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.3; color: var(--text); }
.pub-card-authors { font-size: 0.85rem; color: var(--muted); }
.pub-card-authors strong { color: var(--text); }

/* Timeline -------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: 0 0 2rem 1.75rem; }
.timeline > li::before { content: ""; position: absolute; left: 0.45rem; top: 0.55rem; bottom: -0.55rem; width: 2px; background: var(--line); }
.timeline > li:last-child::before { display: none; }
.timeline > li::after { content: ""; position: absolute; left: 0; top: 0.35rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-sizing: border-box; }
.timeline > li:first-child::after { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline > li:last-child { padding-bottom: 0.5rem; }
.timeline .when { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.timeline .what h3 { margin: 0 0 0.2rem; font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); }
.timeline .where { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.95rem; }
.timeline .what p { margin: 0; }
.timeline .details { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 560px) {
  .timeline > li { grid-template-columns: 1fr; gap: 0.15rem; padding-bottom: 1.5rem; }
}

/* Publications ---------------------------------------------------- */
.year-block { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; padding-top: 1.25rem; }
.year-block + .year-block { border-top: 1px solid var(--line); margin-top: 0.5rem; }
h4.year { margin: 0.7rem 0 0; font-family: var(--font-serif); font-size: 1.35rem; font-weight: 500; color: var(--accent-ink); }
@media (max-width: 560px) { .year-block { grid-template-columns: 1fr; gap: 0; } }
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: 0.75rem 0.75rem; margin: 0 -0.75rem; border-radius: 10px; display: grid; gap: 0.15rem; transition: background 120ms; }
.pubs li:hover { background: var(--accent-soft); }
.pub-title a { color: var(--text); text-decoration: none; font-weight: 500; }
.pub-title a:hover { color: var(--accent-ink); text-decoration: underline; }
.pub-authors { font-size: 0.92rem; color: var(--muted); }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: 0.92rem; color: var(--muted); }
.pub-venue b { font-weight: 600; }

/* More ------------------------------------------------------------ */
.cols { column-gap: 2.5rem; }
@media (min-width: 640px) { .cols { column-count: 2; } }
.cols > div { break-inside: avoid; margin-bottom: 1.5rem; }
.cols h3 { margin-top: 1rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: grid; gap: 0.1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }
.item-title { font-weight: 500; }
.item-meta { font-size: 0.9rem; color: var(--muted); }

/* Footer ---------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer p { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1.5rem; color: var(--muted); font-size: 0.88rem; }

/* Reveal on scroll (only when JS is running) ------------------------ */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.js-reveal .reveal .section-head { transition-delay: 0ms; }

@media print {
  .site-header, .link-row, .site-footer { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}
