/* Reset, canvas, app frame and the primitives every screen leans on. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
    "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

[hidden] { display: none !important; }

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  margin: 0;
}

svg {
  display: block;
}

img {
  max-width: 100%;
  outline: 1px solid rgba(66, 38, 58, 0.1);
  outline-offset: -1px;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

::selection {
  background: var(--accent-soft);
}

/* Ambient canvas -------------------------------------------------------
   Quiet colour areas of different temperature and brightness. They are not
   decoration for its own sake: a lens with nothing behind it has nothing to
   bend, so the composition deliberately runs a cool-to-warm boundary straight
   through the places the floating islands sit. Fixed and pointer-events free,
   so they never repaint while the page scrolls. */
.canvas-fields {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: var(--z-canvas);
  pointer-events: none;
  background:
    /* cool lilac sweeping down the left gutter, under the desktop island */
    radial-gradient(52% 48% at 2% 12%, rgba(var(--field-lilac) / 0.78) 0%, rgba(var(--field-lilac) / 0) 70%),
    /* warm sand filling the lower right, the opposite temperature */
    radial-gradient(62% 58% at 92% 94%, rgba(var(--field-sand) / 0.92) 0%, rgba(var(--field-sand) / 0) 72%),
    /* a dimmer rose high on the right */
    radial-gradient(46% 40% at 98% 4%, rgba(var(--field-rose) / 0.42) 0%, rgba(var(--field-rose) / 0) 74%),
    /* the overall temperature split, low enough never to read as a ramp */
    linear-gradient(102deg, rgba(var(--field-lilac) / 0.3) 0%, rgba(var(--field-lilac) / 0) 46%,
      rgba(var(--field-sand) / 0.24) 100%);
}

/* One defined shape with a soft but readable edge, placed exactly where the
   floating island sits. Without something like this the rim has nothing to
   bend and the material collapses back into a white card. */
.canvas-fields::after {
  content: "";
  position: absolute;
  left: -6vw;
  top: 37vh;
  width: min(46vw, 320px);
  height: 40vh;
  border-radius: 46% 54% 52% 48% / 44% 42% 58% 56%;
  background: radial-gradient(
    closest-side,
    rgba(var(--field-rose) / 0.6) 0%,
    rgba(var(--field-rose) / 0.52) 40%,
    rgba(var(--field-rose) / 0.16) 78%,
    rgba(var(--field-rose) / 0) 100%
  );
}

/* A cooler shape overlapping the first, so the island always straddles a
   boundary between two temperatures instead of floating on one flat tone. */
.canvas-fields::before {
  content: "";
  position: absolute;
  left: -2vw;
  top: 3vh;
  width: min(56vw, 400px);
  height: 42vh;
  border-radius: 52% 48% 44% 56% / 56% 46% 54% 44%;
  background: radial-gradient(
    closest-side,
    rgba(var(--field-lilac) / 0.62) 0%,
    rgba(var(--field-lilac) / 0.44) 46%,
    rgba(var(--field-lilac) / 0) 100%
  );
}

/* From tablet up the island is a column on the left, so both shapes are
   anchored to it: the rose crosses its middle, the lilac crosses its top. */
@media (min-width: 768px) {
  .canvas-fields::after {
    left: calc(var(--dock-left) - 122px);
    top: 34vh;
    width: 300px;
    height: 42vh;
  }

  .canvas-fields::before {
    left: calc(var(--dock-left) - 76px);
    top: 4vh;
    width: 360px;
    height: 44vh;
  }
}

/* The phone puts its island at the bottom, so the warm area moves there and a
   cool one sits just above it: the tab bar always straddles a boundary. */
@media (max-width: 767px) {
  .canvas-fields {
    background:
      radial-gradient(78% 26% at 24% 102%, rgba(var(--field-sand) / 0.95) 0%, rgba(var(--field-sand) / 0) 72%),
      radial-gradient(64% 22% at 92% 86%, rgba(var(--field-rose) / 0.62) 0%, rgba(var(--field-rose) / 0) 74%),
      radial-gradient(80% 38% at 6% 4%, rgba(var(--field-lilac) / 0.72) 0%, rgba(var(--field-lilac) / 0) 72%),
      radial-gradient(60% 24% at 98% 20%, rgba(var(--field-rose) / 0.34) 0%, rgba(var(--field-rose) / 0) 78%),
      linear-gradient(184deg, rgba(var(--field-lilac) / 0.24) 0%, rgba(var(--field-lilac) / 0) 44%,
        rgba(var(--field-sand) / 0.3) 100%);
  }

  .canvas-fields::after {
    left: -12vw;
    top: auto;
    bottom: -2vh;
    width: 72vw;
    height: 22vh;
  }

  .canvas-fields::before {
    left: 46vw;
    top: auto;
    bottom: 4vh;
    width: 64vw;
    height: 17vh;
  }
}

/* Frame ---------------------------------------------------------------- */
.shell {
  position: relative;
  z-index: var(--z-content);
  min-height: 100dvh;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

.stage {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--tg-top) + var(--safe-t) + 18px) var(--s5)
    calc(128px + var(--safe-b) + var(--tg-bottom));
}

.stage:focus {
  outline: none;
}

@media (min-width: 768px) {
  .stage {
    padding-left: calc(var(--dock-w-compact) + 40px);
    padding-right: var(--s6);
    padding-bottom: 80px;
    max-width: var(--stage-max);
  }
}

@media (min-width: 1024px) {
  .stage {
    padding-left: calc(var(--dock-w) + 56px);
    padding-right: var(--s7);
    max-width: var(--stage-max);
  }
}

.skip-link {
  position: fixed;
  top: -60px;
  left: var(--s4);
  z-index: var(--z-skip);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-float);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  top: calc(var(--tg-top) + 12px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Typography ----------------------------------------------------------- */
.screen-kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.screen-title {
  font-size: clamp(25px, 4.6vw, 32px);
  font-weight: 680;
  letter-spacing: -0.022em;
  line-height: 1.14;
  text-wrap: balance;
}

.section-title {
  font-size: 13px;
  font-weight: 640;
  letter-spacing: 0.005em;
  color: var(--ink-2);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Screen transition ---------------------------------------------------- */
.screen {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  animation: screen-in var(--dur) var(--ease-out) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Skeletons: shaped like the content they stand in for, never a spinner. */
.sk {
  border-radius: var(--r-row);
  background: linear-gradient(
    100deg,
    var(--surface-sunken) 0%,
    rgba(255, 253, 253, 0.9) 40%,
    var(--surface-sunken) 80%
  );
  background-size: 240% 100%;
  animation: sk-slide 1.35s var(--ease-out) infinite;
}

@keyframes sk-slide {
  from { background-position: 130% 0; }
  to { background-position: -60% 0; }
}

.sk-title { height: 30px; width: 58%; }
.sk-line { height: 14px; width: 40%; }
.sk-row { height: 62px; }
.sk-card { height: 128px; border-radius: var(--r-card); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .screen { animation: none; }

  .sk {
    animation: none;
    background: var(--surface-sunken);
  }
}
