/* =========================================================
   App Store–style project page. White, apple.com proportions.
   Shared by every page under /projects/<slug>/.
   ========================================================= */

:root {
  color-scheme: light;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --band: #f5f5f7;
  --card: #ffffff;
  --hair: #d2d2d7;
  --hair-soft: #e8e8ed;
  --blue: #0071e3;
  --link: #0066cc;
  --fill: rgba(0, 0, 0, 0.05);
  --accent: #0071e3;
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #fff; color: var(--text); overflow-x: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; letter-spacing: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
code { font: 0.88em ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; letter-spacing: 0; background: var(--band); padding: 2px 6px; border-radius: 6px; }
.sym { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.rail { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav { border-bottom: 1px solid rgba(0,0,0,0.08); }
.nav .rail { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-brand { font-weight: 600; font-size: 1.0625rem; color: var(--text); letter-spacing: -0.02em; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; font-size: 0.8125rem; letter-spacing: -0.01em; }
.nav-links a { color: var(--text); opacity: 0.85; }
.nav-links a:hover { opacity: 1; text-decoration: none; color: var(--link); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px; border-radius: 980px;
  font-size: 1.0625rem; font-weight: 400; letter-spacing: -0.022em;
  transition: background-color 150ms ease, transform 300ms var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); transition-duration: 80ms; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0077ed; }
.btn-outline { color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.btn-outline:hover { background: rgba(0, 113, 227, 0.06); }
.btn-small { min-height: 30px; padding: 0 14px; font-size: 0.875rem; }
.btn-get { min-height: 30px; padding: 0 18px; font-size: 0.9375rem; font-weight: 700; letter-spacing: 0; color: var(--blue); background: var(--fill); border-radius: 980px; display: inline-flex; align-items: center; }
.btn-get:hover { text-decoration: none; background: rgba(0,0,0,0.08); }
.more { font-size: 1.0625rem; }
.more::after { content: " ›"; }

/* ---------- App icon ---------- */
.icon {
  --s: 160px; width: var(--s); height: var(--s); flex: none;
  border-radius: calc(var(--s) * 0.2237);
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0,0,0,0.04);
}
.icon svg { width: 60%; height: 60%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Product header ---------- */
.app-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; padding-block: clamp(40px, 7vw, 80px) clamp(28px, 4vw, 40px); }
@media (max-width: 640px) { .app-head { grid-template-columns: 1fr; } .app-head .icon { --s: 120px; } }
.app-name { font-size: clamp(2.25rem, 5vw, 3rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.app-sub { font-size: clamp(1.1875rem, 2.2vw, 1.5rem); line-height: 1.25; color: var(--text-2); margin: 6px 0 0; letter-spacing: -0.015em; }
.app-dev { margin: 10px 0 0; font-size: 1.0625rem; }
.app-platform { margin: 4px 0 0; display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 0.875rem; letter-spacing: -0.01em; }
.app-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Info strip ---------- */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--hair-soft); padding-block: 14px; margin: 0; }
.strip > div { text-align: center; padding: 4px 10px; position: relative; min-width: 0; }
.strip > div + div::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: var(--hair-soft); }
.strip dt { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.strip dd { margin: 0; }
.strip .v { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-2); margin-top: 4px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.strip .u { font-size: 0.8125rem; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 150px; overflow-x: auto; scrollbar-width: none; }
  .strip::-webkit-scrollbar { display: none; }
}

/* ---------- Sections / bands ---------- */
.block { padding-block: clamp(48px, 8vw, 96px); }
.block.tight { padding-block: clamp(36px, 5vw, 56px); }
.band { background: var(--band); }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: clamp(24px, 4vw, 40px); flex-wrap: wrap; }
.eyebrow { font-size: clamp(1.1875rem, 2vw, 1.5rem); font-weight: 600; color: var(--text-3); letter-spacing: -0.015em; margin: 0 0 4px; }
.headline { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.h-small { font-size: 1.5rem; line-height: 1.17; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.lede { font-size: clamp(1.125rem, 1.8vw, 1.3125rem); line-height: 1.43; letter-spacing: -0.016em; color: var(--text); max-width: 44em; margin: 16px 0 0; }
.lede.muted { color: var(--text-2); }
.prose { font-size: 1.0625rem; line-height: 1.53; max-width: 46em; }
.prose p { margin: 0 0 1em; }

/* ---------- Description w/ more ---------- */
.desc { position: relative; max-width: 46em; }
.desc-body { font-size: 1.0625rem; line-height: 1.53; }
.desc-body p { margin: 0 0 0.9em; }
.desc.clamped .desc-body { max-height: calc(1.53em * 4); overflow: hidden; -webkit-mask: linear-gradient(#000 60%, transparent); mask: linear-gradient(#000 60%, transparent); }
.desc-toggle { color: var(--link); font-size: 1.0625rem; margin-top: 2px; padding: 0; }
.desc:not(.clamped) .desc-toggle { display: none; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cards, .cards.two { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.band .card { background: #fff; }
.block:not(.band) .card, .block:not(.band) .code { background: var(--band); }
.block:not(.band) .code-head { border-color: #e3e3e8; }
.card .ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.card .ic .sym { width: 20px; height: 20px; stroke-width: 1.9; }
.card h3 { font-size: 1.1875rem; line-height: 1.26; font-weight: 600; letter-spacing: -0.016em; margin: 0; }
.card p { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); letter-spacing: -0.012em; }
.card p b { color: var(--text); font-weight: 600; }
.card .say { margin-top: auto; padding-top: 10px; font-size: 0.9375rem; color: var(--text); font-weight: 500; }
.card .say::before { content: "“"; } .card .say::after { content: "”"; }

/* Stat cards (big gradient-free numbers) */
.stat { background: #fff; border-radius: 18px; padding: 26px 28px; }
.stat .n { font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1; font-weight: 600; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .n small { font-size: 0.5em; font-weight: 600; margin-left: 2px; }
.stat p { margin: 10px 0 0; font-size: 0.9375rem; line-height: 1.45; color: var(--text-2); }

/* ---------- Grouped list (rows with hairlines) ---------- */
.list { background: #fff; border-radius: 18px; overflow: hidden; }
.block:not(.band) .list { background: var(--band); }
.list-row { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px 22px; position: relative; }
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 22px; right: 0; height: 1px; background: var(--hair-soft); }
.list-row h3 { font-size: 1.0625rem; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.list-row p { margin: 3px 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); }
.list-row .n { width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: #fff; font-size: 0.8125rem; font-weight: 600; display: grid; place-items: center; margin-top: 1px; }

/* ---------- Information table ---------- */
.info { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 40px; margin: 0; }
@media (max-width: 860px) { .info { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .info { grid-template-columns: 1fr; } }
.info > div { border-top: 1px solid var(--hair-soft); padding: 14px 0; }
.info dt { font-size: 0.875rem; color: var(--text-3); }
.info dd { margin: 4px 0 0; font-size: 1.0625rem; line-height: 1.4; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 0.875rem; padding: 6px 14px; border-radius: 980px; background: var(--band); color: var(--text); letter-spacing: -0.01em; }
.band .tag { background: #fff; }

/* ---------- Code ---------- */
.code { background: #fff; border-radius: 18px; overflow: hidden; margin: 0; }
.code-head { padding: 14px 22px; border-bottom: 1px solid var(--hair-soft); font-size: 0.8125rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.code-head::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: #F05138; }
.code pre { margin: 0; padding: 18px 22px 22px; overflow-x: auto; font: 0.8125rem/1.7 ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; letter-spacing: 0; color: #1d1d1f; }
.code .k { color: #9B2393; font-weight: 600; } .code .f { color: #326D74; } .code .n { color: #1C00CF; } .code .c { color: #5D6C79; } .code .s { color: #C41A16; }

/* ---------- Next / footer ---------- */
.next-row { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: var(--band); border-radius: 18px; color: var(--text); }
.next-row:hover { text-decoration: none; background: #ededf0; }
.next-row .icon { --s: 56px; }
.next-row .grow { flex: 1; }
.foot { background: linear-gradient(var(--hair-soft), var(--hair-soft)) content-box top / 100% 1px no-repeat; padding-block: 22px 40px; font-size: 0.75rem; color: var(--text-3); letter-spacing: -0.01em; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal.no-anim { transition: none; }
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } .reveal { transform: none; transition: opacity 200ms ease; } }

/* Surfaces flip against their band */
.block:not(.band) .stat { background: var(--band); }
.band .next-row { background: #fff; }
.band .next-row:hover { background: #fafafa; }
.band .code { background: #fff; }

/* ---------- Icon as image ---------- */
.icon-img { object-fit: cover; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.06); }

/* ---------- Phone: iPhone 18 Pro (Black) frame exported from Figma ----------
   Frame PNG is 720×1483; the screen opening is 91.433% × 96.539% at (4.246%, 1.730%). */
.phone { position: relative; width: 100%; aspect-ratio: 720 / 1483; container-type: inline-size; filter: drop-shadow(0 18px 28px rgba(0,0,0,0.16)); }
.phone::after { content: ""; position: absolute; inset: 0; background: url("../assets/device/iphone-18-pro-black.png") center / 100% 100% no-repeat; pointer-events: none; z-index: 3; }
.phone-screen { position: absolute; left: 4.246%; top: 1.73%; width: 91.433%; height: 96.539%; overflow: hidden; background: #000; border-radius: 13% / 6%; }
.phone-screen > img, .phone-screen > video { position: absolute; left: 0; top: 6.6%; width: 100%; height: 93.4%; object-fit: cover; object-position: top; display: block; }
.phone-screen::before { content: "9:41"; position: absolute; top: 2.15%; left: 12%; color: #fff; font-weight: 600; font-size: 5.6cqw; letter-spacing: -0.01em; z-index: 1; }
.phone-screen::after { content: ""; position: absolute; top: 2.55%; right: 11%; width: 6.6cqw; height: 3.1cqw; z-index: 1; box-sizing: border-box; border: 0.3cqw solid rgba(255,255,255,0.45); border-radius: 0.9cqw; padding: 0.35cqw; background: linear-gradient(#fff, #fff) content-box; }
.phone .sound { z-index: 4; }

/* ---------- Screenshot rail ---------- */
.preview-block { padding-top: clamp(32px, 5vw, 56px); }
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(200px, 22vw, 250px); gap: clamp(16px, 2vw, 24px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))) 20px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.shots::-webkit-scrollbar { display: none; }
.shot { margin: 0; scroll-snap-align: start; }
.shot figcaption { margin-top: 14px; font-size: 0.875rem; line-height: 1.4; color: var(--text-2); letter-spacing: -0.01em; }
.shot figcaption b { display: block; color: var(--text); font-weight: 600; font-size: 0.9375rem; }
.paddles { display: flex; gap: 10px; }
.paddle { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text-2); transition: background-color 150ms ease, opacity 150ms ease; }
.paddle:hover { background: rgba(0,0,0,0.09); }
.paddle:disabled { opacity: 0.35; cursor: default; }
.paddle .sym { width: 16px; height: 16px; stroke-width: 2.4; }
.sound { position: absolute; z-index: 4; right: 9%; bottom: 4.5%; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(30,30,30,0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sound .sym { width: 17px; height: 17px; }
.sound .on { display: none; }
.sound[aria-pressed="true"] .on { display: block; }
.sound[aria-pressed="true"] .off { display: none; }

/* Full-screen recordings already include their own status bar: show them edge to edge. */
.phone.raw .phone-screen > img, .phone.raw .phone-screen > video { top: 0; height: 100%; }
.phone.raw .phone-screen::before, .phone.raw .phone-screen::after { display: none; }
