/* ==========================================================================
   WeedFree — shared site shell
   Tokens, base typography, nav, footer, buttons. Loaded by every page.
   ========================================================================== */

:root {
  /* Ink + paper */
  --ink: #140B24;
  --ink-2: #2A1C44;
  --ink-3: #5A4A78;
  --paper: #F5F7F6;
  --paper-2: #ECF0EE;
  --white: #FFFFFF;
  --line: #CFDDDD;
  --line-2: #E1E9E7;

  /* Brand */
  --jade: #09A66F;
  --jade-deep: #06744E;
  --jade-ink: #054C34;
  --violet: #943DC7;
  --violet-deep: #5B2185;
  --violet-soft: #EBDDF5;
  --mint: #6DEFB9;
  --mint-soft: #D9FBEC;
  --marker: #F5F247;
  --danger: #E5484D;

  /* Legacy aliases (older page styles reference these) */
  --bg: var(--paper);
  --card: var(--white);
  --card-border: var(--line);
  --primary: var(--violet);
  --secondary: var(--violet-soft);
  --accent: var(--jade);
  --text: var(--ink-2);
  --text-dim: var(--ink-3);
  --text-dark: var(--ink);

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout — 8px grid */
  --nav-h: 72px;
  --nav-height: 72px;
  --w: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 11, 36, 0.04), 0 12px 32px -12px rgba(20, 11, 36, 0.14);
}

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

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

body {
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}

img, svg { display: block; max-width: 100%; }
a { color: var(--jade-deep); text-underline-offset: 3px; }
a:hover { color: var(--jade-ink); }
::selection { background: var(--mint); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}

/* --- Skip link + focus -------------------------------------------------- */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--ink); color: var(--mint);
  padding: 10px 18px; font-weight: 600; font-size: 0.875rem;
  text-decoration: none; z-index: 9999; border-radius: 0 0 12px 12px;
}
.skip-link:focus { top: 0; }

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

/* --- Utilities ----------------------------------------------------------- */
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.6875rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--jade-deep); background: var(--mint-soft);
  border: 1px solid rgba(9, 166, 111, 0.25);
  padding: 4px 10px; border-radius: 6px; line-height: 1.4;
}
.tag--violet { color: var(--violet-deep); background: var(--violet-soft); border-color: rgba(148, 61, 199, 0.25); }
.tag--ink { color: var(--mint); background: rgba(109, 239, 185, 0.12); border-color: rgba(109, 239, 185, 0.3); }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 20px;
}

.hl {
  background: linear-gradient(transparent 58%, rgba(245, 242, 71, 0.75) 58%, rgba(245, 242, 71, 0.75) 92%, transparent 92%);
  padding: 0 0.08em;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem;
  padding: 12px 20px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: var(--ink-2); color: var(--white); box-shadow: 0 8px 20px -8px rgba(20, 11, 36, 0.5); }
.btn--jade { background: var(--jade); color: var(--white); }
.btn--jade:hover { background: var(--jade-deep); color: var(--white); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { padding: 9px 16px; font-size: 0.875rem; }
.btn--mint { background: var(--mint); color: var(--ink); }
.btn--mint:hover { background: #8BF5CA; color: var(--ink); }

/* App Store badge */
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--white); text-decoration: none;
  padding: 12px 22px 12px 18px; border-radius: 14px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .appstore:hover { color: var(--white); transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(109, 239, 185, 0.55), 0 14px 30px -10px rgba(20, 11, 36, 0.5); }
}
.appstore:active { transform: scale(0.97); transition-duration: 120ms; }
.appstore svg { width: 22px; height: 26px; flex: none; }
.appstore__text { display: flex; flex-direction: column; text-align: left; line-height: 1.05; }
.appstore__sub { font-size: 0.66rem; letter-spacing: 0.04em; opacity: 0.8; }
.appstore__main { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.appstore--light { background: var(--white); color: var(--ink); }
.appstore--light:hover { color: var(--ink); }

/* --- Nav ----------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(245, 247, 246, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.site-nav__in {
  max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter); height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem;
  letter-spacing: -0.02em; color: var(--ink);
  font-variation-settings: 'opsz' 48;
}
.brand:hover { color: var(--ink); }
.brand img { width: 32px; height: 32px; }
.brand em { font-style: normal; color: var(--jade); }
.site-nav nav ul { display: flex; gap: 6px; list-style: none; }
.site-nav nav a {
  display: inline-block; padding: 8px 12px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}
.site-nav nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line-2);
  background: var(--paper);
  padding: 56px 0 32px;
  margin-top: auto;
}
.site-footer__grid {
  max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px;
}
.site-footer__brand p {
  margin-top: 14px; max-width: 34ch; font-size: 0.9rem; color: var(--ink-3);
}
.site-footer h4 {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 14px;
}
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer ul a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.site-footer ul a:hover { color: var(--jade-deep); }
.site-footer__bar {
  max-width: var(--w); margin: 40px auto 0; padding: 20px var(--gutter) 0;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.875rem; color: var(--ink-3);
}
.site-footer__bar p { max-width: 70ch; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
  :root { --nav-h: 64px; --nav-height: 64px; }
  .site-nav__in { gap: 12px; }
  .site-nav nav ul { gap: 0; }
  .site-nav nav a { padding: 8px 9px; font-size: 0.85rem; }
  .nav-hide-sm { display: none; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .site-nav .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-nav .brand img { width: 36px; height: 36px; }
}

/* --- Motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  /* Gentler, not gone: short opacity fades stay, transforms and loops go. */
  .reveal, .specimen .v { transition-property: opacity !important; transition-duration: 150ms !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
