/* Bit by Bit — site styles. Colours, fonts and bevels match the app (BitByBit/Shared/Theme.swift). */
:root {
  --desk: #0b120c;
  --ground: #101a12;
  --panel: #1c2b20;
  --panel2: #243628;
  --bar: #0a110b;
  --chip: #141c15;
  --ink: #060b07;
  --text: #f4ecd8;
  --muted: #a9b8a0;
  --accent: #c4511a;
  --accent-light: #e0743a;
  --accent-dark: #8f3810;
  --gold: #f6d55c;
  --gain: #8fe36b;
  --loss: #ff8a4c;
  --water: #8cc3f7;
  --sand: #f2e5c0;
  --dark-button: #2c3b2f;
  --fairway: #9acb56;
  --rough: #3f6a26;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --body: "Jersey 15", system-ui, sans-serif;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 22px;
  line-height: 1.35;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; image-rendering: pixelated; }
a { color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Pixel type */
.px { font-family: var(--pixel); letter-spacing: 0.02em; line-height: 1.5; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.45; margin: 0; }
h1 { font-size: clamp(22px, 4.6vw, 42px); }
h2 { font-size: clamp(16px, 2.6vw, 24px); }
h3 { font-size: 13px; color: var(--gold); }
.label { font-family: var(--body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
p { margin: 0 0 14px; max-width: 62ch; }

/* Notched pixel frame: offset rectangles instead of a rounded stroke (PixelFrame in the app) */
.frame { position: relative; background: var(--panel); box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink); }
.card { padding: 20px; }

/* Buttons: bevelled like PixelButtonStyle */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--body); text-transform: uppercase; letter-spacing: 0.06em; font-size: 22px;
  color: var(--text); text-decoration: none; padding: 12px 22px; min-height: 52px;
  background: #a8440f;
  box-shadow:
    inset 4px 4px 0 var(--accent), inset -4px -4px 0 #7a2f0b,
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
  border: 0; cursor: pointer;
}
.btn:hover { color: var(--text); filter: brightness(1.08); }
.btn:active { transform: translateY(2px); }
.btn.secondary {
  background: var(--dark-button);
  box-shadow:
    inset 4px 4px 0 #3e5242, inset -4px -4px 0 #1b261d,
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}
.btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn[aria-disabled="true"]:active { transform: none; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--bar); border-bottom: 3px solid var(--ink); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: 36px; box-shadow: 0 0 0 3px var(--ink); }
.brand span { font-family: var(--pixel); font-size: 13px; white-space: nowrap; }
.nav { display: flex; gap: 22px; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--muted); text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; font-size: 18px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 3px solid var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 75% 110%, rgba(154, 203, 86, 0.22), transparent 70%),
    var(--desk); }
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i { position: absolute; width: 6px; height: 6px; background: var(--gold); opacity: 0.85; }
.stars i.dim { background: #1f2f22; opacity: 1; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 0; }
.hero-copy { padding-bottom: 64px; }
.hero h1 .gold { display: block; white-space: nowrap; }
.hero p.lead { font-size: 26px; color: var(--text); margin: 22px 0 28px; max-width: 30ch; }
.cta { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.note { font-size: 18px; color: var(--muted); margin-top: 16px; }
.hero-devices { position: relative; height: 640px; }
.hero-devices .phone { position: absolute; right: 130px; bottom: -36px; width: 290px; }
.hero-devices .watch { position: absolute; right: 0; bottom: 120px; width: 200px; }

/* Device mocks: iPhone 17 Pro and Apple Watch Ultra, drawn in CSS around real screenshots */
.phone {
  position: relative; padding: 3.4%; border-radius: 12.5% / 5.9%;
  background: #0d0f0e;
  box-shadow: 0 0 0 2px #5b605d, 0 0 0 4px #2a2d2c, 0 26px 50px rgba(0,0,0,0.55);
}
.phone img { width: 100%; border-radius: 9.8% / 4.6%; image-rendering: auto; }
/* side buttons: action + volume on the left, side button on the right */
.phone::before { content: ""; position: absolute; left: -6px; top: 17%; width: 3px; height: 26%;
  background: linear-gradient(#4b4f4d 0 16%, transparent 16% 34%, #4b4f4d 34% 62%, transparent 62% 72%, #4b4f4d 72% 100%); }
.phone::after { content: ""; position: absolute; right: -6px; top: 25%; width: 3px; height: 10%; border-radius: 0 2px 2px 0; background: #4b4f4d; }

.watch { position: relative; padding: 0 6%; isolation: isolate; }
.watch .band { position: absolute; left: 22%; right: 22%; z-index: -1; background: linear-gradient(90deg, #a8440f, #e0743a 50%, #a8440f);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25); }
.watch .band::after { content: ""; position: absolute; inset: 22% 18%; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 3px, transparent 3px 9px); }
.watch .band.top { top: -16%; height: 22%; border-radius: 12px 12px 0 0; }
.watch .band.bottom { bottom: -16%; height: 22%; border-radius: 0 0 12px 12px; }
.watch .case {
  position: relative; padding: 7%; border-radius: 19% / 16%;
  background: linear-gradient(145deg, #d9d5cd, #9b968e 45%, #c9c4bb 70%, #8a857d);
  box-shadow: 0 0 0 1px #6c6862, 0 20px 40px rgba(0,0,0,0.55);
}
.watch .face { padding: 6%; border-radius: 16% / 13%; background: #000; box-shadow: 0 0 0 2px #2b2b2b; }
.watch img { width: 100%; border-radius: 12% / 10%; image-rendering: pixelated; }
/* crown with its guard, side button below, orange Action button on the left */
.watch .crown { position: absolute; right: -5%; top: 26%; width: 7%; height: 24%; border-radius: 3px 8px 8px 3px;
  background: linear-gradient(90deg, #8a857d, #d9d5cd 60%, #9b968e); }
.watch .crown::before { content: ""; position: absolute; right: -45%; top: 28%; width: 60%; height: 44%; border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(0deg, #8a857d 0 2px, #c9c4bb 2px 4px); }
.watch .side { position: absolute; right: -3.5%; top: 58%; width: 5%; height: 14%; border-radius: 0 6px 6px 0; background: linear-gradient(90deg, #8a857d, #c9c4bb); }
.watch .action { position: absolute; left: -3.5%; top: 30%; width: 5%; height: 20%; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, #e0743a, #c4511a); }

/* Sections */
section { padding: 72px 0; }
section.alt { background: var(--desk); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 32px; }
.section-head p { max-width: 46ch; margin: 0; color: var(--muted); }
.kicker { font-family: var(--pixel); font-size: 11px; color: var(--accent-light); margin-bottom: 14px; display: block; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { padding: 22px; }
.feature .glyph { width: 40px; height: 40px; margin-bottom: 14px; }
.feature h3 { margin-bottom: 10px; }
.feature p { margin: 0; color: var(--text); font-size: 20px; }

/* Screen gallery */
/* Full-bleed scroller: slides run to the browser edge, but the first one lines up with the content column
   (the inset matches .wrap's left edge) and snapping keeps them there. */
.gallery {
  --inset: max(16px, calc((100vw - var(--max)) / 2 + 16px));
  display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 30px; overflow-x: auto;
  margin-inline: calc(50% - 50vw); padding: 16px var(--inset) 26px; scroll-padding-inline: var(--inset);
  scroll-snap-type: x mandatory; scrollbar-color: var(--panel2) transparent;
}
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery figcaption { margin-top: 18px; }
.gallery figcaption b { display: block; font-family: var(--pixel); font-weight: 400; font-size: 11px; color: var(--gold); margin-bottom: 6px; }
.gallery figcaption span { color: var(--muted); font-size: 19px; }
.gallery.watches { grid-auto-columns: 196px; padding-top: 48px; padding-bottom: 30px; }
.gallery.watches figcaption { margin-top: 44px; }

/* Map callout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps .n { font-family: var(--pixel); font-size: 13px; color: var(--ink); background: var(--gold); width: 36px; height: 36px; display: grid; place-items: center; }
.steps b { display: block; font-weight: 400; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; font-size: 19px; }
.map-shot { padding: 10px; }
.map-shot img { width: 100%; image-rendering: pixelated; }
.map-shot .cap { margin-top: 10px; color: var(--muted); font-size: 17px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.stat { padding: 16px; text-align: center; }
.stat .px { font-size: 20px; color: var(--gold); display: block; margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: 18px; }

/* FAQ */
.faq { display: grid; gap: 16px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 20px; font-size: 22px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--pixel); font-size: 14px; color: var(--gold); }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 20px 18px; color: var(--muted); }

/* Beta band */
.beta { text-align: center; }
.beta .card { padding: 40px 24px; }
.beta h2 { margin-bottom: 16px; }
.beta p { max-width: 52ch; margin: 0 auto 26px; }

/* Long-form pages (privacy, support) */
.doc { max-width: 760px; margin: 0 auto; padding: 56px 16px 80px; }
.doc h1 { font-size: clamp(20px, 3.4vw, 30px); margin-bottom: 10px; }
.doc h2 { font-size: 15px; color: var(--gold); margin: 38px 0 14px; }
.doc p, .doc li { font-size: 21px; }
.doc ul { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin-bottom: 8px; max-width: 62ch; }
.doc .card { margin: 26px 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 19px; }
.doc th, .doc td { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--panel2); vertical-align: top; }
.doc th { color: var(--muted); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; font-size: 16px; }

/* Footer */
footer { background: var(--bar); border-top: 3px solid var(--ink); padding: 40px 0 48px; color: var(--muted); font-size: 18px; }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: flex-end; }
footer nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--text); text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; }
footer nav a:hover { color: var(--gold); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-copy { padding-bottom: 0; }
  .stars { display: none; }
  .hero-devices { height: 530px; max-width: 420px; width: 100%; margin: 0 auto; }
  .hero-devices .phone { right: auto; left: 0; width: 250px; bottom: -60px; }
  .hero-devices .watch { width: 160px; right: 0; bottom: 60px; }
  .features { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .map-shot { max-width: 440px; width: 100%; justify-self: center; }
  footer .wrap { grid-template-columns: 1fr; }
  footer nav { justify-content: flex-start; }
}
@media (max-width: 600px) {
  body { font-size: 20px; }
  .nav { gap: 4px; }
  .nav a { padding: 0 6px; font-size: 17px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .nav a.hide-sm { display: none; }
  .brand span { font-size: 11px; }
  .hero p.lead { font-size: 23px; }
  .hero-devices { height: 410px; margin-top: 8px; }
  .hero-devices .phone { width: 210px; bottom: -90px; }
  .hero-devices .watch { width: 136px; bottom: 50px; }
  .features { grid-template-columns: 1fr; gap: 12px; }
  .feature { display: grid; grid-template-columns: 32px 1fr; column-gap: 14px; align-items: start; padding: 14px 16px; }
  .feature .glyph { width: 32px; height: 32px; margin: 2px 0 0; grid-row: span 2; }
  .feature h3 { margin-bottom: 4px; font-size: 11px; }
  .feature p { font-size: 18px; }
  .stats-row { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
  .gallery { grid-auto-columns: 200px; }
  .gallery.watches { grid-auto-columns: 170px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
