/* ============================================================
   BEN YOO — portfolio v2 · Nyoo Studio design system
   "After-Service Strategy Table": warm near-black paper,
   ivory ink, red = act, amber = signal, Barlow display +
   Instrument Serif hinge words, Hanken Grotesk body,
   BlueprintMark registration crosshair.
   ============================================================ */

:root {
  --paper: #0d0a09;
  --paper-2: #17110f;
  --paper-3: #1f1814;
  --ink: #f2ede4;
  --ink-soft: #d8d0c4;
  --stone: #b8aea1;
  --red: #c41230;
  --red-deep: #8f0d23;
  --amber: #c17f3a;
  --amber-deep: #7f4b1b;
  --line: rgba(242, 237, 228, 0.12);
  --line-strong: rgba(242, 237, 228, 0.24);
  --line-amber: rgba(193, 127, 58, 0.3);
  --font-display: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-accent: "Instrument Serif", Georgia, serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(22px, 5.5vw, 80px);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

section[id] { scroll-margin-top: 4.5rem; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* tactile grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 90;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--amber); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* hinge words: Instrument Serif italic, lowercase, amber signal */
em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  color: var(--amber);
}

/* labels (was mono): Hanken 600, wide tracking */
.mono {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* BlueprintMark: amber registration crosshair */
.bpmark {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1px solid var(--amber);
  border-radius: 50%;
  position: relative;
  vertical-align: -1px;
}
.bpmark::before,
.bpmark::after {
  content: "";
  position: absolute;
  background: var(--amber);
}
.bpmark::before { left: 50%; top: -3px; bottom: -3px; width: 1px; transform: translateX(-50%); }
.bpmark::after { top: 50%; left: -3px; right: -3px; height: 1px; transform: translateY(-50%); }

/* ============ Preloader ============ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--paper);
  display: flex;
  align-items: flex-end;
  transition: transform 0.9s var(--ease-out);
}
.preloader.done { transform: translateY(-100%); }
.preloader-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: var(--pad);
}
.preloader-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.preloader-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.92;
  color: var(--amber);
}

/* ============ Progress bar ============ */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  background: var(--amber);
  transform-origin: 0 0;
  transform: scaleX(0);
  z-index: 1001;
}

/* ============ Header ============ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem var(--pad);
  transition: transform 0.5s var(--ease-out);
  background: linear-gradient(to bottom, rgba(13, 10, 9, 0.9), rgba(13, 10, 9, 0));
}
.header.hidden { transform: translateY(-110%); }
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.header-nav a { position: relative; padding: 0.25rem 0; color: var(--stone); transition: color 0.25s; }
.header-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: 100% 0;
  transition: transform 0.35s var(--ease-out);
}
.header-nav a:hover { color: var(--ink); }
.header-nav a:hover::after { transform: scaleX(1); transform-origin: 0 0; }
.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  padding: 0.5rem 1.1rem;
  transition: border-color 0.3s, background 0.3s;
}
.header-status:hover { border-color: var(--amber); background: rgba(193, 127, 58, 0.1); }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193, 127, 58, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(193, 127, 58, 0); }
}
@media (max-width: 720px) {
  .header-nav { display: none; }
}

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--pad) + 4rem) var(--pad) var(--pad);
  position: relative;
  background:
    radial-gradient(1100px 500px at 82% 8%, rgba(193, 127, 58, 0.12), transparent 65%),
    radial-gradient(800px 420px at 8% 92%, rgba(196, 18, 48, 0.07), transparent 60%),
    var(--paper);
}
.hero-eyebrow {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--stone);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  margin-bottom: clamp(2rem, 6vh, 5rem);
}
@media (max-width: 720px) {
  .hero-eyebrow-right { display: none; }
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.9rem, 8vw, 8rem);
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: clamp(2rem, 6vh, 4.5rem);
}
.hero-title em { font-size: 0.96em; }
.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}
.hero-line-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
}
.hero-line:nth-child(2) .hero-line-inner { transition-delay: 0.12s; }
body.loaded .hero-line-inner { transform: translateY(0); }

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.hero-blurb {
  max-width: 38ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--ink-soft);
  line-height: 1.6;
}
.hero-portrait {
  flex-shrink: 0;
  position: relative;
  transform: rotate(3deg);
  transition: transform 0.4s var(--ease-out);
}
.hero-portrait:hover { transform: rotate(-2deg) scale(1.05); }
.hero-portrait img {
  width: clamp(84px, 9vw, 120px);
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-amber);
  filter: sepia(0.25) contrast(1.02);
}
.hero-portrait::after {
  content: "Hi, I'm Ben";
  position: absolute;
  bottom: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: right;
  color: var(--stone);
}
.hero-meta sup { color: var(--amber); }
@media (max-width: 720px) {
  .hero-foot { flex-wrap: wrap; }
  .hero-meta { text-align: left; flex-direction: row; flex-wrap: wrap; gap: 1rem; }
}
.hero-scroll {
  position: absolute;
  right: var(--pad);
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--stone);
  writing-mode: vertical-rl;
}
.hero-scroll-bar {
  width: 1px;
  height: 48px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.hero-scroll-bar::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 40%;
  background: var(--amber);
  animation: scrollhint 1.8s var(--ease-out) infinite;
}
@keyframes scrollhint {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(260%); }
}
@media (max-width: 900px) { .hero-scroll { display: none; } }

/* ============ Marquee (proof strip) ============ */
.marquee {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  overflow: hidden;
  padding: 1rem 0;
  margin: 3rem 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.marquee-group span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.marquee-group i {
  font-style: normal;
  color: var(--amber);
  margin: 0 1.4rem;
  font-weight: 400;
  font-size: 1em;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ Statement ============ */
.statement {
  padding: clamp(5rem, 14vh, 10rem) var(--pad);
  max-width: 1200px;
}
.statement-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.9rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  margin-bottom: 2.5rem;
}
.statement-text .w {
  opacity: 0.18;
  transition: opacity 0.4s linear;
}
.statement-text .w.on { opacity: 1; }
.statement-sub {
  max-width: 58ch;
  color: var(--stone);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

/* ============ Numbers (production-sheet facts) ============ */
.numbers { padding: 0 var(--pad) clamp(4rem, 10vh, 8rem); }
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.number-card {
  background: var(--paper-2);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.3s;
}
.number-card:hover { background: var(--paper-3); }
.number-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 4.6vw, 4.4rem);
  line-height: 0.92;
  color: var(--amber);
}
.number-label { color: var(--stone); line-height: 1.6; letter-spacing: 0.14em; }

/* ============ Sections shared ============ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--pad);
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.section-title em { font-size: 0.96em; }
.section-count { color: var(--stone); }

/* ============ Impact stack cards ============ */
.impact { padding: clamp(4rem, 12vh, 9rem) 0; }
.stack { padding: 0 var(--pad); }
.card {
  position: sticky;
  top: 5.5rem;
  margin-bottom: 1.25rem;
}
.card-inner {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  min-height: min(72vh, 620px);
  display: flex;
  flex-direction: column;
  transition: border-color 0.35s;
}
.card:hover .card-inner { border-color: var(--line-amber); }
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--stone);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
}
.card-index { color: var(--amber); }
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
}
.card-title em { font-size: 0.96em; }
.card-body {
  margin-top: auto;
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
}
.card-body p { color: var(--ink-soft); max-width: 58ch; font-size: clamp(0.95rem, 1.15vw, 1.05rem); }
.card-stats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.card-stats li {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
}
.card-stats strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.1vw, 1.9rem);
  min-width: 4.5ch;
  color: var(--ink);
}
.card-stats span { color: var(--stone); font-size: 0.9rem; }
.card-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-tags span {
  color: var(--amber);
  border: 1px solid var(--line-amber);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
}

@media (max-width: 860px) {
  .card { position: static; }
  .card-inner { min-height: 0; }
  .card-body { grid-template-columns: 1fr; align-items: start; }
}

/* ============ Record ============ */
.record {
  padding: clamp(4rem, 12vh, 9rem) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.record-list { border-top: 1px solid var(--line); margin: 0 var(--pad); }
.record-row {
  display: grid;
  grid-template-columns: 110px 1.3fr 1fr 1.2fr;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, padding-left 0.3s var(--ease-out);
  position: relative;
}
.record-row:hover {
  background: var(--paper-3);
  padding-left: 1.25rem;
}
.record-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--amber);
  transform: scaleY(0);
  transition: transform 0.3s var(--ease-out);
}
.record-row:hover::before { transform: scaleY(1); }
.record-dates { color: var(--amber); }
.record-role {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.record-org { color: var(--ink-soft); font-size: 0.92rem; }
.record-note { color: var(--stone); font-size: 0.9rem; }
@media (max-width: 860px) {
  .record-row { grid-template-columns: 90px 1fr; }
  .record-org { grid-column: 2; color: var(--stone); }
  .record-note { display: none; }
}

/* ============ Credentials ============ */
.credentials { padding: clamp(4rem, 12vh, 9rem) 0; }
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 var(--pad) 3rem;
}
.cred-card {
  background: var(--paper-2);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: background 0.3s;
}
.cred-card:hover { background: var(--paper-3); }
.cred-badge {
  align-self: flex-start;
  color: var(--amber);
  border: 1px solid var(--line-amber);
  border-radius: 9999px;
  padding: 0.3rem 0.8rem;
}
.cred-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.cred-card p { color: var(--stone); font-size: 0.9rem; }
.domains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: 0 var(--pad);
}
.domain { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.domain-label { color: var(--amber); display: block; margin-bottom: 0.8rem; }
.domain p { color: var(--stone); font-size: 0.95rem; line-height: 1.7; }

/* ============ Contact ============ */
.contact {
  padding: clamp(6rem, 18vh, 12rem) var(--pad);
  text-align: center;
  position: relative;
  background:
    radial-gradient(900px 460px at 50% 100%, rgba(196, 18, 48, 0.12), transparent 65%),
    var(--paper);
}
.contact-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9.5vw, 8.2rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.contact-title em { font-size: 0.96em; }
.contact-sub {
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 3rem;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
}
/* Red Means Act: primary conversion pill */
.btn-magnetic {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background: var(--red);
  color: var(--ink);
  border-radius: 9999px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.35s var(--ease-out);
  will-change: transform;
  box-shadow: 0 18px 40px -12px rgba(196, 18, 48, 0.55);
}
.btn-fill {
  position: absolute;
  inset: 0;
  background: var(--amber);
  border-radius: 9999px;
  transform: translateY(101%);
  transition: transform 0.4s var(--ease-out);
}
.btn-magnetic:hover { color: var(--paper); }
.btn-magnetic:hover .btn-fill { transform: translateY(0); }
.btn-magnetic:focus-visible { outline-color: var(--ink); }
.btn-label { position: relative; z-index: 1; }
.btn-ghost {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  padding: 13px 26px;
  transition: border-color 0.3s, background 0.3s;
}
.btn-ghost:hover { border-color: var(--amber); background: rgba(193, 127, 58, 0.1); }

/* ============ Footer ============ */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem var(--pad) 2rem;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  color: var(--stone);
}
.footer-note sup { color: var(--amber); }

/* ============ Reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .hero-line-inner { opacity: 1; transform: none; }
  .statement-text .w { opacity: 1; }
  .marquee-track { animation: none; }
}
