/* Shared site styles for the home page and case studies. The resume page still uses main.css. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ── Tokens ── */
:root {
  --paper: #fafbfd;
  --surface: #edf1f7;
  --ink: #14233f;
  --muted: #55617a;
  --line: #d5dbe6;
  --mark: #f2a900;          /* amber: the "after" colour */
  --btn-bg: #14233f;
  --btn-ink: #fafbfd;
  --band-bg: #14233f;
  --band-ink: #f3f6fb;
  --band-muted: #b4bfd3;

  --display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(72px, 10vw, 128px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1626;
    --surface: #131f35;
    --ink: #e8edf5;
    --muted: #a3aec2;
    --line: #26344e;
    --btn-bg: #f2a900;
    --btn-ink: #14233f;
    --band-bg: #131f35;
    --band-ink: #e8edf5;
    --band-muted: #a3aec2;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1626;
  --surface: #131f35;
  --ink: #e8edf5;
  --muted: #a3aec2;
  --line: #26344e;
  --btn-bg: #f2a900;
  --btn-ink: #14233f;
  --band-bg: #131f35;
  --band-ink: #e8edf5;
  --band-muted: #a3aec2;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: 12px; top: -60px; background: var(--btn-bg); color: var(--btn-ink); padding: 10px 14px; border-radius: 8px; z-index: 20; }
.skip-link:focus { top: 12px; }

h1, h2 { font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.08; }

/* ── Header ── */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { font-family: var(--display); font-weight: 650; font-size: 1.1rem; text-decoration: none; margin-right: auto; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); font-size: 0.95rem; }
.site-nav a { text-decoration: none; padding: 6px 0; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--ink); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 1.5px solid transparent; transition: transform 120ms ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mark) 45%, transparent); }
.btn-quiet { border-color: currentColor; }
.btn-quiet:hover { background: color-mix(in srgb, currentColor 9%, transparent); }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: clamp(32px, 6vw, 88px); align-items: end; padding-top: clamp(48px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 96px); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.25rem); line-height: 1; max-width: 13ch; }
.hero-lede { margin-top: 28px; max-width: 58ch; font-size: clamp(1.08rem, 1.5vw, 1.25rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 18px; color: var(--muted); font-size: 0.95rem; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px 6px 120px 6px; }

.hero-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: clamp(48px, 7vw, 80px); padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts dt { font-family: var(--display); font-weight: 650; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.01em; }
.hero-facts dd { margin-top: 4px; color: var(--muted); font-size: 0.95rem; line-height: 1.4; max-width: 22ch; }

/* ── Work ── */
.work { background: var(--surface); padding-block: var(--section); }
.section-lede { margin-top: 14px; color: var(--muted); max-width: 60ch; }

.case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 88px); align-items: center; padding-block: clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.case:first-of-type { margin-top: clamp(24px, 4vw, 40px); border-top: 1px solid var(--line); }
.case-where { color: var(--muted); font-size: 0.92rem; }
.case h3 { margin-top: 8px; font-family: var(--display); font-weight: 650; font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.15; letter-spacing: -0.01em; }
.case h3 a { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.case h3 a:hover { text-decoration-color: currentColor; }
.case-text > p:not(.case-where) { margin-top: 14px; max-width: 52ch; }
.case-text > .case-also { color: var(--muted); font-size: 0.97rem; }

/* The before → after line */
.shift figcaption { font-weight: 600; font-size: 0.97rem; }
.shift-track { position: relative; height: 6px; margin: 58px 34px 78px; background: var(--line); border-radius: 3px; }
.shift-bar { position: absolute; top: 0; bottom: 0; left: var(--lo); width: var(--span); background: var(--mark); border-radius: 3px; transform-origin: left center; }
.shift[data-dir="down"] .shift-bar { transform-origin: right center; }
.shift-from, .shift-to { position: absolute; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.shift-from { left: var(--from); width: 16px; height: 16px; background: var(--shift-bg, var(--surface)); border: 3px solid var(--muted); }
.shift-to { left: var(--to); width: 22px; height: 22px; background: var(--mark); border: 3px solid var(--ink); }
.shift-label { position: absolute; transform: translateX(-50%); white-space: nowrap; text-align: center; font-family: var(--display); font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.shift-label small { display: block; margin-top: 5px; font-family: var(--body); font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.shift-label.is-from { left: var(--from); bottom: 20px; font-size: 1.1rem; color: var(--muted); }
.shift-label.is-to { left: var(--to); top: 24px; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.shift-label.at-start { transform: translateX(-11px); text-align: left; }
.shift-label.at-end { transform: translateX(calc(-100% + 11px)); text-align: right; }
.shift-axis { display: flex; justify-content: space-between; margin-inline: 34px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* One reveal: the line draws from "before" to "after" */
.can-animate .shift .shift-bar { transition: transform 900ms cubic-bezier(.2, .7, .2, 1); }
.can-animate .shift .shift-to { transition: left 900ms cubic-bezier(.2, .7, .2, 1); }
.can-animate .shift .shift-label.is-to { transition: left 900ms cubic-bezier(.2, .7, .2, 1), opacity 400ms ease 500ms; }
.can-animate .shift:not(.is-in) .shift-bar { transform: scaleX(0); }
.can-animate .shift:not(.is-in) .shift-to { left: var(--from); }
.can-animate .shift:not(.is-in) .shift-label.is-to { left: var(--from); opacity: 0; }

.more-title { margin-top: clamp(40px, 6vw, 64px); font-family: var(--display); font-weight: 650; font-size: 1.25rem; }
.more-list { margin-top: 12px; }
.more-list a { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 8px clamp(28px, 6vw, 88px); padding-block: 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.more-name { font-weight: 600; text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.more-list a:hover .more-name { text-decoration-color: currentColor; }
.more-result { color: var(--muted); }

/* ── About ── */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 6vw, 88px); padding-block: var(--section); }
.about-text p { margin-top: 20px; max-width: 54ch; }
.about-text .about-edu { color: var(--muted); font-size: 0.97rem; }

.timeline li { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 20px; padding-block: 22px; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline strong { display: block; font-family: var(--display); font-weight: 650; font-size: 1.15rem; line-height: 1.25; }
.timeline .role { display: block; margin-top: 2px; }
.timeline p { margin-top: 6px; color: var(--muted); font-size: 0.97rem; }

/* ── Capabilities ── */
.skills { padding-bottom: var(--section); }
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); margin-top: clamp(28px, 4vw, 44px); }
.skills-grid > div { padding-top: 18px; border-top: 3px solid var(--ink); }
.skills-grid h3 { font-family: var(--display); font-weight: 650; font-size: 1.15rem; line-height: 1.25; }
.skills-grid p { margin-top: 10px; color: var(--muted); }

/* ── Contact ── */
.contact { background: var(--band-bg); color: var(--band-ink); padding-block: var(--section); }
.contact h2 { max-width: 20ch; font-size: clamp(2.2rem, 5.4vw, 4rem); line-height: 1.02; }
.contact-lede { margin-top: 22px; max-width: 56ch; color: var(--band-muted); font-size: 1.1rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.contact .btn-primary { background: var(--mark); color: #14233f; }
.contact-mail { margin-top: 20px; color: var(--band-muted); font-size: 0.95rem; user-select: all; }

/* ── Footer ── */
.site-footer { padding-block: 28px; font-size: 0.92rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { text-underline-offset: 4px; }
.site-footer a:hover { color: var(--ink); }

/* ── Small screens ── */
@media (max-width: 860px) {
  .case, .about, .more-list a { grid-template-columns: minmax(0, 1fr); }
  .skills-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-photo { order: -1; width: 132px; margin-bottom: 28px; }
  .hero-photo img { border-radius: 4px 4px 52px 4px; }
  .nav-cta { display: none; }
  .shift-track { margin-inline: 30px; }
  .shift-axis { margin-inline: 30px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (max-width: 420px) {
  .btn { width: 100%; }
  .site-nav { gap: 14px; font-size: 0.9rem; }
}
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 5px; }
