/* ============================================================
   case.css — Case-study layout for project pages
   Warm-monochrome · Fraunces editorial · designer-grade
   ============================================================ */

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 70% -5%, var(--glow), transparent 60%),
    radial-gradient(800px 500px at 5% 10%, var(--glow), transparent 55%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: 0.5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }
@media (max-width: 640px) { .wrap { padding: 0 1.25rem; } }

/* ───── TOP NAV ───── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 2rem;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 1.7rem; height: 1.7rem; border: 1px solid var(--line-2); border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.6rem; color: var(--fg);
}
.brand-name { font-size: 0.85rem; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 2.1rem; padding: 0 0.9rem; border-radius: 100px;
  border: 1px solid var(--line-2); color: var(--fg-mid);
  font-size: 0.78rem; transition: all 0.2s;
}
.pill:hover { color: var(--fg); border-color: var(--fg-soft); background: var(--hover); }
.pill-solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.pill-solid:hover { background: var(--fg); color: var(--on-accent); }
.pill-icon { width: 2.1rem; padding: 0; justify-content: center; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.1s linear; }

/* ───── HERO ───── */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) 3rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--fg-mid); text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: 100px; padding: 0.4rem 0.9rem;
  margin-bottom: 2rem;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: ping 2.4s ease-in-out infinite; }
@keyframes ping { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent);} 50% { box-shadow: 0 0 0 6px transparent;} }

.hero-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 9.5rem); line-height: 0.9; letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}
.hero-title .accent {
  font-style: normal; font-family: var(--sans); font-weight: 600; letter-spacing: -0.03em;
  color: var(--accent);
}
.hero-lede {
  max-width: 60ch; font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 300;
  color: var(--fg-mid); line-height: 1.55; margin-bottom: 3rem;
}
.hero-lede strong { color: var(--fg); font-weight: 500; }

.meta-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  padding: 1.75rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.meta-k { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-soft); margin-bottom: 0.5rem; }
.meta-v { font-size: 0.92rem; color: var(--fg); }
@media (max-width: 720px) { .meta-row { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; } }

.hero-visual {
  margin-top: 3rem; position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-2); background: var(--bg-2);
  width: fit-content; max-width: 100%;
}
.hero-visual.tall { }
.hero-visual img { display: block; width: auto; max-width: 100%; max-height: min(70vh, 640px); height: auto; }

.hero-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0.85rem 1rem; border-top: 1px solid var(--line); background: var(--bg-card); }
.htag { font-family: var(--mono); font-size: 0.72rem; padding: 0.3rem 0.75rem; border-radius: 100px; border: 1px solid var(--line-2); color: var(--fg-mid); }

/* ───── CASE LAYOUT (sticky TOC) ───── */
.case { padding: 5.5rem 0; }
.case-grid { display: grid; grid-template-columns: 200px 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
@media (max-width: 920px) { .case-grid { grid-template-columns: 1fr; gap: 0; } }

.toc { position: sticky; top: 90px; align-self: start; }
@media (max-width: 920px) { .toc { display: none; } }
.toc-title { font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-soft); margin-bottom: 1.25rem; }
.toc a {
  display: flex; align-items: baseline; gap: 0.7rem; padding: 0.5rem 0 0.5rem 0.9rem; margin-left: -0.9rem;
  font-size: 0.85rem; color: var(--fg-soft); transition: color 0.2s; border-left: 1px solid transparent;
}
.toc a .n { font-family: var(--mono); font-size: 0.65rem; color: var(--fg-faint); }
.toc a:hover { color: var(--fg-mid); }
.toc a.active { color: var(--fg); border-left-color: var(--accent); }
.toc a.active .n { color: var(--accent); }

.case-body { min-width: 0; }
.chapter { padding-bottom: 5.5rem; margin-bottom: 5.5rem; border-bottom: 1px solid var(--line); }
.chapter:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.chapter-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2rem; }
.chapter-n { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.chapter-t { font-family: var(--serif);  font-weight: 650; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.05; letter-spacing: -0.02em; }
.lede { font-size: 1.2rem; line-height: 1.8; color: var(--fg); margin-bottom: 1.25rem; }
.lede, .chapter p, .chapter ul { max-width: 68ch; }
.chapter p { color: var(--fg-mid); margin-bottom: 1.1rem; line-height: 1.85; }
.chapter p:last-child { margin-bottom: 0; }
.chapter p strong { color: var(--fg); font-weight: 500; }


/* two info cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem; }
@media (max-width: 620px) { .duo { grid-template-columns: 1fr; } }
.info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; transition: border-color 0.3s, transform 0.3s; }
.info:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.info h4 { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.8rem; }
.info p { font-size: 0.92rem; margin: 0; color: var(--fg-mid); }
.info p strong { color: var(--fg); }


/* process timeline */
.flow { margin-top: 2.5rem; display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; position: relative; padding-bottom: 1.75rem; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 23px; top: 48px; bottom: 0; width: 1px; background: var(--line-2); }
.step-ico { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-size: 1rem; }
.step-body { padding-top: 0.35rem; }
.step-k { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-soft); margin-bottom: 0.2rem; }
.step-t { font-size: 1rem; font-weight: 500; color: var(--fg); }

/* bento features */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
.feat { grid-column: span 2; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; transition: border-color 0.3s, transform 0.3s, background 0.3s; }
.feat:hover { border-color: var(--accent-line); transform: translateY(-4px); background: var(--card-2); }
.feat.big { grid-column: span 3; }
@media (max-width: 860px) { .bento { grid-template-columns: repeat(2, 1fr); } .feat, .feat.big { grid-column: span 1; } }
@media (max-width: 480px) { .bento { grid-template-columns: 1fr; } .feat, .feat.big { grid-column: span 1; } }
.feat-ico { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-size: 1rem; margin-bottom: 1.1rem; }
.feat h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feat p { font-size: 0.88rem; color: var(--fg-mid); line-height: 1.65; margin: 0; }
.feat ul { list-style: none; margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.feat ul li { position: relative; padding-left: 1.1rem; font-size: 0.84rem; color: var(--fg-mid); line-height: 1.5; }
.feat ul li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* tech grid */
.stack { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 2.5rem; }
@media (max-width: 620px) { .stack { grid-template-columns: 1fr; gap: 1.75rem; } }
.stack h4 { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-soft); margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font-family: var(--mono); font-size: 0.78rem; padding: 0.4rem 0.85rem; border-radius: 100px; border: 1px solid var(--line-2); color: var(--fg-mid); transition: all 0.2s; }
.chip:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-2px); }
.chip-strong { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* numbered impl list */
.steps-num { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1rem; counter-reset: s; }
.snum { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; padding: 1.4rem 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); align-items: start; transition: border-color 0.3s; }
.snum:hover { border-color: var(--accent-line); }
.snum::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 0.85rem; color: var(--accent); padding-top: 2px; }
.snum p { font-size: 0.95rem; color: var(--fg-mid); margin: 0; line-height: 1.7; }
.snum strong { color: var(--fg); font-weight: 500; }

/* gallery */
.gallery { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 3rem; }
.shot-cap { display: flex; align-items: center; gap: 0.8rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--fg-soft); margin-bottom: 0.9rem; }
.shot-cap::before { content: ""; width: 22px; height: 1px; background: var(--fg-soft); }
.shot-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); }
.shot-frame { width: fit-content; max-width: 100%; }
.shot-frame img { display: block; width: auto; max-width: 100%; height: auto; }

/* learnings */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
@media (max-width: 760px) { .cards3 { grid-template-columns: 1fr; } }
.lc { padding: 1.6rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--accent); transition: transform 0.3s, border-color 0.3s; }
.lc:hover { transform: translateY(-4px); }
.lc h3 { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.5rem; }
.lc p { font-size: 0.88rem; color: var(--fg-mid); line-height: 1.65; margin: 0; }


/* next CTA */
.next { border-top: 1px solid var(--line); padding: 4.5rem 0 5.5rem; }
.next-k { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-soft); margin-bottom: 1rem; }
.next-link { display: inline-flex; align-items: center; gap: 1rem; font-family: var(--serif);  font-weight: 650; font-size: clamp(2rem, 6vw, 3.6rem); letter-spacing: -0.02em; color: var(--fg); transition: gap 0.3s, color 0.3s; }
.next-link:hover { color: var(--accent); gap: 1.6rem; }
.next-link i { font-size: 0.5em; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 2.25rem 0; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot-copy { font-family: var(--mono); font-size: 0.72rem; color: var(--fg-soft); }
.foot-links { display: flex; gap: 1rem; }
.foot-links a { color: var(--fg-soft); font-size: 1rem; transition: color 0.2s, transform 0.2s; }
.foot-links a:hover { color: var(--accent); transform: translateY(-2px); }

/* reveal */
.reveal-on [data-rv] { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1); }
.reveal-on [data-rv].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-on [data-rv] { opacity: 1; transform: none; } .eyebrow .dot { animation: none; } }
