/* site.css — shared design system for the Faint static site.
 *
 * Loaded by index.html (landing), privacy.html, and terms.html. Holds the
 * tokens, base reset, nav, footer, theme-toggle, and the shared dark-theme +
 * responsive rules that are identical across every page. Page-specific styles
 * (hero, tasting cards, CTA, .legal content, …) stay in each page's inline
 * <style>. The theme-toggle behaviour lives in theme.js.
 *
 * Theming is custom (not Material): light is the :root default; dark is applied
 * via a @media (prefers-color-scheme: dark) block AND a mirrored
 * :root[data-theme="dark"] block so the JS toggle can force a mode. Add new
 * shared colors here as variables with both light and dark values.
 */

:root {
  --bg: #ECE9E3;
  --surface: #F4F1EC;
  --ink: #141414;
  --muted: rgba(20,20,20,0.55);
  --line: rgba(20,20,20,0.18);
  --hairline: rgba(20,20,20,0.10);
  --accent: #B23A2A;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Stop mobile browsers (notably Chrome/WebKit on Android) from auto-inflating
     text in narrow containers — "font boosting" enlarged the fixed-size tasting
     card text past the card box and clipped the bottom notes. 100% (not "none")
     keeps user pinch-zoom working. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
a { color: inherit; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; }
.eyebrow { font-size: 11px; color: var(--muted); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* ── NAV ───────────────────────────────────────── */
nav.top {
  padding: 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  letter-spacing: -0.04em;
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; bottom: -2px; right: -2px;
  width: 6px; height: 6px; background: var(--accent);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── FOOTER ────────────────────────────────────── */
footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase;
}
footer a { text-decoration: none; color: var(--muted); }
.footer-links { display: flex; gap: 24px; }

/* ── Theme toggle button ─────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer; padding: 0;
  color: var(--ink);
  transition: background 150ms, border-color 150ms;
  justify-content: center;
}
.theme-toggle:hover { background: rgba(20,20,20,0.04); }
:root[data-theme="dark"] .theme-toggle:hover { background: rgba(240,237,231,0.06); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle:hover { background: rgba(240,237,231,0.06); }
}

/* ── Language toggle (EN/ES) ──────────────────────
 * Sits next to the theme toggle and borrows .theme-toggle's pill, but holds a
 * 2-letter code instead of an icon, so it grows to fit. Behaviour: i18n.js.
 */
.nav-toggles { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  width: auto; min-width: 36px; padding: 0 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
}

/* ── Responsive (shared nav + footer) ───────────── */
@media (max-width: 880px) {
  .container { padding: 0 20px; }
  footer { padding: 28px 20px; }
  /* Keep the theme toggle reachable; drop only the text nav links */
  nav.top .nav-links a { display: none; }
}
@media (max-width: 480px) {
  /* Keep the copyright and links on one row: shrink the monospace label just
     enough that the whole footer fits a 320px viewport (≈12px to spare), and
     keep each block on its own line (no mid-text wrap). flex-wrap is a safety
     net — if a wider emoji render ever overflows, the links drop to a second
     row instead of forcing a horizontal scroll. */
  footer { font-size: 8.5px; letter-spacing: 0.06em; flex-wrap: wrap; gap: 12px; }
  .footer-copy, .footer-links { white-space: nowrap; }
  .footer-links { gap: 10px; }
}

/* ── DARK THEME ─────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0C;
    --surface: #1A1A1C;
    --ink: #F0EDE7;
    --muted: rgba(240,237,231,0.55);
    --line: rgba(240,237,231,0.18);
    --hairline: rgba(240,237,231,0.10);
    /* --accent stays the same */
  }
  html, body { background: var(--bg); color: var(--ink); }
  /* invert the brand-mark dot so the "F" is still readable on dark */
  .brand-mark { background: var(--ink); color: var(--bg); }
}

/* ── DARK THEME (manual override) ─────────────────
 * Mirrors the @media block above so a data-theme="dark" attribute on <html>
 * forces dark regardless of system preference.
 */
:root[data-theme="dark"] {
  --bg: #0B0B0C;
  --surface: #1A1A1C;
  --ink: #F0EDE7;
  --muted: rgba(240,237,231,0.55);
  --line: rgba(240,237,231,0.18);
  --hairline: rgba(240,237,231,0.10);
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] .brand-mark { background: var(--ink); color: var(--bg); }

/* Manual LIGHT mode forces back to light values even if OS is dark. */
:root[data-theme="light"] {
  --bg: #ECE9E3;
  --surface: #F4F1EC;
  --ink: #141414;
  --muted: rgba(20,20,20,0.55);
  --line: rgba(20,20,20,0.18);
  --hairline: rgba(20,20,20,0.10);
}
