/* Tideraising base: reset, font faces, shared classes, motion, focus and reduced motion.
   Ported from the global CSS of claude/canvas/Main.dc.html with tokens substituted.
   Section-specific rules live in the section files, not here. */

/* 1. Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

button,
input {
  font: inherit;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--navy);
}

/* 2. Fonts: self-hosted, with metric-matched fallbacks so the swap causes no layout shift.
   Fallback metrics are per weight and tuned to the optical size each weight is used at: body text around 18px,
   bold labels around 18px, and 800-weight headings around 60px, where Bricolage's opsz axis narrows the glyphs. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("/assets/fonts/dm-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("/assets/fonts/dm-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  font-weight: 400 500;
  size-adjust: 106.49%;
  ascent-override: 87.33%;
  descent-override: 25.35%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback";
  src: local("Arial Bold"), local("Helvetica Bold"), local("Liberation Sans Bold");
  font-weight: 600 700;
  size-adjust: 102.26%;
  ascent-override: 90.94%;
  descent-override: 26.4%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback";
  src: local("Arial Bold"), local("Helvetica Bold"), local("Liberation Sans Bold");
  font-weight: 800;
  size-adjust: 98.29%;
  ascent-override: 94.62%;
  descent-override: 27.47%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Caveat Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  font-weight: 600;
  size-adjust: 77.21%;
  ascent-override: 124.34%;
  descent-override: 38.86%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "DM Mono Fallback";
  src: local("Courier New"), local("Liberation Mono");
  font-weight: 400 500;
  size-adjust: 99.98%;
  ascent-override: 99.22%;
  descent-override: 31.01%;
  line-gap-override: 0%;
}

/* 3. Shared classes */
.sprite {
  position: absolute;
  overflow: hidden;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  margin: 0;
}

.hand {
  font-family: var(--font-hand);
  font-weight: 600;
}

/* Section heading, the same on the canvas in every section but the hero and the footer */
.section-title {
  margin: 0;
  font-size: var(--text-h2);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}

.grid-paper {
  background-image:
    linear-gradient(var(--grid-line-paper) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-paper) 1px, transparent 1px);
  background-size: var(--grid-minor) var(--grid-minor);
}

.grid-blue {
  --focus-ring: var(--white);
  background-image:
    linear-gradient(var(--grid-line-navy) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-navy) 1px, transparent 1px),
    linear-gradient(var(--grid-line-navy-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-navy-minor) 1px, transparent 1px);
  background-size:
    var(--grid-major) var(--grid-major),
    var(--grid-major) var(--grid-major),
    var(--grid-minor) var(--grid-minor),
    var(--grid-minor) var(--grid-minor);
}

.btn {
  --btn-shadow: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: var(--border);
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--btn-shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--btn-shadow);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--btn-shadow);
}

.btn--primary,
.btn--primary:hover {
  background: var(--sunflower);
  color: var(--ink);
}

.btn--secondary,
.btn--secondary:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn--ghost,
.btn--ghost:hover {
  --btn-shadow: var(--navy-shadow);
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.nav-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 6px;
}

.paper-edge {
  filter: var(--shadow-edge);
}

.paper-lift {
  filter: var(--shadow-lift);
}

/* Hidden on phones (canvas: clouds in the hero, the hand note in Fig. 02) */
@media (max-width: 760px) {
  .hide-sm {
    display: none !important;
  }
}

/* 4. Motion */
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2.5deg);
  }
  50% {
    transform: translateY(-9px) rotate(2.5deg);
  }
}

@keyframes sway {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-28px);
  }
}

@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(36px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.bob {
  animation: bob var(--dur-bob) ease-in-out infinite;
  transform-origin: 50% 85%;
}

.sway {
  animation: sway var(--dur-sway) ease-in-out infinite;
}

.drift {
  animation: drift var(--dur-drift) ease-in-out infinite alternate;
}

.spin {
  animation: spin var(--dur-spin) linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 5. Focus */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* 6. Reduced motion: keep last */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
