/* Worren site: what every page shares — tokens, the header, the footer, buttons and the cursor.
   Tokens mirror packages/design-system-web/src/tokens.css (the Swift palette): DM Sans, square
   corners, primary #F15734, secondary #FFB300. Sizes come from the Paper frame at 1280 wide.
   The landing page adds home.css; the other pages add site.css. */
:root {
  color-scheme: light;
  --primary-50: #FDEBE7; --primary-400: #F15734; --primary-500: #D7340F; --primary-600: #A7280C;
  --primary-800: #481105; --primary-900: #180602;
  --secondary-200: #FFE199; --secondary-400: #FFC233; --secondary-500: #FFB300; --secondary-800: #664800; --secondary-900: #332400;
  --n000: #FFFFFF; --n902: #F5F5F5; --n200: #E5E5E5; --n300: #CCCCCC; --n400: #898989; --n500: #5C5C5C;
  --n600: #454545; --n700: #2E2E2E; --n800: #171717; --n900: #000000;
  --info-700: #0252CB;
  --danger: #D61212; --danger-bg: #FDECEC; --success: #2B7D24; --success-bg: #EBFFEB;

  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 3.7vw, 48px);
  --tile: clamp(64px, 10vw, 128px);          /* an app tile in the orbit and on its journey */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-x: none; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--n902); color: var(--n800); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── CURSOR: square cells on a grid (drawn by trail.js); the newest cell is the cursor. Over text it
   eases into a slim, tall bar; a click squeezes it. Over a button or a link the cursor goes into it
   and the element lights up (see BUTTONS); fields show the system cursor. ── */
.trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
@media (hover: hover) and (pointer: fine) {
  html.trail-on, html.trail-on body { cursor: none; }
  html.trail-on.intro, html.trail-on.intro body { cursor: auto; } /* the intro covers the cursor */
  html.trail-on :is(input, textarea) { cursor: text; }
  html.trail-on select { cursor: pointer; }
  html.trail-on :is(a, button, label, summary, .pick, .btn) { cursor: none; }
}

/* ── PICK: the dashed "selected" box with corner handles ── */
.pick {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  font-size: 15px; line-height: 1.2; color: var(--primary-500); background: var(--primary-50);
  border: 1px dashed var(--primary-400); white-space: nowrap; transition: background .15s steps(2), color .15s steps(2);
}
.pick i { position: absolute; width: 7px; height: 7px; background: var(--n000); border: 1px solid var(--primary-400); transition: transform .2s steps(2), background .15s steps(2); }
.pick i:nth-of-type(1) { left: -4px; top: -4px; }
.pick i:nth-of-type(2) { right: -4px; top: -4px; }
.pick i:nth-of-type(3) { left: -4px; bottom: -4px; }
.pick i:nth-of-type(4) { right: -4px; bottom: -4px; }
.pick:hover { background: var(--primary-400); color: var(--n000); border-style: solid; }
.pick:hover i { transform: scale(1.45); }

/* ── HEADER: fixed, close to the top ── */
.bar {
  position: fixed; z-index: 50; top: clamp(10px, 1.6vw, 20px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: min(1082px, calc(100% - 2 * var(--gutter))); height: 76px; padding: 0 26px 0 24px; background: var(--secondary-400);
}
html.intro .bar { visibility: hidden; }
.bar-logo svg { width: 40px; height: 40px; fill: var(--primary-400); }
.bar-logo:hover svg { animation: jolt .4s steps(3) 1; }
@keyframes jolt { 33% { transform: translate(2px, -2px); } 66% { transform: translate(-2px, 1px); } }
.bar-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; font-size: 16px; color: var(--secondary-900); }
.bar-links a { padding: 6px 8px; transition: background .15s steps(2); }
.bar-links a:hover, .bar-links a[aria-current="page"] { background: var(--primary-400); }
@media (max-width: 820px) { .bar-links { display: none; } .bar { height: 64px; padding: 0 18px 0 16px; } .bar-logo svg { width: 32px; height: 32px; } }

/* ── TYPE ── */
.h2 { font-weight: 400; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.26; letter-spacing: -0.035em; color: var(--n900); }
.sub { font-size: 16px; line-height: 20px; color: var(--n500); }

/* ── BUTTONS ──
   Primary (.pick, .btn, the intro skip): the cursor goes in, the box fills red, a press nudges it.
   Tertiary (every text link): the cursor goes in and the link takes the nav's red highlight.
   External links highlight blue and get a pixel arrow in the top right. ── */
.pick:active, .btn:active, .intro-skip:active { transform: translateY(1px); }
.bar-links a, .foot-links a, .prose a, .faq a, .support-facts a, .eyebrow a, .foot-about a, .btn-link {
  transition: background .15s steps(2), color .15s steps(2), border-color .15s steps(2);
}
.foot-links a, .prose a, .faq a, .support-facts a, .eyebrow a, .foot-about a { padding: 1px 4px; margin: -1px -4px; }
.bar-links a:hover, .foot-links a:hover, .prose a:hover, .faq a:hover, .support-facts a:hover, .eyebrow a:hover, .foot-about a:hover {
  background: var(--primary-400); color: var(--n900); border-color: var(--primary-400);
}
a[href^="http"]:not([href*="worren.world"]) { position: relative; padding-right: 16px; }
a[href^="http"]:not([href*="worren.world"]):is(:hover, :focus-visible) { background: var(--info-700) !important; color: var(--n000) !important; border-color: var(--info-700) !important; }
a[href^="http"]:not([href*="worren.world"])::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; opacity: 0; transition: opacity .15s steps(2);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M2 0h6v6H6V3H5v1H4v1H3v1H2v1H1V6h1V5h1V4h1V3h1V2H2z'/%3E%3C/svg%3E") center / 8px 8px no-repeat;
  image-rendering: pixelated;
}
a[href^="http"]:not([href*="worren.world"]):is(:hover, :focus-visible)::after { opacity: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; font: 500 15px/18px var(--font); border: 0; cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-inverse { background: var(--n900); color: var(--n000); }
.btn-inverse:hover { background: var(--primary-400); color: var(--n000); }
:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 3px; }

/* ── FOOTER ── */
.foot { position: relative; isolation: isolate; background: var(--secondary-500); color: var(--n900); padding: clamp(56px, 9vw, 112px) clamp(20px, 6.6vw, 85px) 0; overflow: clip; }
/* a sketchbook: the cursor's cells stay here (trail.js), under the footer's content; a click wipes them */
.sketch { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.foot-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.foot-title { font-size: clamp(26px, 2.7vw, 34px); line-height: 1.2; letter-spacing: -.025em; margin-bottom: 18px; }
.foot-cta .pick { font-size: 14px; min-height: 38px; padding: 7px 11px; }
.foot-links { display: flex; gap: 24px; font-size: 17px; }
.foot-base { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: clamp(64px, 7vw, 90px); }
.foot-logo { width: clamp(56px, 6.3vw, 80px); height: auto; fill: var(--primary-400); margin-bottom: -1px; }
/* the logo come alive: the character in the grass (footer-worren.js); the logo keeps its place */
.foot-worren { position: absolute; left: 0; bottom: 0; width: 100%; z-index: -1; pointer-events: none; }
.foot-base span { padding-bottom: 12px; font-size: clamp(16px, 1.6vw, 20px); color: var(--secondary-800); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
.foot-about { max-width: 46em; margin-top: clamp(32px, 4vw, 48px); font-size: 15px; color: var(--secondary-800); }
