/* ==========================================================================
   GoWishy 2026 — fonts, reset, primitives
   ========================================================================== */

/* ---- self-hosted fonts (no network dependency, deterministic rendering) ---- */
@font-face {
  font-family: 'Cal Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/cal-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Cal Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/cal-sans-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('../fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--gw-white);
  color: var(--gw-black);
  font-family: var(--gw-font-body);
  font-size: var(--gw-t-body);
  line-height: var(--gw-lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; border-spacing: 0; }

/* ---- containers: the comp uses exactly three content widths ---- */
.gw-wide,
.gw-narrow,
.gw-mid {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gw-gutter);
}
.gw-wide   { max-width: calc(var(--gw-wide)   + var(--gw-gutter) * 2); }
.gw-mid    { max-width: calc(var(--gw-mid)    + var(--gw-gutter) * 2); }
.gw-narrow { max-width: calc(var(--gw-narrow) + var(--gw-gutter) * 2); }

/* ---- type primitives ---- */
.gw-section-title {          /* Space Grotesk 700 36/50.4 — used by 6 sections */
  font-family: var(--gw-font-head);
  font-weight: 700;
  font-size: var(--gw-t-section);
  line-height: var(--gw-lh-section);
  color: var(--gw-black);
}
.gw-eyebrow {                /* Cal Sans 20/26, gradient ink */
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: var(--gw-t-eyebrow);
  line-height: var(--gw-lh-eyebrow);
}
.gw-grad-text {              /* gradient-filled text, with a solid fallback */
  color: var(--gw-violet);
  background: var(--gw-grad-headline);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* background-clip:text paints only inside the box, so a descender hanging
     below a tight line-height gets sliced off. Extend the box downward and take
     the space straight back so layout is untouched. */
  padding-bottom: 0.24em;
  margin-bottom: -0.24em;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .gw-grad-text { color: var(--gw-violet); -webkit-text-fill-color: currentColor; }
}

/* ---- utilities ---- */
/* a line break the comp specifies, collapsed once the text reflows */
@media (max-width: 820px) { .gw-br-lg { display: none; } }

.gw-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--gw-violet);
  outline-offset: 3px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Flag button icon — the cloth furls at the pole and unfurls on hover
   ========================================================================== */
.gw-flag__cloth {
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0.07);
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
:is(a, button):hover .gw-flag__cloth,
:is(a, button):focus-visible .gw-flag__cloth { transform: scaleX(1); }
/* reduced motion: show the finished icon rather than a permanently furled flag */
@media (prefers-reduced-motion: reduce) {
  .gw-flag__cloth { transform: none; }
}

/* ==========================================================================
   Sphere — a pre-rendered, ray-traced rotating ball played as a sprite film.
   Each frame is a real spherical projection: dimples compress toward the limb,
   the surface is lit with diffuse + specular, and the lattice repeats every
   360/NLON degrees so the film loops seamlessly. A CSS-scrolled texture cannot
   produce any of that, which is why this replaces it.
   ========================================================================== */

.gw-sphere {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.gw-sphere__film {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: calc(var(--sphere-frames, 30) * 100%);
  background-image: var(--sphere-film);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
/* translateX resolves against the film's own width, so -100% over N steps
   advances exactly one frame per step. */
@keyframes gw-sphere-film { to { transform: translateX(-100%); } }
.gw-motion .gw-sphere__film {
  animation: gw-sphere-film var(--sphere-dur, 18s) steps(var(--sphere-frames, 30)) infinite;
}

/* Vertical film. A wide sprite is fine for a small ball, but a big one needs so
   many frames that the strip blows past WebP's 16383px limit and the film
   element becomes tens of thousands of pixels wide. Stacking the frames down a
   column keeps both in comfortable range. */
.gw-sphere--v .gw-sphere__film {
  width: 100%;
  height: calc(var(--sphere-frames, 30) * 100%);
}
@keyframes gw-sphere-film-v { to { transform: translateY(-100%); } }
.gw-motion .gw-sphere--v .gw-sphere__film {
  animation: gw-sphere-film-v var(--sphere-dur, 18s) steps(var(--sphere-frames, 30)) infinite;
  /* A tall film is a large layer, and without this the browser repaints the
     whole thing on every step instead of just moving it — which is what made
     the big globe stutter while the small balls stayed smooth. */
  will-change: transform;
  backface-visibility: hidden;
}

/* ==========================================================================
   Scroll reveals — applied by JS so a no-JS page renders fully composed.
   ========================================================================== */
html { scroll-behavior: smooth; }
:target { scroll-margin-top: 120px; }

.gw-motion .gw-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms var(--gw-ease) var(--reveal-delay, 0ms),
    transform 700ms var(--gw-ease) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.gw-motion .gw-reveal.is-in { opacity: 1; transform: none; }
