/* ============================================================
   ZABEZ, GRC PORTFOLIO
   Design system: Tellet-inspired / bold editorial color blocks
   Epilogue (geometric sans) display + IBM Plex Sans body
   Palette: deep green #096846, warm gold #D99A3D, cream #FFF7F9
   ============================================================ */

:root {
  /* surfaces */
  --green: #096846;        /* primary brand */
  --green-dark: #064A31;   /* text on light */
  --green-deep: #043E29;   /* footer / deepest */
  --gold: #D99A3D;          /* accent CTA - warm gold */
  --gold-dark: #B87E2A;     /* gold hover */
  --cream: #FFF7F9;        /* base light section */
  --cream-2: #FDEFF3;      /* lighter alt */
  --white: #FFFFFF;
  --ink: #064A31;
  --text: #0D3B2A;
  --text-dim: #4A6B5C;
  --text-faint: #7C988C;
  --line: #E8D5DB;
  --line-soft: #F3E4E9;

  /* accents */
  --panel: var(--white);
  --panel-2: var(--cream-2);
  --ink-2: var(--cream-2);
  --accent: var(--gold);
  --accent-soft: #E8B45C;
  --gold-soft: #E8B45C;
  --red: #C0552E;

  /* type */
  --display: "Epilogue", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  /* rhythm */
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 18px;
  --pill: 999px;

  /* shadows */
  --shadow-sm: 0 2px 6px rgba(6, 74, 49, 0.06);
  --shadow-md: 0 10px 30px rgba(6, 74, 49, 0.10);
  --shadow-lg: 0 24px 60px rgba(6, 74, 49, 0.16);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold); color: #fff; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--gold); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- full-bleed color sections ---------- */

section.sec-green { background: var(--green); color: #F4FBF8; }
section.sec-green .sec-num { color: var(--gold); }
section.sec-green h1, section.sec-green h2 { color: #FFFFFF; }
section.sec-green .lede { color: #C9E4D8; }
section.sec-green .sec-head p { color: #C9E4D8; }
/* card content inside green sections keeps dark text (cards are white) */
section.sec-green .cap-card h3 { color: var(--green-dark); }
section.sec-green .cap-card p { color: var(--text-dim); }

section.sec-gold { background: var(--gold); color: #4A2E08; }
section.sec-gold .sec-num { color: #4A2E08; }
section.sec-gold h2 { color: #2B1B05; }
section.sec-gold p { color: #5C3A10; }
section.sec-gold .sec-head p { color: #5C3A10; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 247, 249, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--green-dark);
  white-space: nowrap;
  font-weight: 700;
}
.brand .dot { color: var(--gold); }

.nav {
  display: flex;
  gap: 4px;
  font-size: 15px;
  align-items: center;
}
.nav a {
  color: var(--text-dim);
  letter-spacing: 0.01em;
  padding: 8px 14px;
  border-radius: var(--pill);
  transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.nav a:hover {
  color: var(--green-dark);
  background: var(--cream-2);
}
.nav a .ico { width: 14px; height: 14px; opacity: 0.7; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(70px, 11vh, 120px) 0 70px;
  background: var(--green);
  color: #F4FBF8;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--green-deep) 1px, transparent 1px),
                    linear-gradient(90deg, var(--green-deep) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.25;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 60% 20%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 60% 20%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-inner { position: relative; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin-bottom: 28px;
  color: #fff;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero .lede {
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  color: #C9E4D8;
  max-width: 56ch;
  margin-bottom: 36px;
  line-height: 1.6;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 15px 30px;
  border-radius: var(--pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn .ico { width: 16px; height: 16px; }

.btn-primary {
  background: var(--gold);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--gold-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.btn-ghost:hover { border-color: var(--gold); color: #fff; background: rgba(217, 154, 61, 0.15); }

.hero-meta {
  margin-top: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--mono);
  font-size: 13px;
  color: #8FB8A8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero-meta span b { color: #C9E4D8; font-weight: 500; }

/* ---------- sections ---------- */

section { padding: clamp(64px, 9vh, 100px) 0; }
section.alt { background: var(--white); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.sec-head { margin-bottom: 44px; }

.sec-num {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 10px;
}

.sec-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.sec-head p {
  color: var(--text-dim);
  max-width: 62ch;
  font-size: 17px;
}

/* ---------- case study index (list) ---------- */

.case-list { border-top: 1px solid var(--line); }

.case-row {
  display: grid;
  grid-template-columns: 64px 1.6fr 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 28px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease, padding-left 0.15s ease, box-shadow 0.15s ease;
  color: var(--text);
  border-radius: var(--radius);
}
.case-row:hover {
  background: var(--white);
  padding-left: 22px;
  box-shadow: var(--shadow-sm);
}

.case-num { font-family: var(--mono); font-size: 13px; color: var(--text-faint); }

.case-name {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--green-dark);
}
.case-name .ico { width: 30px; height: 30px; color: var(--gold); flex-shrink: 0; }

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tag {
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: var(--pill);
  color: var(--text-dim);
  white-space: nowrap;
  background: var(--white);
  font-size: 12px;
}

.case-score {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}
.case-score b { font-size: 21px; color: var(--green); font-weight: 700; }

.case-row .arrow {
  font-family: var(--mono);
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.case-row:hover .arrow { opacity: 1; transform: translateX(3px); }

/* ---------- capabilities ---------- */

.caps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.cap-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.cap-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.cap-card .cap-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--cream-2);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.cap-card .cap-ico svg { width: 24px; height: 24px; }

.cap-card h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.cap-card p { font-size: 16.5px; color: var(--text-dim); line-height: 1.6; }

/* ---------- methodology ---------- */

.method {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.method-step {
  border-left: 2px solid var(--line);
  padding: 4px 0 4px 20px;
  transition: border-left-color 0.15s ease;
}
.method-step:hover { border-left-color: var(--gold); }

.method-step .step-no {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.method-step h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 6px 0 8px;
  color: var(--green-dark);
}

.method-step p { font-size: 16px; color: var(--text-dim); line-height: 1.65; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-grid h2 { margin-bottom: 18px; }

.about-body p { margin-bottom: 16px; color: var(--text-dim); font-size: 16.5px; }
.about-body p strong { color: var(--text); font-weight: 600; }

.creds {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.creds h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.creds ul { list-style: none; }

.creds li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.creds li:last-child { border-bottom: 0; }

.creds li .k { font-family: var(--mono); font-size: 11px; color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; min-width: 92px; }
.creds li .v { color: var(--text); }

/* ---------- contact ---------- */

.contact-strip {
  text-align: center;
  max-width: 660px;
  margin: 0 auto;
}

.contact-strip h2 { margin-bottom: 14px; }
.contact-strip p { color: #5C3A10; margin-bottom: 30px; font-size: 17px; }

.email-line {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  border-bottom: 3px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 4px;
}
.email-line:hover { border-bottom-color: #fff; color: #fff; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0 60px;
  background: var(--cream);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--text-faint);
}

.foot-inner .legal { max-width: 560px; line-height: 1.6; font-size: 12px; }

/* ============================================================
   CASE STUDY PAGE
   ============================================================ */

.case-hero {
  padding: clamp(56px, 9vh, 90px) 0 40px;
  border-bottom: 1px solid var(--line-soft);
}

.crumb {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 26px;
}
.crumb a { color: var(--text-faint); }
.crumb a:hover { color: var(--gold); }

.case-hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--green-dark);
}

.case-hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 28px;
}

.score-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
}

.score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
}
.score-badge .big { font-size: 30px; color: var(--green); font-weight: 700; }
.score-badge .lbl { color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  padding-top: clamp(40px, 6vh, 60px);
}

.case-main { min-width: 0; }

.case-main > h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
  margin: 46px 0 14px;
  padding-top: 10px;
  color: var(--green-dark);
}
.case-main > h2:first-child { margin-top: 0; }

.case-main p { margin-bottom: 18px; color: var(--text-dim); font-size: 16.5px; line-height: 1.75; }
.case-main p strong { color: var(--text); font-weight: 600; }

.case-main ul, .case-main ol { margin: 0 0 16px 22px; color: var(--text-dim); }
.case-main li { margin-bottom: 9px; font-size: 16.5px; }
.case-main li strong { color: var(--text); }

.finding {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 18px;
  margin-bottom: 14px;
}
.finding.watch { border-left-color: var(--red); }

.finding h4 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin-bottom: 4px; color: var(--text); }

/* framework table */

.fw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  margin: 8px 0 20px;
}

.fw-table th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.fw-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--text-dim);
  font-size: 15.5px;
}

.fw-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.fw-table td:nth-child(2) { color: var(--gold); font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* maturity bars */

.maturity { margin: 10px 0 24px; }

.m-bar { margin-bottom: 14px; }

.m-bar .m-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.m-bar .m-top .lbl { color: var(--text-dim); }
.m-bar .m-top .val { color: var(--green); font-weight: 600; }

.m-track {
  height: 10px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
}
.m-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 999px;
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* side rail */

.case-rail {
  font-size: 14px;
}

.rail-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.rail-box h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.rail-box ul { list-style: none; }

.rail-box li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
  color: var(--text-dim);
}
.rail-box li:last-child { border-bottom: 0; }
.rail-box li b { color: var(--text); font-weight: 600; }

.rail-box .scope-note { font-size: 13px; color: var(--text-faint); line-height: 1.6; }
.rail-box .scope-note code { font-family: var(--mono); color: var(--green); }

/* next case */

.next-case {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.next-case .nc-lbl { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); }
.next-case .nc-name { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--green-dark); }
.next-case a:hover .nc-name { color: var(--gold); }

/* ============================================================
   ANIMATION UTILITIES
   ============================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.floaty { animation: floaty 5s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.pulse-dot { animation: pulse-dot 2.2s ease-in-out infinite; }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 30s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }

/* ---------- idle / ambient animations ---------- */

/* gentle upward float for decorative hero elements */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.float-y { animation: float-y 5s ease-in-out infinite; }
.float-y-d1 { animation-delay: 1.2s; }
.float-y-d2 { animation-delay: 2.4s; }

/* slow drift for background blobs */
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.06); }
  66% { transform: translate(-16px, 14px) scale(0.97); }
}
.drift { animation: drift 14s ease-in-out infinite; }

/* pulsing dot (live indicator) */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(217, 154, 61, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(217, 154, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 154, 61, 0); }
}
.pulse-ring { animation: pulse-ring 2.4s ease-out infinite; }

/* shimmer sweep across primary buttons */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 3.2s linear infinite;
  pointer-events: none;
}

/* slow gradient drift on hero */
@keyframes gradient-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero {
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(217, 154, 61, 0.16), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(90, 200, 160, 0.14), transparent 55%),
    var(--green);
  background-size: 160% 160%;
  animation: gradient-drift 18s ease-in-out infinite;
}

/* scroll-triggered horizontal slide for cards (never causes overflow) */
.js .reveal-x {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.js .reveal-x.in { opacity: 1; transform: none; }
@media (max-width: 620px) {
  .js .reveal-x { transform: none; }
}

/* hover lift with springy ease */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

/* hero decorative badges: desktop only */
@media (min-width: 1100px) {
  .hero-badges { display: block !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .ticker-section { overflow: hidden; }
  .case-body { grid-template-columns: 1fr; }
  .case-rail { order: -1; }
  .case-row { grid-template-columns: 40px 1fr auto; }
  .case-tags { grid-column: 2 / -1; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 16px; padding: 12px var(--gutter); }
  .nav { gap: 2px; font-size: 13px; flex-wrap: wrap; }
  .nav a { padding: 6px 10px; }
  .case-row { grid-template-columns: 1fr auto; }
  .case-num { display: none; }
  .case-name .ico { width: 22px; height: 22px; }
  .fw-table { font-size: 13.5px; }
  .fw-table th, .fw-table td { padding: 9px 8px; }
  .fw-table td:first-child,
  .fw-table td:nth-child(2) { white-space: normal; word-break: normal; }
  .case-score { font-size: 12px; }
  .case-score b { font-size: 18px; }
}

@media (max-width: 400px) {
  .nav a:nth-child(2), .nav a:nth-child(3) { display: none; }
}

/* ---------- editorial extras ---------- */

/* scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  z-index: 300;
  width: 0%;
  transition: width 0.1s linear;
}

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

/* magnetic buttons (hover follows cursor slightly) */
.magnetic { transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }

/* underline sweep on nav links */
.nav a { position: relative; }
.nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav a:hover::after { transform: scaleX(1); }

/* counter chips on case scores */
.case-row .case-score { position: relative; }

/* big wordmark animation on hero */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise-in { animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .m-fill { width: 100%; }
}
