/* ══════════════════════════════════════════════════════════════
   KUDOS — Design Tokens & Base
   Warm editorial system. Ivory paper, deep ink, terracotta accent.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette: warm neutrals (the paper) ───────────────────── */
  --paper:        #FAF6EF;
  --paper-2:      #F3EDE3;
  --paper-3:      #EBE3D6;
  --surface:      #FFFDF9;
  --surface-sunk: #F6F1E8;

  /* ── Ink (the type) ───────────────────────────────────────── */
  --ink:          #1C1815;
  --ink-2:        #4A423B;
  --ink-3:        #7A6F65;
  --ink-4:        #A79B8E;

  /* ── Accents ──────────────────────────────────────────────── */
  --clay:         #BF5B3C;   /* primary — terracotta */
  --clay-deep:    #9B4529;
  --clay-soft:    #F4E2DA;
  --amber:        #C98A2B;
  --amber-soft:   #F7EBD5;
  --olive:        #6B7B52;
  --olive-soft:   #E8EDE0;
  --plum:         #7A4E63;
  --plum-soft:    #F0E5EA;
  --teal:         #3F6F70;
  --teal-soft:    #DFEBEA;

  /* ── Lines & shadows ──────────────────────────────────────── */
  --rule:         rgba(28, 24, 21, 0.09);
  --rule-strong:  rgba(28, 24, 21, 0.16);

  --shadow-xs:    0 1px 2px rgba(60, 45, 30, .05);
  --shadow-sm:    0 2px 6px rgba(60, 45, 30, .06), 0 1px 2px rgba(60,45,30,.04);
  --shadow-md:    0 8px 24px -8px rgba(60, 45, 30, .14), 0 2px 6px rgba(60,45,30,.05);
  --shadow-lg:    0 24px 56px -20px rgba(60, 45, 30, .22), 0 4px 12px rgba(60,45,30,.06);
  --shadow-glow:  0 8px 28px -10px rgba(191, 91, 60, .45);

  /* ── Type ─────────────────────────────────────────────────── */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  /* Wall posts only. Geometric sans — modern and friendly, and a clean
     contrast against the Fraunces used for headings. */
  --font-quote:   "Poppins", "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Fluid display sizes */
  --t-hero:   clamp(2.6rem, 1.4rem + 4.2vw, 5.2rem);
  --t-h1:     clamp(2rem, 1.3rem + 2.4vw, 3.2rem);
  --t-h2:     clamp(1.5rem, 1.15rem + 1.2vw, 2.1rem);
  --t-h3:     clamp(1.15rem, 1rem + .5vw, 1.4rem);
  --t-body:   1rem;
  --t-sm:     .875rem;
  --t-xs:     .78rem;
  --t-micro:  .69rem;

  /* ── Space & shape ────────────────────────────────────────── */
  --r-sm: 8px;  --r-md: 14px;  --r-lg: 20px;  --r-xl: 28px;  --r-pill: 999px;
  /* Was 1180, which was the old main column almost exactly: 1440 screen
     minus the 252px sidebar. With the sidebar gone, keeping 1180 would have
     centred the same narrow column in a wider window and reclaimed nothing —
     the point of removing the sidebar was the space. Not edge-to-edge: past
     about 1400 the wall of thanks starts reading as a very long line. */
  --page-max: 1360px;

  /* ── Motion ───────────────────────────────────────────────── */
  --ease:      cubic-bezier(.4, 0, .2, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);

  /* ── Gradients ────────────────────────────────────────────── */
  --grad-warm:   linear-gradient(120deg, #BF5B3C 0%, #D4763F 38%, #C98A2B 100%);
  --grad-sunset: linear-gradient(135deg, #9B4529 0%, #BF5B3C 45%, #E0AC53 100%);
  --grad-dusk:   linear-gradient(150deg, #2A1F19 0%, #6B3521 55%, #BF5B3C 100%);
  --grad-jade:   linear-gradient(135deg, #3F6F70 0%, #6B7B52 100%);
  --grad-plum:   linear-gradient(135deg, #7A4E63 0%, #BF5B3C 100%);
  --grad-mesh:
    radial-gradient(38% 46% at 12% 18%, rgba(201,138,43,.28), transparent 62%),
    radial-gradient(42% 50% at 88% 26%, rgba(191,91,60,.26), transparent 64%),
    radial-gradient(46% 44% at 62% 88%, rgba(122,78,99,.18), transparent 66%);
}

/* ══ Dark: warm charcoal, not blue-black ═══════════════════════ */
:root[data-theme="dark"] {
  --paper:        #17140F;
  --paper-2:      #1F1B15;
  --paper-3:      #2A251E;
  --surface:      #221E18;
  --surface-sunk: #1B1712;

  --ink:          #F4EDE2;
  --ink-2:        #CFC4B4;
  --ink-3:        #9C9081;
  --ink-4:        #6E6458;

  --clay:         #E0795A;
  --clay-deep:    #C25E3D;
  --clay-soft:    #3B241C;
  --amber:        #E0AC53;
  --amber-soft:   #3A2D18;
  --olive:        #9DB07E;
  --olive-soft:   #262D1C;
  --plum:         #BE8CA3;
  --plum-soft:    #322330;
  --teal:         #7FB0B0;
  --teal-soft:    #1C2C2C;

  --rule:         rgba(244, 237, 226, 0.11);
  --rule-strong:  rgba(244, 237, 226, 0.2);

  --grad-mesh:
    radial-gradient(38% 46% at 12% 18%, rgba(224,172,83,.16), transparent 62%),
    radial-gradient(42% 50% at 88% 26%, rgba(224,121,90,.15), transparent 64%),
    radial-gradient(46% 44% at 62% 88%, rgba(190,140,163,.12), transparent 66%);

  --shadow-xs:   0 1px 2px rgba(0,0,0,.3);
  --shadow-sm:   0 2px 6px rgba(0,0,0,.34);
  --shadow-md:   0 8px 24px -8px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg:   0 24px 56px -20px rgba(0,0,0,.75), 0 4px 12px rgba(0,0,0,.35);
  --shadow-glow: 0 8px 28px -10px rgba(224, 121, 90, .4);
}

/* ══ Reset & base ══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--clay); color: var(--paper); }

/* Focus — visible, never ugly */
:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 99px;
  border: 3px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ══ Paper grain — the texture that sells "printed" ════════════ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .06; }

#confetti-canvas {
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* ══ Utilities ═════════════════════════════════════════════════ */
/* Every UI.icon() SVG carries .ic. Inline SVGs have no intrinsic size, so
   without a default they stretch to fill their container. Component rules
   like `.btn svg` are more specific and still override this. */
.ic {
  width: 1.05em; height: 1.05em;
  flex: none;
  vertical-align: -0.15em;
  display: inline-block;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.serif   { font-family: var(--font-display); }
.muted   { color: var(--ink-3); }
.center  { text-align: center; }
.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wrap    { flex-wrap: wrap; }
.grow    { flex: 1; }
.gap-1 { gap: .25rem } .gap-2 { gap: .5rem }  .gap-3 { gap: .75rem }
/* Row gap for wrapping field pairs. `gap` on a .row sets both axes, but the
   column gap is tuned for side-by-side fields and is too tight once they
   wrap onto separate lines — which is why Birthday and Joined touched. */
.gap-y { row-gap: 1rem }
.gap-4 { gap: 1rem }   .gap-6 { gap: 1.5rem } .gap-8 { gap: 2rem }

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

/* ══ Motion primitives ═════════════════════════════════════════ */

/* Scroll-reveal. JS adds .is-in when the element enters the viewport. */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px) scale(.985);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Gradient text — used sparingly, on hero words only. */
.grad-text {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-size: 220% 220%;
  animation: grad-shift 9s var(--ease) infinite alternate;
}
@keyframes grad-shift {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

/* Slow drifting aurora, used behind heroes. */
@keyframes aurora {
  0%   { transform: translate3d(0,0,0)    scale(1)    rotate(0deg); }
  50%  { transform: translate3d(3%,-4%,0) scale(1.14) rotate(7deg); }
  100% { transform: translate3d(-2%,3%,0) scale(1.05) rotate(-5deg); }
}
@keyframes float-y {
  from { transform: translateY(0); }
  to   { transform: translateY(-14px); }
}
@keyframes shimmer {
  from { background-position: -180% 0; }
  to   { background-position: 180% 0; }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(191,91,60,.4); }
  70%  { box-shadow: 0 0 0 14px rgba(191,91,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(191,91,60,0); }
}

.blob {
  position: absolute;
  opacity: .15;
  filter: blur(1px);
  animation: float-y 7s var(--ease) infinite alternate;
  pointer-events: none;
}

/* Page-level ambient wash. Sits behind everything, costs nothing. */
.aurora-bg {
  position: fixed; inset: -25%;
  z-index: -1;
  background: var(--grad-mesh);
  filter: blur(40px);
  animation: aurora 34s var(--ease) infinite alternate;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
