/* Pocket Links — pocketlinkgolf.netlify.app
   The game's own look, spoken in CSS: a cream page on a dark desk, ink and
   graphite, one red flag. Boxes are wobbled by the #pencil SVG filter defined
   in each page, so straight lines read as drawn ones. */

:root {
  --desk: #46403a;
  --desk-deep: #3a352f;
  --page: #f6f1e4;
  --page-shade: #ece5d2;
  --page-edge: #d9d0b8;
  --ink: #2e2a24;
  --ink-soft: #6e675c;
  --pencil: #55504a;
  --flag: #c7402d;
  --fairway: #90be7f;
  --fairway-deep: #5f934f;
  --water: #85aecb;
  --sand: #e7d6a8;
  --target: #df9f3f;
  --hand: "Caveat", "Bradley Hand", cursive;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--desk);
  color: var(--ink);
  font-family: var(--ui);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the desk and the page ---------- */

.desk {
  min-height: 100vh;
  padding: clamp(10px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page {
  background: var(--page);
  width: min(1120px, 100%);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  position: relative;
}

/* The notebook's dot grid. */
.dotted {
  background-image: radial-gradient(var(--page-edge) 1.1px, transparent 1.3px);
  background-size: 26px 26px;
  background-position: 13px 13px;
}

.sketch { filter: url(#pencil); }

/* Wobble the drawn edge, never the words: elements marked data-sketch keep
   crisp text and grow a filtered border layer underneath instead. */
.sketchbox { position: relative; border: none !important; }
.sketchbox::before {
  content: "";
  position: absolute; inset: 0;
  border: 2.5px solid var(--pencil);
  border-radius: inherit;
  filter: url(#pencil);
  pointer-events: none;
}

/* ---------- type ---------- */

.hand { font-family: var(--hand); font-weight: 600; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

h1 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 46px);
  line-height: 1.05;
}

h3 { font-family: var(--hand); font-weight: 600; font-size: 26px; }

p.lede { font-size: 18px; color: var(--ink-soft); max-width: 34em; }
p.body { font-size: 15.5px; color: var(--ink-soft); max-width: 38em; }
p.body strong, p.lede strong { color: var(--ink); font-weight: 600; }

.rule {
  height: 2px;
  background: var(--ink-soft);
  opacity: 0.55;
  border: none;
  width: 110px;
  border-radius: 2px;
}

/* ---------- header ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 4vw, 44px);
  border-bottom: 2px solid rgba(46, 42, 36, 0.14);
}

.wordmark {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 27px;
  color: var(--ink);
  text-decoration: none;
}
.wordmark small {
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--flag);
  vertical-align: super;
  margin-left: 4px;
}

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); background: var(--page-shade); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(18px, 4vw, 44px);
  align-items: center;
  padding: clamp(30px, 6vw, 72px) clamp(18px, 4vw, 44px);
}

.hero-copy { display: flex; flex-direction: column; gap: 18px; }

.tagline {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(21px, 2.6vw, 27px);
  color: var(--ink);
  line-height: 1.25;
  max-width: 17em;
}
.tagline em { font-style: normal; color: var(--flag); }

.hero-stage {
  position: relative;
  aspect-ratio: 10 / 11;
  min-height: 300px;
}
#ball-canvas, .hero-stage > svg.stage-page {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
#ball-canvas { z-index: 2; }

/* ---------- the badge ---------- */

.badge-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* Apple's own artwork, used as provided: no filter, no restyle, and clear
   space of a quarter of its height on every side, per the badge guidelines. */
.apple-badge { display: inline-block; padding: 13px; margin: -13px; }
.apple-badge img { display: block; height: 54px; width: auto; }
.apple-badge { transition: transform 0.15s ease; }
.apple-badge:hover { transform: translateY(-2px); }

.soft-cta {
  font-size: 13.5px;
  color: var(--ink-soft);
}
.soft-cta a { color: var(--flag); font-weight: 600; text-decoration: none; }
.soft-cta a:hover { text-decoration: underline; }

/* ---------- fact strip ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 clamp(18px, 4vw, 44px) clamp(26px, 4vw, 44px);
}
.fact {
  background: var(--page-shade);
  border: 2px solid var(--pencil);
  border-radius: 10px;
  padding: 14px 16px;
}
.fact .hand { font-size: 21px; display: block; }
.fact span.sub { font-size: 12.5px; color: var(--ink-soft); }

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

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 60px);
  align-items: center;
  padding: clamp(34px, 6vw, 70px) clamp(18px, 4vw, 44px);
  border-top: 2px dashed rgba(85, 80, 74, 0.3);
}
.feature.flip .shot { order: 2; }
.feature-copy { display: flex; flex-direction: column; gap: 14px; }
.feature-copy ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feature-copy li {
  font-size: 14.5px; color: var(--ink-soft);
  padding-left: 20px; position: relative;
}
.feature-copy li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--flag); opacity: 0.85;
}

/* phone frames for real captures */
.shot { display: flex; justify-content: center; gap: 18px; }
.phone {
  width: min(270px, 72vw);
  border-radius: 34px;
  border: 3px solid var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  background: var(--desk-deep);
  transform: rotate(-1.2deg);
}
.phone + .phone { transform: rotate(1.4deg) translateY(18px); }
.phone img { display: block; width: 100%; height: auto; }
.shot.duo .phone { width: min(225px, 44vw); }

/* ---------- Q&A ---------- */

.qa { padding: clamp(34px, 6vw, 70px) clamp(18px, 4vw, 44px); border-top: 2px dashed rgba(85, 80, 74, 0.3); }
.qa-list { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; max-width: 760px; }
details {
  background: var(--page-shade);
  border: 2px solid var(--pencil);
  border-radius: 10px;
  padding: 14px 18px;
}
details summary {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 21px;
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-family: var(--ui); font-weight: 700; color: var(--flag); font-size: 20px; }
details[open] summary::after { content: "–"; }
details p { margin-top: 8px; font-size: 14.5px; color: var(--ink-soft); max-width: 60ch; }
details p a { color: var(--flag); }

/* ---------- prose pages (privacy, terms, faq) ---------- */

.prose {
  padding: clamp(30px, 6vw, 64px) clamp(18px, 4vw, 44px);
  max-width: 820px;
}
.prose h1 { font-size: clamp(44px, 7vw, 64px); margin-bottom: 6px; }
.prose .updated { font-size: 12.5px; color: var(--ink-soft); letter-spacing: 0.06em; }
.prose h2 { font-size: 30px; margin: 34px 0 8px; }
.prose p, .prose li { font-size: 15px; color: var(--ink-soft); max-width: 68ch; }
.prose p strong { color: var(--ink); }
.prose ul { padding-left: 22px; margin: 8px 0; }
.prose a { color: var(--flag); }

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

.site-foot {
  border-top: 2px solid rgba(46, 42, 36, 0.14);
  padding: 30px clamp(18px, 4vw, 44px) 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.fineprint { font-size: 11.5px; color: var(--ink-soft); opacity: 0.85; max-width: 74ch; line-height: 1.65; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stage { order: -1; min-height: 240px; aspect-ratio: 5 / 4; }
  .facts { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature.flip .shot { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .store-badge { transition: none; }
}

/* ============================================================
   The playable hole, and the story sections around it.

   Added when the front page stopped being a poster and became a
   demonstration: the hardest thing about this game is that it sounds like
   luck until you have felt one shot of it, and no screenshot carries that.
   ============================================================ */

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--page);
  padding: 10px 16px; border-radius: 8px; z-index: 20;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- hero, now two columns with the demo on the right ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
}

.hero h1 {
  font-family: var(--hand);
  font-size: clamp(3rem, 7.5vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.5px;
}
.hero h1 em { font-style: normal; color: var(--flag); }

.hero .lede { color: var(--ink-soft); max-width: 46ch; margin-top: 14px; }

/* ---------- the demo ---------- */

.demo {
  background: var(--page);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: clamp(14px, 2vw, 20px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  filter: url(#pencil);
}
/* The filter wobbles the box; the contents must not inherit the wobble or the
   dot grid crawls. */
.demo > * { filter: none; }

.demo-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1.5px solid var(--page-edge);
  padding-bottom: 8px; margin-bottom: 12px;
}
.demo-title { font-weight: 700; letter-spacing: .04em; font-size: .8rem; text-transform: uppercase; color: var(--ink-soft); }
.demo-sub { font-family: var(--hand); font-size: 1.35rem; }

.demo-board {
  display: block; width: 100%; height: auto;
  background: var(--page);
  border: 1.5px solid var(--page-edge);
  border-radius: 8px;
  touch-action: manipulation;
}

.d-dot   { fill: var(--page-edge); }
.d-fairway { fill: var(--fairway); opacity: .55; }
.d-green   { fill: var(--fairway-deep); opacity: .5; }
.d-water   { fill: var(--water); opacity: .6; }
.d-sand    { fill: var(--sand); opacity: .85; }
.d-cup   { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.d-pole  { stroke: var(--pencil); stroke-width: 2; }
.d-flag  { fill: var(--flag); }
.d-ball  { fill: #fff; stroke: var(--ink); stroke-width: 2; }

.d-target { cursor: pointer; }
.d-ring { fill: rgba(223, 159, 63, .16); stroke: var(--target); stroke-width: 2.4; }
.d-pip  { fill: var(--target); }
.d-target:hover .d-ring,
.d-target:focus-visible .d-ring { fill: rgba(223, 159, 63, .42); stroke-width: 3.4; }
.d-target:focus-visible { outline: none; }

.demo-hud {
  display: flex; align-items: center; gap: 16px;
  margin-top: 14px;
}
.demo-die {
  width: 52px; height: 52px; flex: none;
  border: 2px solid var(--ink); border-radius: 9px;
  background: var(--page-shade);
  display: grid; place-items: center;
  transition: transform .12s ease;
}
.demo-die svg { width: 100%; height: 100%; }
.demo-die.is-rolling { animation: tumble .16s linear infinite; }
@keyframes tumble {
  0%   { transform: rotate(-9deg) translateY(0); }
  50%  { transform: rotate(8deg) translateY(-3px); }
  100% { transform: rotate(-9deg) translateY(0); }
}
.d-pip-face { fill: var(--ink); }

.demo-stats { display: flex; gap: 18px; flex: 1; }
.demo-stats div { display: flex; flex-direction: column; }
.demo-stats dt { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.demo-stats dd { font-family: var(--hand); font-size: 1.5rem; line-height: 1.1; }

.demo-say { margin-top: 12px; min-height: 3em; color: var(--ink-soft); font-size: .95rem; }
.demo-say strong { color: var(--ink); }
.d-gust { color: var(--flag); }

.demo-roll {
  width: 100%; margin-top: 8px;
  font: inherit; font-weight: 600; font-size: 1.05rem;
  padding: 14px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--sand); color: var(--ink); cursor: pointer;
  transition: transform .08s ease, background .18s ease;
}
.demo-roll:hover:not(:disabled) { background: #f0e2b8; }
.demo-roll:active:not(:disabled) { transform: translateY(2px); }
.demo-roll:disabled { opacity: .42; cursor: default; }

.demo-foot { margin-top: 10px; font-size: .78rem; color: var(--ink-soft); }

/* ---------- alternating story bands ---------- */

.band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(40px, 7vw, 92px) clamp(24px, 5vw, 64px);
  border-top: 1.5px solid var(--page-edge);
}
.band-flip > .band-copy { order: 2; }
.tinted { background: var(--page-shade); }

.band h2, .feature h2, .offer h2, .promise h2 {
  font-family: var(--hand);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.04;
  margin: 6px 0 16px;
}
.band p { margin-bottom: 14px; color: var(--ink-soft); max-width: 54ch; }
.band p em { font-style: italic; color: var(--ink); }

.ticks { list-style: none; margin-top: 18px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-soft); }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 13px; height: 7px;
  border-left: 2.4px solid var(--flag); border-bottom: 2.4px solid var(--flag);
  transform: rotate(-45deg);
}
.ticks-quiet li::before { border-color: var(--pencil); }
.ticks strong { color: var(--ink); }

/* A phone has to read as a phone. Unconstrained, a 1320x2868 capture in a
   450px column comes out 978px tall - a wall of dark desk surround that fills
   the viewport and reads as a rendering fault rather than a screenshot. */
.band .shot { display: flex; justify-content: center; }
.band .shot img, .shot img {
  width: 100%; max-width: 300px; height: auto; display: block;
  border-radius: 14px;
  box-shadow: 0 20px 46px rgba(0, 0, 0, .26);
}

/* ---------- the three cards ---------- */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.card {
  background: var(--page); border: 1.6px solid var(--ink);
  border-radius: 9px; padding: 14px 12px;
  filter: url(#pencil);
  transition: transform .16s ease, box-shadow .16s ease;
  cursor: default;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 14px 26px rgba(0, 0, 0, .18);
  outline: none;
}
.card-name { font-family: var(--hand); font-size: 1.3rem; display: block; margin-bottom: 6px; }
.card p { font-size: .84rem; margin-bottom: 8px; color: var(--ink-soft); }
.card-note { font-size: .72rem; color: var(--pencil); display: block; border-top: 1px solid var(--page-edge); padding-top: 6px; }

/* ---------- the daily ---------- */

.feature { padding: clamp(40px, 7vw, 92px) clamp(24px, 5vw, 64px); border-top: 1.5px solid var(--page-edge); }
.feature-lead { max-width: 62ch; }
.feature .lede { color: var(--ink-soft); margin-bottom: 14px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.trio-item { background: var(--page); border-radius: 10px; padding: 20px; border: 1.5px solid var(--page-edge); }
.trio-item h3 { font-family: var(--hand); font-size: 1.6rem; margin-bottom: 8px; }
.trio-item p { color: var(--ink-soft); font-size: .92rem; }

/* ---------- the offer ---------- */

.offer { padding: clamp(40px, 7vw, 92px) clamp(24px, 5vw, 64px); border-top: 1.5px solid var(--page-edge); }
.price { margin: 4px 0 30px; }
.price-amount { font-family: var(--hand); font-size: clamp(2.6rem, 6vw, 4rem); color: var(--flag); }
.price-note { color: var(--ink-soft); font-size: .95rem; }
.offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 56px); }
.offer-col h3 { font-family: var(--hand); font-size: 1.7rem; margin-bottom: 6px; }
.offer-foot { margin-top: 28px; font-size: .85rem; color: var(--ink-soft); }

/* ---------- the promise ---------- */

.promise { padding: clamp(40px, 7vw, 92px) clamp(24px, 5vw, 64px); border-top: 1.5px solid var(--page-edge); text-align: center; }
.promise-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px; margin-top: 28px; text-align: left;
}
.promise-grid div { padding: 16px 18px; border-left: 3px solid var(--flag); color: var(--ink-soft); }
.promise-grid strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 3px; }
.promise-foot { margin-top: 34px; font-family: var(--hand); font-size: clamp(1.3rem, 2.6vw, 1.9rem); }

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

.site-foot { padding: 40px clamp(24px, 5vw, 64px); border-top: 1.5px solid var(--page-edge); background: var(--page-shade); }
.foot-mark { font-family: var(--hand); font-size: 1.7rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; }
.site-foot nav a { color: var(--ink-soft); }
.foot-fine { font-size: .8rem; color: var(--pencil); }

/* ---------- arriving as if drawn ---------- */

.will-draw { opacity: 0; transform: translateY(18px); }
.will-draw.is-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.3,1); }
@media (prefers-reduced-motion: reduce) {
  .will-draw { opacity: 1; transform: none; }
  .demo-die.is-rolling { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- narrow ---------- */

@media (max-width: 900px) {
  .hero, .band { grid-template-columns: 1fr; }
  .band-flip > .band-copy { order: 0; }
  .offer-grid { grid-template-columns: 1fr; }
  .trio, .cards { grid-template-columns: 1fr; }
  .band .shot { max-width: 340px; margin: 0 auto; }
}

.coming {
  margin-top: 26px; font-family: var(--hand);
  font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2;
}
.coming span { display: block; font-family: var(--ui); font-size: .82rem; color: var(--ink-soft); margin-top: 4px; }
.d-hit { fill: transparent; }

/* The badge row: Apple's mark, and the honest caption beside it while the
   listing does not exist yet. */
.badge-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.badge-row .coming { margin-top: 0; font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.apple-badge[aria-disabled="true"] { cursor: default; opacity: .55; }
.apple-badge[aria-disabled="true"]:hover { transform: none; }

/* The hole-out flourish: the same seven pencil sparks the app throws from the
   cup, alternating flag red and graphite. transform-box keeps the scale
   anchored to the cup in user units rather than the element's own bounds. */
.d-sparks { transform-box: view-box; }
.d-spark-flag   { stroke: var(--flag); stroke-width: 1.9; stroke-linecap: round; }
.d-spark-pencil { stroke: var(--pencil); stroke-width: 1.9; stroke-linecap: round; }
.d-flag { transform-box: view-box; }
