@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Nunito:wght@500;600;700;800&display=swap');

/* ============================================================
   Design tokens — verbatim from web/app/globals.css §A.4
   (D8.2 sunshine-yellow rebrand)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-page:           #FFEC8A;
  --bg-page-soft:      #FFF3B0;
  --bg-elevated:       #FFFCF1;
  --bg-cream:          #FFF6D6;
  --bg-code:           #2A1F18;
  --bg-subtle:         #FFE873;

  /* Text */
  --text-primary:    #3A1F0F;
  --text-secondary:  #6B452C;
  --text-tertiary:   #9B7758;
  --text-on-dark:    #FFF6D6;
  --text-on-green:   #FFFCF1;
  --text-on-eucalyptus: var(--text-on-green);

  /* Accent (eucalyptus / dollar green) */
  --accent:          #2F8253;
  --accent-hover:    #225F3D;
  --accent-subtle:   #C7E4D2;

  /* Brand */
  --gold:            #F4B33A;
  --gold-deep:       #C68A2F;

  /* Status */
  --danger:    #D44A3F;
  --warning:   #E8A33C;
  --success:   #2F8253;

  /* Borders (cocoa outline) */
  --border:        #3A1F0F;
  --border-soft:   rgba(58, 31, 15, 0.18);
  --border-strong: #3A1F0F;

  /* Spacing scale (4 px base unit) */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  48px;

  /* Radii (chunky / playful) */
  --radius-sm:   8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-pill: 999px;

  /* Typography */
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-ui:      "Nunito", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --font-mark:    "Fredoka", system-ui, sans-serif;
}

/* ============================================================
   Base reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 600;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   Typography
   ============================================================ */
h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 8px;
}
h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 40px 0 16px;
}
h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
}
p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }

/* ============================================================
   Wordmark
   ============================================================ */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mark);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
  text-decoration: none !important;
}
.wordmark:hover { text-decoration: none !important; }
.wordmark__mascot {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

/* ============================================================
   Buttons (chunky border + offset shadow — matches globals.css)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 2px solid var(--border);
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease, background 120ms ease;
}
.btn:active { transform: translateY(2px); }

.btn--primary {
  background: var(--accent);
  color: var(--text-on-green);
  box-shadow: 0 3px 0 0 var(--border);
}
.btn--primary:hover  { background: var(--accent-hover); }
.btn--primary:active { box-shadow: 0 1px 0 0 var(--border); }

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 3px 0 0 var(--border);
}
.btn--secondary:hover  { background: var(--bg-cream); }
.btn--secondary:active { box-shadow: 0 1px 0 0 var(--border); }

/* ============================================================
   Shared signed-in header
   (replaces HEADER_CSS from src/web/header.ts)
   ============================================================ */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--text-on-green); padding: 8px 16px;
  font-size: 14px; border-radius: 0 0 4px 4px;
  font-family: var(--font-ui); font-weight: 600;
}
.skip-link:focus { left: 0; }

.site-header {
  border-bottom: 2px solid var(--border);
  background: var(--bg-elevated);
  padding: 0 24px;
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-email {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  font-family: var(--font-ui);
}
.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}
.header-nav a:hover { text-decoration: underline; }
.header-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.header-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}
/* quokkafi-4b9.81: WCAG AA contrast fix.
   Previously --text-tertiary (#9B7758) on --bg-elevated (#FFFCF1) = 3.95:1
   (fails AA 4.5:1 for normal text). Now --text-secondary (#6B452C) = 7.01:1
   on bg-page and 8.14:1 on bg-elevated — passes AA. */
.nav-link--signout {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}
.nav-link--signout:hover { color: var(--text-primary) !important; }

/* ============================================================
   Utility
   ============================================================ */
.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;
}

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