/* =========================================================
   Taylor Erwin — Portfolio
   Faithful port of the "Anthropic Portfolio" dark design comp.
   Tokens, layout, sections, motion, responsive, a11y.
   ========================================================= */

:root {
  /* Surfaces */
  --bg:        #0C0B0A;
  --bg-raise:  #100E0C;   /* card hover */
  --hatch-a:   #17140F;   /* placeholder stripe */
  --hatch-b:   #0F0D0C;

  /* Ink */
  --ink:       #F1ECE3;   /* primary */
  --ink-2:     #E7E1D6;
  --ink-3:     #C3BCB0;
  --ink-4:     #A8A296;
  --ink-5:     #9B958A;
  --ink-6:     #8C867B;
  --ink-7:     #6E685F;   /* faint / placeholder captions */

  /* Accent */
  --accent:    #E08862;   /* burnt orange */

  /* Hairlines */
  --line-10:   rgba(241,236,227,.10);
  --line-12:   rgba(241,236,227,.12);
  --line-16:   rgba(241,236,227,.16);
  --line-25:   rgba(241,236,227,.25);
  --line-50:   rgba(241,236,227,.50);

  /* Type */
  --display: 'Schibsted Grotesk', system-ui, sans-serif;
  --body:    'Hanken Grotesk', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Layout */
  --wrap: 1180px;
  --pad-x: 48px;
  --rail-x: 34px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }

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

/* Skip link */
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 80;
  background: var(--accent); color: var(--bg);
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  padding: 10px 14px; border-radius: 3px; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* Visible, consistent focus ring */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; width: 100%; position: relative; }

/* ---------- Progress bar ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 60;
  box-shadow: 0 0 12px rgba(224,136,98,.7);
  will-change: width;
}

/* ---------- Side nav rail ---------- */
.rail {
  position: fixed; top: 50%; left: var(--rail-x); transform: translateY(-50%);
  z-index: 50; display: flex; flex-direction: column; gap: 16px;
}
.rail a {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; cursor: pointer;
}
.rail-dot {
  width: 16px; height: 1px; background: var(--line-25);
  transition: width .35s, background .35s; flex: none;
}
.rail-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .35s, transform .35s, color .35s;
  white-space: nowrap; pointer-events: none;
}
.rail a.is-active .rail-dot { width: 34px; background: var(--accent); }
.rail a.is-active .rail-label { color: var(--accent); }
.rail:hover .rail-label { opacity: 1; transform: translateX(0); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 44px; pointer-events: none;
}
.wordmark {
  font-family: var(--display); font-weight: 600; font-size: 15px;
  letter-spacing: .01em; color: var(--ink);
}
.topbar-cta {
  pointer-events: auto; font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  text-decoration: none; transition: color .3s;
}
.topbar-cta:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding: 124px 48px 96px 96px;
  position: relative; overflow: hidden;
}
.hero-wrap { max-width: var(--wrap); }
.hero-glow {
  position: absolute; top: -18%; right: -12%; width: 780px; height: 780px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,136,98,.20), rgba(224,136,98,0) 62%);
  filter: blur(8px); pointer-events: none;
  animation: drift 18s ease-in-out infinite;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-04, rgba(241,236,227,.04)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241,236,227,.04) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 78%);
          mask-image: radial-gradient(circle at 70% 30%, #000, transparent 78%);
}

.eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.eyebrow-line { width: 30px; height: 1px; background: var(--accent); flex: none; }
.eyebrow-text {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(40px, 5.6vw, 86px); line-height: 1.01;
  letter-spacing: -.03em; max-width: 16ch; text-wrap: balance;
}
.hero-title--map { font-size: clamp(40px, 5.2vw, 78px); line-height: 1.03; max-width: 15ch; }
.hero-lede {
  margin-top: 34px; max-width: 62ch;
  font-size: clamp(16px, 1.35vw, 20px); line-height: 1.62; color: var(--ink-4);
}

/* Placeholder image bands ("images later") */
.ph {
  background-image: repeating-linear-gradient(45deg, var(--hatch-a) 0 11px, var(--hatch-b) 11px 22px);
  border: 1px solid var(--line-12);
  position: relative; display: flex;
}
.ph::after {
  content: attr(data-label);
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  color: var(--ink-7); line-height: 1.35; padding: 16px; max-width: 32ch;
}
.ph-hero {
  margin-top: 52px; aspect-ratio: 21 / 9; width: 100%;
  align-items: center; justify-content: center; text-align: center;
}
.ph-shot {
  aspect-ratio: 4 / 3; align-items: flex-end;
  background-image: repeating-linear-gradient(45deg, var(--hatch-a) 0 9px, var(--hatch-b) 9px 18px);
  border: none;
}
.ph-shot::after { padding: 14px; font-size: 10px; }
.ph-map { aspect-ratio: 4 / 3; width: 100%; align-items: center; justify-content: center; text-align: center; }
.ph-case { margin-top: 26px; aspect-ratio: 5 / 4; width: 100%; align-items: center; justify-content: center; text-align: center; }

/* Metric band */
.metric-band {
  margin-top: 40px; display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--line-12);
  border-top: 1px solid var(--line-12); border-bottom: 1px solid var(--line-12);
}
.metric { background: var(--bg); padding: 26px 18px 24px 0; }
.metric-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: nowrap; }
.metric-num {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(28px, 3vw, 48px); line-height: 1; letter-spacing: -.02em; color: var(--ink);
}
.metric-unit { font-family: var(--mono); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.metric-cap { margin-top: 11px; font-size: 12.5px; line-height: 1.4; color: var(--ink-6); }

/* Project shot band */
.shot-band {
  margin-top: 1px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line-12); border-bottom: 1px solid var(--line-12);
}

/* Map variant */
.map-grid { margin-top: 56px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: end; }
.map-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: baseline;
  padding: 20px 0; border-top: 1px solid var(--line-12);
}
.map-org { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.map-note { font-size: 14px; color: var(--ink-4); line-height: 1.45; }
.map-region { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.map-foot { margin-top: 30px; max-width: 50ch; font-size: 16px; line-height: 1.6; color: var(--ink-4); }

/* ---------- Generic band/section ---------- */
.band { padding: 150px 48px; border-top: 1px solid var(--line-10); position: relative; }
.band--glow { overflow: hidden; }
.phil-glow {
  position: absolute; bottom: -20%; left: -10%; width: 680px; height: 680px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(224,136,98,.13), rgba(224,136,98,0) 64%);
}

.sec-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 42px; }
.sec-eyebrow > .accent, .sec-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
}
.sec-rule { width: 30px; height: 1px; background: var(--line-25); }
.sec-kicker { text-transform: uppercase; color: var(--ink-6); }

.sec-title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(30px, 3.9vw, 58px); line-height: 1.07; letter-spacing: -.025em; max-width: 20ch;
}
.sec-title--mb { margin-bottom: 72px; }

/* ---------- 01 Fit ---------- */
.fit-grid { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px 72px; }
.fit-lede { font-size: clamp(16px, 1.4vw, 20px); line-height: 1.64; color: var(--ink-3); }
.fit-list { display: flex; flex-direction: column; }
.fit-item { display: flex; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line-10); }
.fit-n { font-family: var(--mono); font-size: 12px; padding-top: 3px; }
.fit-t { font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* ---------- 02 Proof of Scale ---------- */
.pillars {
  display: flex; flex-direction: column; gap: 1px; background: var(--line-12);
  border-top: 1px solid var(--line-12); border-bottom: 1px solid var(--line-12);
}
.pillar {
  background: var(--bg); display: grid; grid-template-columns: .9fr 1.4fr 1.1fr;
  gap: 40px; padding: 46px 8px;
  transition: background .4s, padding-left .4s, box-shadow .4s;
}
.pillar:hover { background: var(--bg-raise); padding-left: 20px; box-shadow: inset 3px 0 0 var(--accent); }
.pillar-org { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.6vw, 40px); letter-spacing: -.02em; transition: color .35s; }
.pillar:hover .pillar-org { color: var(--accent); }
.pillar-role { margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.pillar-body p { font-size: 17px; line-height: 1.62; color: var(--ink-3); }
.tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; letter-spacing: .02em; color: var(--ink-6); border: 1px solid var(--line-16); border-radius: 999px; padding: 5px 12px; }
.pillar-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-12); align-self: start; }
.pm { background: var(--bg); padding: 14px 16px; }
.pm-v { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
.pm-l { margin-top: 4px; font-size: 11.5px; line-height: 1.35; color: var(--ink-6); }

/* ---------- 03 Capability matrix ---------- */
.matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-12); border: 1px solid var(--line-12); }
.cell { background: var(--bg); padding: 30px 26px; min-height: 144px; transition: background .35s; }
.cell:hover { background: var(--bg-raise); }
.cell-t { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.cell-d { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-6); }

/* ---------- 04 Case studies ---------- */
.cases { margin-top: 48px; display: flex; flex-direction: column; gap: 1px; background: var(--line-12); border-top: 1px solid var(--line-12); }
.case { background: var(--bg); padding: 56px 0; display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; border-bottom: 1px solid var(--line-12); }
.case-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 14px; }
.case-title { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -.02em; }
.case-rows { display: flex; flex-direction: column; align-self: center; }
.case-row { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line-10); }
.case-k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.case-v { font-size: 16px; line-height: 1.55; color: var(--ink-3); }

/* ---------- 05 Philosophy ---------- */
.principles { display: flex; flex-direction: column; }
.principle { display: grid; grid-template-columns: 64px 1fr; gap: 32px; align-items: baseline; padding: 30px 0; border-top: 1px solid var(--line-10); }
.principle-n { font-family: var(--mono); font-size: 13px; }
.principle-t { font-family: var(--display); font-weight: 500; font-size: clamp(20px, 2vw, 28px); letter-spacing: -.01em; line-height: 1.2; }
.principle-d { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--ink-5); max-width: 62ch; }

/* ---------- 06 Contact ---------- */
.contact-lede { margin-top: 34px; max-width: 64ch; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.64; color: var(--ink-4); }
.closing { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-12); border-top: 1px solid var(--line-12); border-bottom: 1px solid var(--line-12); }
.closing-item { background: var(--bg); padding: 30px 24px 30px 0; font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -.01em; line-height: 1.28; color: var(--ink); }
.signoff { margin-top: 88px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 40px; border-top: 2px solid var(--line-50); padding-top: 34px; }
.signoff-name { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.6vw, 50px); letter-spacing: -.02em; line-height: 1; }
.signoff-loc { margin-top: 12px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--ink-6); }
.signoff-links { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.signoff-link { font-family: var(--display); font-size: 16px; text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; transition: color .3s; }
.signoff-link:hover { color: var(--accent); }

/* ---------- Hero variant switch (net-new) ---------- */
.hero-switch {
  position: fixed; right: 20px; bottom: 20px; z-index: 55;
  display: flex; align-items: center; gap: 6px;
  background: rgba(16,14,12,.82); backdrop-filter: blur(8px);
  border: 1px solid var(--line-16); border-radius: 999px; padding: 6px 8px 6px 14px;
}
.hero-switch-label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-6); margin-right: 2px; }
.hero-switch button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: transparent; color: var(--ink-4); border: 0; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; transition: background .25s, color .25s;
}
.hero-switch button:hover { color: var(--ink); }
.hero-switch button.is-on { background: var(--accent); color: var(--bg); }

/* =========================================================
   Scroll-reveal — applied by JS only (fail-open: visible by default)
   ========================================================= */
.js-anim [data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity .8s cubic-bezier(.2,.6,.2,1), transform .8s cubic-bezier(.2,.6,.2,1);
}
.js-anim [data-reveal].is-shown { opacity: 1; transform: translateY(0); }

@keyframes drift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-2%, 2%); }
  100% { transform: translate(0, 0); }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  :root { --pad-x: 40px; }
  .hero { padding: 116px 40px 84px 64px; }
  .band { padding: 120px 40px; }
}

@media (max-width: 900px) {
  .rail { display: none; }                 /* rail overlaps content on small screens */
  .hero { padding: 104px 24px 72px; }
  .band { padding: 96px 24px; }
  .topbar { padding: 20px 24px; }
  .sec-title--mb { margin-bottom: 48px; }

  .fit-grid { grid-template-columns: 1fr; gap: 36px; margin-top: 48px; }
  .map-grid { grid-template-columns: 1fr; gap: 32px; align-items: stretch; }
  .pillar { grid-template-columns: 1fr; gap: 24px; padding: 36px 0; }
  .pillar:hover { padding-left: 0; box-shadow: none; background: var(--bg); }  /* no horizontal shift when stacked */
  .pillar-metrics { max-width: 360px; }
  .case { grid-template-columns: 1fr; gap: 32px; padding: 44px 0; }
  .matrix { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .hero { padding: 96px 18px 64px; }
  .band { padding: 80px 18px; }
  .topbar { padding: 16px 18px; }
  .topbar-cta { font-size: 10px; letter-spacing: .1em; }
  .metric-band { grid-template-columns: repeat(2, 1fr); }
  .metric { padding: 20px 14px 18px 0; }
  .shot-band { grid-template-columns: repeat(2, 1fr); }
  .matrix { grid-template-columns: 1fr; }
  .closing { grid-template-columns: 1fr; }
  .closing-item { padding: 22px 0; border-bottom: 1px solid var(--line-12); }
  .map-row { grid-template-columns: 1fr; gap: 6px; }
  .map-region { justify-self: start; }
  .case-row { grid-template-columns: 1fr; gap: 6px; }
  .signoff { gap: 28px; }
  .hero-switch { right: 12px; bottom: 12px; padding: 5px 7px 5px 11px; }
  .hero-switch-label { display: none; }
}

/* =========================================================
   Reduced motion — kill movement, keep everything visible
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-glow { animation: none; }
  .js-anim [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .001ms !important; }
}
