/* ==========================================================
   Honono Studio — base styles
   Color tokens, reset and shared components. Page layout lives
   in style.css.
   ========================================================== */
:root {
  color-scheme: light dark;

  /* Fixed colors, the same in light and dark */
  --ink: #15171c;
  --electric: #2346e8;    /* electric blue */
  --highlight: #ffd84d;   /* thunder yellow — decorative, or behind --ink text */

  --bg: #f7f6f2;          /* warm paper */
  --surface: #ffffff;
  --text: var(--ink);     /* 17:1 on --bg */
  --text-muted: #545a66;  /* 6.6:1 on --bg */
  --line: #dcd9d0;
  --accent: var(--electric); /* 6.4:1 on --bg, 7:1 with white text */
  --accent-hover: #1a37c4;
  --on-accent: #ffffff;
  --marker: var(--highlight); /* highlighter stroke under "thunder" */
  --footer-bg: var(--ink);
  --footer-text: #f7f6f2;
  --focus: var(--electric);

  --max: 1180px;
  --radius: 18px;
}

/* Dark mode follows the visitor's system setting. Only tokens change;
   the yellow hero panel and its ink logo stay the same. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;          /* ink */
    --surface: #1e2128;
    --text: #f2f0ea;        /* 15:1 on --bg */
    --text-muted: #a9afbb;  /* 8:1 on --bg */
    --line: #343842;
    --accent: #8fa4ff;      /* 7.6:1 on --bg, and behind --ink text */
    --accent-hover: #a9b9ff;
    --on-accent: var(--ink);
    --marker: rgb(255 216 77 / .3);
    --footer-bg: #0e1014;
    --footer-text: #f2f0ea;
    --focus: #8fa4ff;
  }
}

/* ---------- Font ----------
   Manrope (SIL Open Font License), self-hosted: one variable file
   covering weights 400–800, Latin subset. */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-size: 1.0625rem; line-height: 1.6;
}
svg { display: block; }
a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.1; }
p { margin: 0 0 1em; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--text); color: var(--bg); padding: .75rem 1rem;
  border-radius: 10px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

/* ---------- Header + navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand-logo { width: 45px; height: 30px; }


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; transition: transform .15s ease, background .2s, box-shadow .2s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-ghost { color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: var(--highlight); color: var(--ink); }
.btn-large { font-size: clamp(1rem, 3.6vw, 1.35rem); padding: 1rem 1.8rem; overflow-wrap: anywhere; }

/* ---------- Lightning strike on the large logo ----------
   Plays 3 quick double-flashes on arrival (finished in ~4s, under the
   WCAG 2.2.2 five-second limit), then only when the visitor hovers or
   taps the logo, or tabs into the hero (see main.js). The panel's
   ::after layer flashes white in sync.  */
:root { --strike-duration: 1.1s; --strike-delay: .6s; --strike-count: 3; }
.hero-logo {
  width: 100%; aspect-ratio: 1600 / 1080; color: var(--logo-color, var(--text));
  animation: strike var(--strike-duration) ease-out var(--strike-delay) var(--strike-count);
}
.hero-art::after { animation: panel-strike var(--strike-duration) ease-out var(--strike-delay) var(--strike-count); }
/* Two identical replay classes: alternating the animation name restarts it */
.hero-art.strike-a .hero-logo { animation: strike-a var(--strike-duration) ease-out; }
.hero-art.strike-b .hero-logo { animation: strike-b var(--strike-duration) ease-out; }
.hero-art.strike-a::after { animation: panel-strike-a var(--strike-duration) ease-out; }
.hero-art.strike-b::after { animation: panel-strike-b var(--strike-duration) ease-out; }

@keyframes strike   { 0%, 28%, 60%, 100% { color: var(--logo-color, var(--text)); } 12%, 42% { color: var(--electric); } }
@keyframes strike-a { 0%, 28%, 60%, 100% { color: var(--logo-color, var(--text)); } 12%, 42% { color: var(--electric); } }
@keyframes strike-b { 0%, 28%, 60%, 100% { color: var(--logo-color, var(--text)); } 12%, 42% { color: var(--electric); } }
@keyframes panel-strike   { 0%, 28%, 60%, 100% { opacity: 0; } 12%, 42% { opacity: .6; } }
@keyframes panel-strike-a { 0%, 28%, 60%, 100% { opacity: 0; } 12%, 42% { opacity: .6; } }
@keyframes panel-strike-b { 0%, 28%, 60%, 100% { opacity: 0; } 12%, 42% { opacity: .6; } }

/* Highlighter stroke under "thunder" */
.accent {
  background: linear-gradient(transparent 60%, var(--marker) 60%, var(--marker) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- User preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .accent { background: none; text-decoration: underline; }
  .btn { border: 2px solid CanvasText; }
}
