/* =========================================================
   Find My Pet - randm.games
   Clean, white, motion-design aesthetic (inspired by jitter.video):
   bold grotesk type, light-grey rounded cards, soft shadows,
   generous whitespace, one warm accent. The mini-game keeps the
   game's real look: a black-and-white map with white cats.
   Vanilla CSS, no frameworks.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --white:   #ffffff;
  --paper:   #faf9fb;          /* barely-off-white page */
  --card:    #f3f2f5;          /* light grey card */
  --card-2:  #ebeaee;          /* slightly deeper grey */
  --line:    #e4e2e8;
  --ink:     #17161a;          /* near-black */
  --ink-2:   #46434d;
  --muted:   #7c7986;
  --dark:    #141317;          /* dark cards / game map */

  --accent:      #2f9fdd;      /* sky blue, picked off the hero */
  --accent-deep: #1d7fb8;
  --accent-soft: #d9edfa;
  --danger:      #d64530;      /* errors stay red — the accent is no longer a warning colour */

  --r-xs: 12px;
  --r-sm: 16px;
  --r:    24px;
  --r-lg: 32px;
  --r-xl: 44px;

  --shadow-sm: 0 2px 8px rgba(23, 22, 26, 0.05);
  --shadow:    0 18px 40px -22px rgba(23, 22, 26, 0.28);
  --shadow-lg: 0 40px 80px -36px rgba(23, 22, 26, 0.35);

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 56px);

  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(16px, 0.4vw + 15px, 18px);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Browsers default replaced elements to `overflow: clip`, which crops a
   drop-shadow filter dead straight at the image edge — visible as a hard line
   under every pet. Let the shadow spill. */
img, svg { max-width: 100%; display: block; overflow: visible; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
main { position: relative; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
}

/* section scaffolding */
.section { padding: clamp(56px, 9vw, 132px) 0; }
.section-head { max-width: 40ch; margin-bottom: clamp(30px, 5vw, 60px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(2rem, 5.2vw, 4rem); }
.section-sub { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.28rem); margin-top: 0.7em; line-height: 1.5; }


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 0.95em 1.6em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); background: #000; box-shadow: var(--shadow); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { transform: translateY(-2px); background: var(--accent-deep); box-shadow: 0 18px 34px -18px rgba(29, 127, 184, 0.7); }
.btn--ghost { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--lg { font-size: 1.08rem; padding: 1.1em 1.9em; }

/* store badges */
.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.badge img { height: 52px; width: auto; border-radius: 12px; transition: transform 0.2s ease; }
.badge:hover img { transform: translateY(-2px); }

/* =========================================================
   Shared dark footer (.ftr) — used on the home page and the
   Privacy / Terms documents so the bottom of the site is one piece.
   The home page adds its own negative-margin panel overlap in landing.css.
   ========================================================= */
.ftr { background: #0B0A0E; color: #fff; padding: clamp(56px, 7vw, 84px) 0 40px; }
.ftr-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-bottom: clamp(30px, 4vw, 44px); border-bottom: 1px solid rgba(255,255,255,0.1); }
.ftr-logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: #fff; }
.ftr-logo-chip { width: 42px; height: 42px; border-radius: 12px; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; }
.ftr-logo-chip img { width: 29px; height: 29px; object-fit: contain; }
.ftr-btn { display: inline-flex; align-items: center; background: transparent; color: rgba(255,255,255,0.5); font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; padding: 11px 24px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); cursor: pointer; transition: color 0.16s ease, border-color 0.16s ease; }
.ftr-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

.ftr-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; padding-top: clamp(30px, 4vw, 44px); }
.ftr-links { display: flex; gap: clamp(48px, 6vw, 84px); }
.ftr-col h4 { font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 16px; }
.ftr-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ftr-col a { color: rgba(255,255,255,0.66); font-size: 0.95rem; cursor: pointer; transition: color 0.15s ease; }
.ftr-col a:hover { color: #fff; }
.ftr-copy { color: rgba(255,255,255,0.38); font-size: 0.85rem; }
@media (max-width: 640px) {
  .ftr-bottom { flex-direction: column; gap: 30px; }
  .ftr-links .ftr-col:first-child { display: none; }   /* Explore earns nothing on a phone */
}

/* =========================================================
   Document topbar (Privacy / Terms): Back pill + segmented control
   ========================================================= */
.doc-topbar { position: sticky; top: 0; z-index: 60; background: rgba(250, 249, 251, 0.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.doc-topbar.scrolled { border-color: var(--line); }
.doc-topbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 74px; }
.doc-back { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--ink-2); background: var(--white); border: 1px solid var(--line); padding: 0.6em 1.15em 0.6em 0.95em; border-radius: 999px; transition: color 0.15s ease, border-color 0.15s ease; }
.doc-back:hover { color: var(--ink); border-color: var(--ink); }
.doc-back svg { width: 15px; height: 15px; }
.seg { position: relative; justify-self: center; display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; background: var(--ink); border-radius: 999px; z-index: 0; pointer-events: none; transition: left 0.34s cubic-bezier(0.4, 0.85, 0.25, 1), width 0.34s cubic-bezier(0.4, 0.85, 0.25, 1); }
.seg a { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--ink-2); padding: 0.55em 1.1em; border-radius: 999px; white-space: nowrap; transition: color 0.22s ease; }
.seg a:hover { color: var(--ink); }
.seg a.is-active { background: var(--ink); color: #fff; }   /* no-JS fallback fill */
.seg.is-live a.is-active { background: transparent; }        /* JS: the sliding thumb is the fill */
@media (max-width: 620px) {
  .doc-topbar-inner { grid-template-columns: auto 1fr; height: auto; padding: 12px 0; gap: 10px; }
  .doc-back span { display: none; }
  .doc-back { padding: 0.6em; justify-self: start; }
  .seg { justify-self: end; }
  .seg a { padding: 0.5em 0.85em; font-size: 0.85rem; }
}

/* =========================================================
   Popover (Get / Contact) — centred modal card
   ========================================================= */
/* Desktop only (JS adds this off touch devices). Locking the scroller keeps its
   position by itself — the old position:fixed + offset trick replayed that offset
   whenever the dialog's contents changed, snapping the page to the top and back.
   Phones are deliberately left scrollable: a locked page makes iOS slide its
   toolbars back in. There the overlay swallows the touches instead. */
html.pop-open { overflow: hidden; }
.pop { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s; }
.pop.show { opacity: 1; visibility: visible; }
.pop-backdrop { position: absolute; inset: 0; background: rgba(16, 20, 32, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); touch-action: none; }
.pop-card { position: relative; z-index: 1; width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; background: var(--white); border-radius: var(--r-lg); box-shadow: 0 40px 90px -30px rgba(16, 20, 32, 0.55); padding: clamp(28px, 4vw, 44px); transform: translateY(14px) scale(0.98); transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); text-align: center; }
.pop.show .pop-card { transform: none; }
.pop-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--card); color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background 0.15s ease, transform 0.15s ease; }
.pop-close:hover { background: var(--card-2); transform: rotate(90deg); }

/* Get popover — content centred so top/bottom breathing room stays even */
.pop--get .pop-card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pop-logo { width: min(207px, 55.8%); margin: 10px auto 22px; }
.pop-card h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -0.02em; }
.pop-lead { color: var(--ink-2); margin: 12px auto 0; max-width: 34ch; font-size: 1.02rem; }
.pop-card .badges { justify-content: center; gap: 12px; }
.pop-card .badge img { height: 50px; }
.pop-hint { font-size: 0.85rem; color: var(--muted); margin-top: 18px; }

/* Contact popover — form, all business */
.pop--contact .pop-card { text-align: left; }
.pop-head { text-align: center; margin-bottom: 22px; }
.pop-head h2 { text-align: center; }
.pop-head p { color: var(--muted); margin: 8px auto 0; font-size: 0.98rem; max-width: 32ch; }
.pop-form .field { display: grid; gap: 6px; margin-bottom: 14px; }
.pop-form label { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.pop-form input, .pop-form textarea { font-family: var(--font-body); font-size: 0.98rem; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 0.8em 0.95em; transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
.pop-form input:focus, .pop-form textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.pop-form textarea { resize: vertical; min-height: 110px; }
.pop-check { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 16px; font-size: 0.9rem; color: var(--ink-2); cursor: pointer; }
.pop-check input {
  -webkit-appearance: none; appearance: none;
  flex: 0 0 auto; width: 22px; height: 22px; margin: 1px 0 0; padding: 0;
  border: 2px solid var(--line); border-radius: 7px; background: #fff;
  cursor: pointer; position: relative;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.pop-check input:hover { border-color: var(--accent); }
.pop-check input:checked { background: var(--accent); border-color: var(--accent); }
.pop-check input:checked::after {
  content: ""; position: absolute; left: 6.5px; top: 2.5px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.pop-check input:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.pop-check a { color: var(--accent-deep); font-weight: 700; }
.pop-form .btn { width: 100%; }
/* honeypot — present in the DOM for bots, but zero-sized and untouchable so it can
   never take focus or drag the viewport sideways */
.pop-hp { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

/* sent confirmation — replaces the form outright, dressed like the Get popover */
.pop--contact .pop-card.is-done { text-align: center; }
.pop-done { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.pop-done .pop-lead { margin-bottom: 0; }
.pop-status { font-size: 0.9rem; font-weight: 600; text-align: center; margin: 14px 0 0; color: #1f7a4d; }
.pop-status.is-bad { color: var(--danger); }
.pop-mail { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 14px; margin-bottom: 0; }
.pop-mail a { color: var(--accent-deep); font-weight: 700; }

/* =========================================================
   Scroll reveal
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none; } .seg-thumb { transition: none; } }

/* =========================================================
   Interior pages (legal + contact)
   ========================================================= */
.page-hero { padding: clamp(48px, 8vw, 96px) 0 clamp(20px, 3vw, 34px); text-align: center; }
.page-hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.4rem); letter-spacing: -0.04em; }
.page-hero p { color: var(--muted); max-width: 52ch; margin: 0.9em auto 0; font-size: 1.1rem; }
.page-hero .updated { display: inline-block; margin-top: 18px; font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); padding: 0.45em 1em; border-radius: 999px; }

.legal { padding: clamp(20px, 4vw, 44px) 0 clamp(56px, 9vw, 110px); }
.legal-layout { display: block; }

/* full container width, like the cards on the home page */
.legal-body { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(26px, 4vw, 64px); }
/* keep the reading measure sane even though the card is wide */
.legal-body p, .legal-body ul { max-width: 92ch; }
.legal-body h2 { font-size: clamp(1.2rem, 2.4vw, 1.55rem); margin: 2em 0 0.6em; scroll-margin-top: 100px; display: flex; gap: 0.5em; align-items: baseline; letter-spacing: -0.02em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body h2 .num { color: inherit; font-size: 0.9em; font-weight: 700; }   /* plain document numbering — no accent colour */
.legal-body h3 { font-size: 1.02rem; font-weight: 700; margin: 1.7em 0 0.5em; letter-spacing: -0.01em; }
/* unfilled [[PLACEHOLDER]] tokens - deliberately hard to miss */
.legal-body .todo { background: #ffe9a8; color: #7a5200; font-weight: 700; padding: 0.1em 0.35em; border-radius: 5px; }
.legal-body h3 + p, .legal-body h3 + ul { margin-top: 0; }
.legal-body p { color: var(--ink-2); margin: 0 0 1em; }
.legal-body ul { color: var(--ink-2); margin: 0 0 1em; padding-left: 1.25em; display: grid; gap: 0.4em; }
.legal-body strong { color: var(--ink); }
.legal-body a { color: var(--ink); font-weight: 700; }
.legal-contact { margin-top: 2em; padding: 24px 26px; background: var(--card); border-radius: var(--r); border: 1px solid var(--line); }
.legal-contact strong { display: block; font-family: var(--font-display); color: var(--ink); margin-bottom: 10px; }
.legal-contact p { margin: 0; color: var(--ink-2); }
.legal-contact .company { color: var(--ink); font-weight: 700; }
.legal-contact .address { margin-top: 2px; }
.legal-contact .mail-btn { display: inline-block; margin-top: 16px; background: var(--ink); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; padding: 0.72em 1.25em; border-radius: 999px; transition: transform 0.18s ease, background 0.18s ease; }
.legal-contact .mail-btn:hover { background: #000; transform: translateY(-2px); box-shadow: var(--shadow); }
