﻿/* ============================================================
   base.css — reset, typography, layout utilities
   CloudSaveCircuit — Tactile Neo-Skeuomorphic
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle paper texture via layered soft gradients on the ground */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 12% -8%, rgba(183,120,42,0.06), transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, rgba(47,125,92,0.05), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(183,120,42,0.04), transparent 60%);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  margin: 0 0 0.5em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-snug); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }
h4 { font-size: 1.15rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; height: auto; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.35em; }

:focus-visible {
  outline: var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  z-index: 200;
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Layout utilities ---------- */
.page-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 4vw;
}
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-tight { padding: clamp(36px, 5vw, 64px) 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: var(--track-cap);
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.lead {
  font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 62ch;
}

.prose { max-width: 68ch; color: var(--text); }
.prose p { margin-bottom: 1em; }
.prose a { text-decoration: underline; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.center { text-align: center; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Visually hidden ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
