/* Industry design-system tokens (from the claude.ai/design project) + page styles. */

:root {
  --color-bg: #f2f2f3;
  --color-surface: #e9e9ea;
  --color-text: #1d1f20;
  --color-accent: #5980a6;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);

  --color-neutral-300: #d4d4d7;
  --color-neutral-500: #98989b;
  --color-neutral-600: #7a7a7d;
  --color-neutral-700: #5d5d60;

  --color-accent-700: #416180;
  --color-accent-900: #1d2d3d;

  --color-red: #9d2f27;
  --color-light: #f2f2f3;
  --color-light-line: rgba(242, 242, 243, 0.28);

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Barlow", system-ui, sans-serif;

  --page-max: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0;
}
p { margin: 0; }
figure { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--color-accent-700); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-red); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ── blueprint frame ──────────────────────────────────────────────────── */
.blueprint { position: relative; border: 1px solid var(--color-divider); }
.blueprint > .corner {
  position: absolute; width: 11px; height: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.blueprint > .corner::before, .blueprint > .corner::after {
  content: ""; position: absolute; background: currentColor;
}
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after  { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

/* ── layout helpers ───────────────────────────────────────────────────── */
.wrap { max-width: var(--page-max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(40px, 7vw, 96px); }
.rule-y { border-top: 1px solid var(--color-neutral-300); border-bottom: 1px solid var(--color-neutral-300); }

.sheet-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  border-bottom: 1px solid var(--color-neutral-300);
  padding-bottom: 12px; margin-bottom: clamp(28px, 5vw, 56px);
}
.sheet-head h2 { font-size: clamp(24px, 3vw, 34px); }
.sheet-no { font-size: 12px; letter-spacing: 0.1em; white-space: nowrap; color: var(--color-accent-700); }
.label { font-size: 12px; letter-spacing: 0.08em; color: var(--color-neutral-600); }
.kicker { font-size: 12px; letter-spacing: 0.08em; color: var(--color-accent-700); margin-bottom: 6px; }
.muted { color: var(--color-neutral-700); }
.lead { font-size: clamp(17px, 1.5vw, 20px); text-wrap: pretty; }

.num-list { list-style: none; margin: 0; padding: 0; display: grid; }
.num-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.num-list li > span:first-child { color: var(--color-accent); }

.photo { width: 100%; height: 100%; object-fit: cover; }
.photo-frame { filter: grayscale(1) contrast(1.05); overflow: hidden; }

.scale-bar { display: flex; align-items: center; gap: 8px; color: var(--color-neutral-600); }
.scale-bar .tick { width: 1px; height: 8px; background: currentColor; }
.scale-bar .line { flex: 1; height: 1px; background: currentColor; }
.scale-bar .txt { font-size: 11px; letter-spacing: 0.08em; }

/* ── sheet index (side nav + mobile bar) ─────────────────────────────── */
#sheet-index {
  position: fixed; left: 28px; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; gap: 14px;
}
#sheet-index a, #sheet-bar a {
  display: flex; align-items: center; font-size: 12px; letter-spacing: 0.08em;
  color: var(--color-neutral-500); transition: color 0.2s;
}
#sheet-index a { gap: 10px; }
#sheet-index a .dash { width: 18px; height: 1px; background: currentColor; opacity: 0.7; }
#sheet-index a .name { opacity: 0.75; }
#sheet-index a.is-active, #sheet-bar a.is-active { color: var(--color-red); }
#sheet-index a:hover, #sheet-bar a:hover { color: var(--color-red); }

#sheet-bar {
  display: none; position: sticky; top: 0; z-index: 30;
  background: rgba(242, 242, 243, 0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-neutral-300);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#sheet-bar .inner { display: flex; gap: 22px; padding: 12px 20px; width: max-content; }
#sheet-bar a { gap: 8px; white-space: nowrap; }
#sheet-bar a .name { opacity: 0.8; }

[id^="s0"] { scroll-margin-top: 56px; }

/* ── S-01 hero ────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(242,242,243,0.86) 0%, rgba(242,242,243,0.93) 55%, var(--color-bg) 100%);
}
.hero .wrap {
  position: relative; z-index: 1;
  padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(24px, 3vw, 40px);
}
.hero .sheet-head { margin-bottom: clamp(20px, 3vw, 36px); }
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.hero h1 { font-size: clamp(42px, 6vw, 78px); line-height: 0.98; letter-spacing: -0.02em; margin-bottom: 18px; }
.hero .tagline {
  font-family: var(--font-heading); font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.3; margin-bottom: 20px; color: var(--color-accent-700);
}
.hero .lead { max-width: 46ch; margin-bottom: clamp(20px, 3vw, 32px); }
.hero .notes { border-top: 1px solid var(--color-neutral-300); padding-top: 16px; }
.hero .notes .label { margin-bottom: 12px; }
.hero .notes .num-list { gap: 8px; font-size: 15px; }
.portrait { aspect-ratio: 1 / 1; max-width: 300px; }
.portrait + .scale-bar { max-width: 300px; margin-top: 10px; }

/* ── section drawings strip ───────────────────────────────────────────── */
.drawings {
  padding-top: clamp(16px, 2.5vw, 28px); padding-bottom: clamp(16px, 2.5vw, 28px);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(16px, 3vw, 40px);
}
.drawings > div { width: clamp(120px, 14vw, 170px); height: clamp(100px, 11vw, 140px); flex: none; }
.drawings svg { width: 100%; height: 100%; overflow: visible; }

/* ── S-02 works ───────────────────────────────────────────────────────── */
.works-intro { max-width: 56ch; margin: 0 auto clamp(28px, 4vw, 48px); text-align: center; }
.works-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(28px, 4vw, 56px); align-items: start;
  max-width: 1040px; margin-inline: auto;
}
.feature { padding: clamp(22px, 3vw, 34px); }
.feature .badge { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.feature .badge svg { width: 40px; height: 40px; flex: none; }
.feature h3 { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 12px; }
.feature p { max-width: 46ch; margin-bottom: 12px; }
.feature p.muted { margin-bottom: 20px; }
.feature > svg { display: block; width: 100%; max-width: 420px; height: auto; margin-inline: auto; }

.work-list { display: grid; gap: clamp(20px, 3vw, 32px); }
.work-item { border-top: 1px solid var(--color-neutral-300); padding-top: 16px; }
.work-item h3 { font-size: clamp(20px, 2.1vw, 25px); margin-bottom: 8px; }
.work-item p.muted { max-width: 52ch; }

/* ── software marquee ─────────────────────────────────────────────────── */
.software { padding: clamp(28px, 4vw, 44px) 0; overflow: hidden; }
.software .label { margin-bottom: clamp(18px, 2.4vw, 26px); }
.marquee { display: flex; width: max-content; gap: 14px; animation: marquee 34s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.chip {
  flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-neutral-300); padding: 14px 20px; min-width: 200px; min-height: 64px;
  font-family: var(--font-heading); font-size: 19px; white-space: nowrap;
}
.chip img { width: 150px; height: 40px; object-fit: contain; }
.chip img + span { margin-left: 14px; }
.chip img[src$="office.svg"] { width: 40px; }
.invert { filter: invert(1); }

/* ── S-04 recommendations ─────────────────────────────────────────────── */
.recs { background: rgba(242, 242, 243, 0.9); }
#rec-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 36px); max-width: 860px;
}
.rec { padding: 16px; }
.rec .photo-frame { aspect-ratio: 1 / 1; margin-bottom: 16px; background: var(--color-surface); }
.rec blockquote {
  margin: 0 0 12px; font-family: var(--font-heading);
  font-size: clamp(18px, 1.8vw, 21px); line-height: 1.25;
}
.rec figcaption { font-size: 13px; letter-spacing: 0.06em; color: var(--color-neutral-600); }

/* ── pivot + S-05 personal (dark) ─────────────────────────────────────── */
.pivot {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-accent-900) 100%);
  padding: clamp(40px, 7vw, 90px) var(--gutter);
}
.pivot p {
  max-width: var(--page-max); margin: 0 auto; text-align: center; letter-spacing: 0.01em;
  font-family: var(--font-heading); font-size: clamp(18px, 2.6vw, 30px); line-height: 1.3; color: var(--color-light);
}
.dark { background: var(--color-accent-900); color: var(--color-light); }
.dark .section { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(48px, 8vw, 100px); }
.dark .sheet-head { border-bottom-color: var(--color-light-line); }
.dark .sheet-no { color: #a8c0d6; }
.dark .blueprint { border-color: rgba(242, 242, 243, 0.4); }
.dark .blueprint > .corner { color: rgba(242, 242, 243, 0.6); }

.passions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(16px, 3vw, 40px); margin-bottom: clamp(24px, 4vw, 40px);
}
.passions > div {
  background: var(--color-light); padding: 16px 20px;
  width: clamp(150px, 22vw, 240px); height: 96px;
  display: flex; align-items: center; justify-content: center;
}
.passions img { width: 100%; height: 100%; object-fit: contain; }
.passions img[src*="liverpool"] { height: 62%; }
.rider { aspect-ratio: 16 / 10; margin-bottom: 12px; background: #24384c; }
.rider .photo { position: absolute; inset: 0; object-position: 50% 55%; }
.dark .scale-bar { color: rgba(242, 242, 243, 0.6); margin-bottom: clamp(32px, 5vw, 60px); }
.personal-text h3 { font-size: clamp(30px, 4.4vw, 54px); line-height: 1.02; margin-bottom: 16px; max-width: 18ch; }
.personal-text p { max-width: 44ch; font-size: clamp(16px, 1.4vw, 19px); color: rgba(242, 242, 243, 0.9); }

/* ── S-06 Mithril ─────────────────────────────────────────────────────── */
.mithril.section { padding-top: clamp(48px, 8vw, 110px); padding-bottom: clamp(48px, 8vw, 110px); }
.mithril-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(28px, 4vw, 64px); align-items: start;
}
.mithril h3 { font-size: clamp(26px, 3.4vw, 42px); line-height: 1.05; max-width: 26ch; margin-bottom: 18px; }
.mithril .body { max-width: 52ch; margin-bottom: 24px; }
.mithril .num-list { gap: 10px; max-width: 52ch; }
.mithril .num-list li { border-top: 1px solid var(--color-neutral-300); padding-top: 10px; }
.quote-box { padding: clamp(22px, 3vw, 32px); }
.quote-box .label { margin-bottom: 14px; }
.quote-box p:not(.label) { max-width: 40ch; margin-bottom: 18px; }
.quote-box svg { width: 100%; height: auto; }

/* ── footer ───────────────────────────────────────────────────────────── */
footer .wrap { padding-bottom: clamp(36px, 5vw, 64px); }
footer .row {
  border-top: 1px solid var(--color-neutral-300); padding-top: 14px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--color-neutral-600);
}

/* ── drawing animations ───────────────────────────────────────────────── */
@keyframes drawIn { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes drawCycle { 0% { stroke-dashoffset: 1; } 35% { stroke-dashoffset: 0; } 60% { stroke-dashoffset: 0; } 95% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 1; } }
@keyframes fadeCycle { 0%, 22% { opacity: 0; } 38%, 62% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

[data-draw-load] rect, [data-draw-load] line, [data-draw-load] path, [data-draw-load] polyline {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: drawCycle 7s ease-in-out infinite; animation-delay: var(--d, 0s);
}
[data-draw-load] [data-late] {
  stroke-dashoffset: 0; opacity: 0;
  animation: fadeCycle 7s ease-in-out infinite; animation-delay: var(--d, 0s);
}
[data-draw-load] [data-late] line, [data-draw-load] [data-late] rect { stroke-dashoffset: 0; animation: none; }

/* Scroll-driven reveals only where supported; otherwise everything is simply visible. */
@supports (animation-timeline: view()) {
  [data-draw-view] rect, [data-draw-view] line, [data-draw-view] path, [data-draw-view] polyline {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: drawIn 1.5s ease-out both;
    animation-timeline: view(); animation-range: entry 12% cover 42%;
  }
  [data-draw-view] [data-late] {
    stroke-dashoffset: 0; opacity: 0;
    animation: fadeIn 0.8s ease-out both;
    animation-timeline: view(); animation-range: entry 25% cover 55%;
  }
  [data-rise] {
    animation: riseIn 0.7s ease-out both;
    animation-timeline: view(); animation-range: entry 8% cover 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-draw-view] rect, [data-draw-view] line, [data-draw-view] path, [data-draw-view] polyline,
  [data-draw-view] [data-late], [data-draw-load] rect, [data-draw-load] line, [data-draw-load] path,
  [data-draw-load] polyline, [data-draw-load] [data-late], [data-rise], .marquee {
    animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important;
  }
}

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  #sheet-index { display: none; }
  #sheet-bar { display: block; }
}
@media (max-width: 640px) {
  #rec-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 40px; }
  .hero-grid { text-align: center; }
  .hero-grid > * { min-width: 0; }
  .hero .lead { margin-inline: auto; }
  .hero .notes { width: 100%; }
  .hero .notes .num-list { width: fit-content; max-width: 100%; margin-inline: auto; text-align: left; }
  .portrait, .portrait + .scale-bar { margin-inline: auto; }
}
