/* Simply Golf: the game's paper, ink, club green and brass. */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/BarlowCondensed-Bold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("fonts/BarlowCondensed-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Caveat"; font-weight: 400 700; font-display: swap; src: url("fonts/Caveat.ttf") format("truetype"); }

:root {
  --paper: #FBF5E4;
  --paper-shade: #F1E6C9;
  --paper-edge: #D9C99F;
  --ink: #22302A;
  --ink-soft: #5C6960;
  --rule: #A9CDB4;
  --club: #1F6B45;
  --club-dark: #123F29;
  --club-light: #2F8A5A;
  --brass: #D8B05A;
  --brass-dark: #9A7630;
  --pencil: #34384A;
  --red: #EE6A5E;
  --stamp: #C2402F;
  --sky: #9EE3F8;
  --sky-high: #6CC6EE;
  --dirt: #7A3428;
  --dirt-2: #8A4332;
  --dirt-3: #6A2C22;
  --grass: #4EA843;
  --grass-hi: #7EE05A;

  --body: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.45;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--club); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--club-light); }

:focus-visible { outline: 3px solid var(--brass-dark); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--club); color: var(--paper); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- Hero: one golf hole ---------- */

.hero {
  position: relative;
  min-height: min(92vh, 860px);
  min-height: min(92svh, 860px);
  background: linear-gradient(var(--sky-high), var(--sky) 70%);
  overflow: hidden;
  isolation: isolate;
}

.hero .scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
}

.sign {
  position: relative;
  margin: 0 auto;
  top: clamp(56px, 9vh, 96px);
  width: min(640px, calc(100% - 32px));
  padding: 18px 24px 20px;
  background: var(--club);
  border: 3px solid var(--brass);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--club-dark), 0 16px 30px rgba(18, 63, 41, .25);
  color: var(--paper);
  text-align: center;
}

.sign .hole {
  margin: 0;
  color: var(--brass);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sign h1 {
  margin: 2px 0 0;
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 6.2rem);
  line-height: .9;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.sign .wind {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin: 10px 0 0;
  color: var(--brass);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sign .wind svg { width: 54px; height: 14px; }

.sign .tagline {
  margin: 6px 0 0;
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(1.5rem, 4.4vw, 2.1rem);
  line-height: 1.1;
  color: var(--paper);
}

/* Player cards, as in the corners of the game screen */
.card {
  position: absolute;
  top: 18px;
  display: flex;
  min-width: 96px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 rgba(34, 48, 42, .35);
  overflow: hidden;
  text-align: center;
  font-size: 1rem;
}
.card::before { content: ""; width: 14px; background: var(--chip); }
.card div { flex: 1; padding: 4px 14px 2px 10px; }
.card b { display: block; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); font-size: .9rem; }
.card output { display: block; font-weight: 800; font-size: 2.1rem; line-height: 1; }
.card.p1 { left: 16px; --chip: var(--red); transform: rotate(-3deg); }
.card.p2 { right: 16px; --chip: #4FA9E0; transform: rotate(2deg); }
.card output.bump { animation: bump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }

.shoot {
  position: absolute;
  right: 20px; bottom: 20px;
  padding: 10px 20px 10px 16px;
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.25rem/1 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--club-dark);
  background: var(--paper);
  border: 3px solid var(--club-dark);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--club-dark);
  cursor: pointer;
}
.shoot:hover { background: #fff; }
.shoot:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--club-dark); }
.shoot:disabled { opacity: .6; cursor: default; }
.shoot svg { width: 22px; height: 22px; }

/* "Hole in one!" rubber stamp */
.stamp {
  position: absolute;
  white-space: nowrap;
  left: 50%; top: 58%;
  margin: 0;
  padding: 6px 22px 4px;
  font-weight: 800;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 5px solid var(--stamp);
  border-radius: 12px;
  background: rgba(251, 245, 228, .88);
  box-shadow: 0 0 0 4px rgba(251, 245, 228, .88);
  transform: translate(-50%, -50%) rotate(-8deg) scale(2.4);
  opacity: 0;
  pointer-events: none;
}
.stamp.on { animation: stamp .45s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes stamp {
  to { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: .92; }
}

/* ---------- Paper sections ---------- */

main { position: relative; }

.paper {
  background:
    repeating-linear-gradient(transparent 0 37px, rgba(169, 205, 180, .55) 37px 39px),
    var(--paper);
  background-position: 0 14px;
}

.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }

.intro {
  padding: 72px 0 40px;
}
.intro .lede {
  max-width: 34ch;
  margin: 0;
  font-weight: 800;
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.05;
  color: var(--club-dark);
}
.intro .note {
  margin: 18px 0 0;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 1.35rem;
}
.intro .note .hand { display: block; margin-top: 10px; font-family: var(--hand); font-size: 1.7rem; color: var(--pencil); }

/* The bag: what's in the game, as a scorecard */
.bag { padding: 24px 0 72px; }

.scorecard {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper);
  border: 3px solid var(--club);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--paper-edge);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.scorecard li {
  padding: 22px 24px 24px;
  border-right: 2px solid var(--rule);
  border-bottom: 2px solid var(--rule);
  margin: 0 -2px -2px 0;
}
.scorecard h3 {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--club-dark);
}
.scorecard p { margin: 0; color: var(--ink-soft); }
.scorecard .pencil { font-family: var(--hand); font-size: 1.6rem; color: var(--pencil); line-height: 1; }

/* Taped-on snapshots */
.snaps {
  padding: 8px 0 88px;
}
.snaps h2 {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--club-dark);
}
.snaps .wrap > p { margin: 0 0 28px; color: var(--ink-soft); }
.strip {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 18px max(16px, calc((100vw - 1080px) / 2 + 16px)) 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--club) transparent;
}
.strip figure {
  position: relative;
  flex: 0 0 min(78vw, 560px);
  margin: 0;
  scroll-snap-align: center;
  background: #fff;
  padding: 10px 10px 12px;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(34, 48, 42, .18);
  transform: rotate(var(--tilt, -1.5deg));
}
.strip figure:nth-child(even) { --tilt: 1.2deg; }
.strip figure::before {
  content: "";
  position: absolute; left: 50%; top: -14px;
  width: 110px; height: 28px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(216, 176, 90, .55);
  border-left: 2px dashed rgba(255, 255, 255, .5);
  border-right: 2px dashed rgba(255, 255, 255, .5);
}
.strip img { width: 100%; height: auto; border-radius: 3px; aspect-ratio: 2778 / 1284; object-fit: cover; }

/* ---------- Footer: the dirt under the course ---------- */

.ground {
  position: relative;
  color: var(--paper);
  background:
    radial-gradient(circle at 12% 40%, rgba(0,0,0,.18) 0 5px, transparent 6px) 0 0 / 180px 120px,
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.15) 0 4px, transparent 5px) 0 0 / 230px 140px,
    linear-gradient(var(--dirt) 0 34%, var(--dirt-2) 34% 68%, var(--dirt-3) 68%);
  padding: 64px 0 40px;
  margin-top: 0;
}
.ground::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -20px; height: 34px;
  background:
    linear-gradient(var(--grass-hi) 0 6px, var(--grass) 6px);
  border-radius: 0 0 50% 50% / 0 0 14px 14px;
  -webkit-mask: radial-gradient(circle at 10px 0, #000 9px, transparent 10px) 0 100% / 20px 100% repeat-x,
                linear-gradient(#000, #000) 0 0 / 100% calc(100% - 8px) no-repeat;
          mask: radial-gradient(circle at 10px 0, #000 9px, transparent 10px) 0 100% / 20px 100% repeat-x,
                linear-gradient(#000, #000) 0 0 / 100% calc(100% - 8px) no-repeat;
}
.ground .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: center; justify-content: space-between; }
.ground .brand { display: flex; align-items: center; gap: 14px; font-weight: 800; font-size: 1.6rem; color: var(--paper); text-decoration: none; }
.ground .brand img { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.ground nav { display: flex; gap: 24px; flex-wrap: wrap; }
.ground nav a { color: var(--paper); font-weight: 700; }
.ground nav a:hover { color: var(--brass); }
.ground small { flex-basis: 100%; color: rgba(251, 245, 228, .72); font-size: 1rem; }

/* ---------- Document pages (privacy, terms, 404) ---------- */

.doc-top {
  background: var(--club);
  border-bottom: 4px solid var(--brass);
  color: var(--paper);
  padding: 22px 0 26px;
}
.doc-top .wrap { max-width: 820px; }
.doc-top a.home { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-weight: 800; font-size: 1.3rem; }
.doc-top a.home img { width: 36px; height: 36px; border-radius: 9px; }
.doc-top h1 { margin: 18px 0 0; font-weight: 800; font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 1; text-transform: uppercase; }
.doc-top p { margin: 4px 0 0; font-family: var(--hand); font-size: 1.7rem; color: var(--brass); }

.doc { padding: 40px 0 80px; }
.doc .wrap { max-width: 820px; }
.doc article {
  background: var(--paper);
  border: 3px solid var(--paper-edge);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--paper-edge);
  padding: clamp(22px, 5vw, 44px);
}
.doc article > :first-child { margin-top: 0; }
.doc h2 { margin: 34px 0 6px; font-weight: 800; font-size: 1.7rem; line-height: 1.15; color: var(--club-dark); }
.doc p, .doc li { max-width: 68ch; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 1.2em; }
.doc li { margin: 0 0 6px; }
.doc li::marker { color: var(--club-light); }
.doc .short {
  margin: 0 0 8px;
  padding: 14px 18px;
  background: var(--paper-shade);
  border-left: 5px solid var(--club);
  border-radius: 6px;
}
.doc .short b { color: var(--club-dark); }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 1.15rem; }
  .card { top: 12px; min-width: 76px; font-size: .9rem; }
  .card.p1 { left: 10px; } .card.p2 { right: 10px; }
  .card output { font-size: 1.6rem; }
  .sign { top: 84px; padding: 14px 16px 16px; }
  .shoot { right: 50%; transform: translateX(50%); bottom: 16px; }
  .shoot:active { transform: translateX(50%) translateY(3px); }
  .stamp { top: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}

.hero .scene.flight { z-index: 2; pointer-events: none; }
.shoot { z-index: 3; }
.stamp { z-index: 3; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.streaks path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .45;
  stroke-dasharray: 70 2400;
  animation: streak 5s linear infinite;
}
@keyframes streak { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -2470; } }
@media (prefers-reduced-motion: reduce) { .streaks { display: none; } }
