/* ===== Case-study page (/work/<slug>) ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #e8503a;
  --bg: #0d0d0d;
  --line: #222;
  --muted: #8a8a8a;
}

body {
  background: var(--bg);
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  opacity: 0;
  animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 40px; }

/* title voice */
.display { font-family: 'Inter', sans-serif; }
/* small uppercase label voice */
.label { font-family: 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 1px; }

/* top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.back { color: var(--muted); text-decoration: none; font-size: 13px; transition: color 0.2s ease; }
.back:hover { color: #fff; }
.topbar .links { display: flex; gap: 18px; }
.topbar .links a {
  color: var(--muted); text-decoration: none; font-size: 12px;
  font-weight: 500; letter-spacing: 0.5px; transition: color 0.2s ease;
}
.topbar .links a:hover { color: var(--accent); }

/* hero (compact, text-only) */
.hero { padding: 36px 0 24px; border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: 10.5px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.hero h1 {
  font-family: 'Inter', sans-serif; font-size: 42px; font-weight: 700;
  line-height: 1.02; letter-spacing: -1.5px;
}
.hero .sub {
  font-family: 'Inter', sans-serif; font-weight: 400;
  font-size: 16.5px; color: #c9c9c9; margin-top: 10px; max-width: 620px; line-height: 1.45;
}

/* skill badges: what this project demonstrates — same visual language as
   the profile badges at the top of the homepage (white outline pills) */
.hero .skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero .skills .sk {
  font-size: 12px; font-weight: 500;
  color: #ffffff; background: transparent;
  border: 1px solid #ffffff;
  padding: 5px 12px; border-radius: 20px;
}
.meta { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.meta div { font-size: 12.5px; }
.meta .k {
  font-size: 9.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
}
.meta .status-dot { color: var(--accent); }
.meta .status-link { color: var(--accent); text-decoration: none; transition: opacity 0.2s ease; }
.meta .status-link:hover { text-decoration: underline; opacity: 0.85; }

/* deck section — opens up as you scroll: composed near the top, progressively
   wider and more image-dominant the deeper you go. --p (0→1 scroll progress) is
   set by a small inline script in the page template; the copy rail stays a fixed
   264px so only the image column grows, and widths are capped inside the viewport. */
.decks { width: 100%; }
.deck {
  display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 48px;
  border-bottom: 1px solid var(--line);
  max-width: min(calc(100vw - 80px), calc(1100px + 560px * var(--p, 0)));
  margin: 0 auto; padding: 80px 40px;
}
.col-desc .sticky { position: sticky; top: 40px; }
.col-desc .num { font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: 1px; }
.col-desc h2 {
  font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 600;
  line-height: 1.12; letter-spacing: -0.5px; margin: 10px 0 16px;
}
.col-desc p { font-size: 14px; color: #b5b5b5; line-height: 1.65; }
.col-desc p + p { margin-top: 0.9em; }

/* shots — each row centers within the image column itself (the area right
   of the description rail), not relative to the page */
.col-shots {
  display: flex; flex-direction: column; gap: 22px;
}
.shot { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0f0f0f; }
/* single desktop shots: at full zoom, cap a touch below the column width
   (centered in the column) so they don't feel oversized */
.col-shots > .shot { width: 100%; max-width: 940px; margin-left: auto; margin-right: auto; }
.shot .bar { height: 30px; background: #1b1b1b; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.shot .bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a3a3a; display: inline-block; }

/* windowed screenshot: full image at its natural aspect ratio — never
   cropped. It grows on scroll because the column itself widens with --p. */
.shot.win img {
  display: block; width: 100%; height: auto;
}
/* designed graphic (square ad / poster): show in full, centered */
.shot.graphic { border: none; background: transparent; border-radius: 0; overflow: visible; }
.shot.graphic img { display: block; width: 100%; max-width: 540px; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; }

.caption { font-size: 10px; font-weight: 500; letter-spacing: 0.5px; color: #555; margin-top: -12px; text-align: center; }

.pair { display: flex; gap: 22px; }
.pair .shot { flex: 1; min-width: 0; }

/* ad / marketing creatives: framed as dark-mode Instagram posts */
.adrow { display: flex; gap: 16px; }
.adrow .ig {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #0f0f0f;
}
.ig-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; }
.ig-av {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ig-user { font-size: 12px; font-weight: 600; color: #fff; }
.ig-more { margin-left: auto; color: #aaa; font-size: 12px; letter-spacing: 1px; }
.ig img { display: block; width: 100%; height: auto; }
.ig-actions { display: flex; align-items: center; gap: 14px; padding: 10px 12px 0; }
.ig-actions svg {
  width: 20px; height: 20px; fill: none; stroke: #e8e8e8;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ig-actions svg:last-child { margin-left: auto; } /* bookmark sits right */
.ig-likes { font-size: 11.5px; font-weight: 600; color: #fff; padding: 8px 12px 0; }
.ig-cap { font-size: 11.5px; color: #cfcfcf; padding: 3px 12px 12px; }
.ig-cap b { color: #fff; font-weight: 600; }

/* mixed row: one desktop shot + one phone mock sitting side by side at a
   shared height (never stacked on larger screens). Height-driven sizing so
   both keep their natural aspect ratios uncropped; grows with --p. */
.duo {
  --dh: calc(300px + 150px * var(--p, 0)); /* shared row height */
  display: flex; gap: 22px; justify-content: center; align-items: flex-start;
}
.duo .duo-desk { min-width: 0; }
.duo .shot.win img { width: auto; height: calc(var(--dh) - 30px); } /* minus chrome bar */
.duo .phone { flex: 0 0 auto; width: auto; }
.duo .phone .frame { height: var(--dh); width: auto; }

/* phone frames (tall mobile shots) — centered in the column so they sit in the
   middle of the viewport like the desktop shots. nowrap + shrink keeps a row of
   phones on one line (shrinking to fit) instead of orphaning a wrapped one. */
.phones { display: flex; gap: 22px; flex-wrap: nowrap; justify-content: center; }
.phone {
  flex: 0 1 auto; min-width: 0; max-width: 100%;
  width: min(calc(232px + 104px * var(--p, 0)), calc(82vh * 9 / 19.5));
}
.phone .frame { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #0f0f0f; aspect-ratio: 9 / 19.5; }
.phone .frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.plabel { font-size: 10px; font-weight: 500; color: #666; margin-top: 8px; text-align: center; }

/* spec sheet (under-the-hood, no screenshot) */
.spec { border: 1px solid var(--line); border-radius: 10px; padding: 26px 28px; background: linear-gradient(150deg, #141414, #0e0e0e); }
.spec ul { list-style: none; }
.spec li {
  font-size: 13.5px; color: #cfcfcf;
  padding: 11px 0; border-bottom: 1px solid #1c1c1c; display: flex; align-items: center; gap: 12px;
}
.spec li:last-child { border-bottom: none; }
.spec li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* placeholder slot (screenshot pending) */
.ph-slot {
  position: relative; aspect-ratio: 16 / 9; border: 1px dashed #2c2c2c; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(150deg, #161616, #0e0e0e); overflow: hidden;
}
.ph-slot .glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%); }
.ph-slot .pl-title { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 18px; color: #6f6f6f; z-index: 1; }
.ph-slot .pl-note { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #4a4a4a; z-index: 1; }

/* floating back-to-top: plain white text, fades in once you're down among
   the rows */
.to-top {
  position: fixed; top: 24px; right: 28px; z-index: 50;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 0.4px;
  color: #ffffff; background: none; border: none; padding: 4px 2px;
  cursor: pointer; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { color: var(--accent); }

/* footer */
.foot { padding: 70px 0 90px; text-align: center; }
.foot .next { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.foot .nextname { font-family: 'Inter', sans-serif; font-size: 34px; font-weight: 600; letter-spacing: -1px; margin-top: 8px; }
.foot .nextname a { color: #fff; text-decoration: none; transition: color 0.2s ease; }
.foot .nextname a:hover { color: var(--accent); }

/* responsive */
@media (max-width: 820px) {
  .wrap { padding: 0 24px; }
  .deck { grid-template-columns: 1fr; gap: 24px; padding: 56px 24px; max-width: 100%; }
  .col-desc .sticky { position: static; }
  .hero h1 { font-size: 34px; letter-spacing: -1px; }
  .hero .sub { font-size: 16px; }
  .meta { gap: 24px; }
  .pair { flex-direction: column; }
  .adrow { flex-direction: column; gap: 16px; } /* IG posts stack on small screens */
  .phones { flex-wrap: wrap; }
  .phone { width: 46%; }
  /* duo stacks on small screens, back to natural width-driven sizing */
  .duo { flex-direction: column; align-items: center; }
  .duo .duo-desk { width: 100%; }
  .duo .shot.win img { width: 100%; height: auto; }
  .duo .phone { width: 46%; }
  .duo .phone .frame { height: auto; width: 100%; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .phone { width: 100%; }
}

/* Guided/quantized scrolling is handled in JS (see the page template): CSS
   scroll-snap only re-aligns after a native scroll settles, which feels like
   "wait, then snap." The script instead glides to the next stop per gesture. */
