/* ==========================================================================
   Option Scheme — shared brand site styles
   --------------------------------------------------------------------------
   Used by every page built on templates/brand_base.html (homepage, sign-in,
   sign-up). Colors come only from brand.css semantic tokens (--color-*).
   Page-specific styles stay in each page's {% block page_styles %}.
   ========================================================================== */

/* ─── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Instrument Sans", ui-sans-serif, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-link-hover); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--coral-200); color: var(--teal-950); }

/* Paper grain — fixed, decorative, never intercepts input */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.27  0 0 0 0 0.15  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html.dark body::before { mix-blend-mode: screen; opacity: .35; }

.wrap { width: min(1180px, 100% - 3rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--color-surface); padding: .5rem 1rem; z-index: 200; }
.skip:focus { left: 1rem; }

/* ─── Type ─────────────────────────────────────────────────────────────── */
.serif { font-family: "Fraunces", Georgia, serif; font-variation-settings: "SOFT" 50, "opsz" 96; }
.mono  { font-family: "IBM Plex Mono", ui-monospace, monospace; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; color: var(--color-heading); font-weight: 500; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(2.9rem, 7.2vw, 5.6rem); line-height: .98; font-variation-settings: "SOFT" 30, "opsz" 144; letter-spacing: -.035em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.04; font-variation-settings: "SOFT" 50, "opsz" 120; }
h3 { font-size: 1.35rem; line-height: 1.2; font-variation-settings: "SOFT" 60, "opsz" 36; }
em.ital { font-style: italic; font-weight: 400; }
.kicker {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.28rem); line-height: 1.55; color: var(--color-text); max-width: 34ch; }
p { margin: 0; }
.muted { color: var(--color-text-muted); }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.35rem; border-radius: 999px;
  font: 600 .98rem/1 "Instrument Sans", sans-serif;
  text-decoration: none; border: 1.5px solid transparent;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--color-accent); color: var(--color-on-accent); box-shadow: 0 1px 0 rgba(4,27,25,.25), 0 8px 22px -10px rgba(255,127,80,.7); }
.btn-accent:hover { background: var(--color-accent-hover); color: var(--color-on-accent); }
.btn-ghost { border-color: var(--color-border-strong); color: var(--color-heading); background: transparent; }
.btn-ghost:hover { border-color: var(--color-heading); color: var(--color-heading); }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ─── Masthead / nav ───────────────────────────────────────────────────── */
.dateline {
  border-bottom: 1px solid var(--color-border);
  font-family: "IBM Plex Mono", monospace; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.dateline .wrap { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; }
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.masthead .wrap { display: flex; align-items: center; gap: 2rem; height: 68px; }
.brand {
  display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none;
  font-family: "Fraunces", serif; font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em;
  color: var(--color-heading);
  font-variation-settings: "SOFT" 100, "opsz" 48;
}
.brand:hover { color: var(--color-heading); }
.brand-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--color-accent); transform: translateY(-.1rem); }
.brand i { font-style: italic; font-weight: 400; color: var(--color-primary); }
.navlinks { display: flex; gap: 1.6rem; margin-left: .5rem; }
.navlinks a { color: var(--color-text); text-decoration: none; font-weight: 500; font-size: .95rem; position: relative; }
.navlinks a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.navlinks a:hover { color: var(--color-heading); }
.navlinks a:hover::after { transform: scaleX(1); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.nav-actions .signin { color: var(--color-heading); text-decoration: none; font-weight: 500; padding: .5rem .25rem; }
.nav-actions .btn { padding: .65rem 1.1rem; font-size: .92rem; }
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--color-border-strong); color: var(--color-heading); cursor: pointer;
}
.theme-btn:hover { border-color: var(--color-heading); }
.theme-btn .moon { display: none; }
html.dark .theme-btn .sun { display: none; }
html.dark .theme-btn .moon { display: block; }

/* Footer */
footer { padding: 3rem 0 2.5rem; border-top: 1px solid var(--color-border); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; align-items: flex-start; }
.foot nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.foot nav a { color: var(--color-text); text-decoration: none; font-size: .95rem; }
.foot nav a:hover { color: var(--color-heading); text-decoration: underline; }
.disclaimer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); font-size: .8rem; color: var(--color-text-muted); max-width: 90ch; line-height: 1.6; }

/* ─── Motion ───────────────────────────────────────────────────────────── */
html.js .rise { opacity: 0; transform: translateY(18px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
html.js .rise.d1 { animation-delay: .08s; } html.js .rise.d2 { animation-delay: .2s; }
html.js .rise.d3 { animation-delay: .34s; } html.js .rise.d4 { animation-delay: .48s; }
@keyframes rise { to { opacity: 1; transform: none; } }
html.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .navlinks { display: none; }
}
@media (max-width: 640px) {
  .wrap { width: min(1180px, 100% - 2rem); }
  .dateline .edition { display: none; }
  .masthead .wrap { gap: 1rem; }
  .nav-actions .signin { display: none; }
}
