/* Shared styles for the static, indexable tool and guide pages (/tools/*, /make-your-own-anime).
   These pages are plain HTML so crawlers see a real title and H1; they do not load the SPA bundle.
   Tokens and classes mirror src/styles/manga.css (the "manga proof sheet" art direction). Keep them in step by hand. */

@font-face {
  font-family: 'Hanken Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Dela Gothic One';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/dela-gothic-one-latin-400-normal.woff2') format('woff2');
}

:root {
  --font-sans: 'Hanken Grotesk Variable', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Dela Gothic One', 'Arial Black', Impact, sans-serif;
  --mg-bg: #eef0f5;
  --mg-bg-2: #e2e5ee;
  --mg-fg: #101116;
  --mg-fg-soft: #3b3e4c;
  --mg-line: #101116;
  --mg-panel: #f8f9fc;
  --mg-shadow: #101116;
  --mg-accent: #2f6bff;
  --mg-accent-ink: #ffffff;
  --mg-dot: rgba(16, 17, 22, 0.16);
  --mg-ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
.dark {
  --mg-bg: #0e0f14;
  --mg-bg-2: #171922;
  --mg-fg: #f3f1ec;
  --mg-fg-soft: #b3b6c4;
  --mg-line: #f3f1ec;
  --mg-panel: #14161d;
  --mg-shadow: #2f6bff;
  --mg-accent: #4f86ff;
  --mg-accent-ink: #0b0d14;
  --mg-dot: rgba(243, 241, 236, 0.16);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--mg-bg);
  color: var(--mg-fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.mg-wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
@media (min-width: 640px) { .mg-wrap { width: min(100% - 3rem, 72rem); } }
@media (min-width: 1024px) { .mg-wrap { width: min(100% - 4rem, 72rem); } }

.mg-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.mg-copy { color: var(--mg-fg-soft); line-height: 1.65; max-width: 64ch; text-wrap: pretty; }
.accent { color: var(--mg-accent); }

/* ---------- header ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 3px solid var(--mg-line);
  background: color-mix(in srgb, var(--mg-bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.site-nav .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; }
.brand .logo-dark { display: none; }
.dark .brand .logo-light { display: none; }
.dark .brand .logo-dark { display: block; }
.brand span { font-family: var(--font-display); font-size: 1.2rem; line-height: 1; }
.nav-links { display: none; gap: 0.25rem; }
.nav-links a { text-decoration: none; font-weight: 700; font-size: 0.9rem; padding: 0.5rem 0.6rem; }
.nav-links a:hover, .nav-links a[aria-current='page'] { color: var(--mg-accent); }
@media (min-width: 900px) { .nav-links { display: flex; } }

/* ---------- buttons ---------- */
.mg-btn {
  --b-bg: var(--mg-accent);
  --b-fg: var(--mg-accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  font-family: var(--font-display); font-size: 1.05rem; line-height: 1;
  color: var(--b-fg); background: var(--b-bg);
  border: 3px solid var(--mg-line); box-shadow: 5px 5px 0 var(--mg-line);
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform 0.2s var(--mg-ease), box-shadow 0.2s var(--mg-ease);
}
.mg-btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--mg-line); }
.mg-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--mg-line); }
.mg-btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--mg-accent); outline-offset: 3px;
}
.mg-btn-ghost { --b-bg: transparent; --b-fg: var(--mg-fg); }
.mg-btn-sm { padding: 0.6rem 1rem; font-size: 0.9rem; box-shadow: 3px 3px 0 var(--mg-line); }

/* ---------- panels ---------- */
.mg-panel {
  position: relative;
  border: 3px solid var(--mg-line);
  background: var(--mg-panel);
  box-shadow: 8px 8px 0 var(--mg-shadow);
}
.mg-halftone {
  background-image: radial-gradient(circle at center, var(--mg-dot) 1.2px, transparent 1.7px);
  background-size: 8px 8px;
}

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: 3rem 0 2.5rem; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle at center, var(--mg-dot) 1.2px, transparent 1.7px);
  background-size: 8px 8px;
  -webkit-mask-image: linear-gradient(115deg, #000 0%, transparent 62%);
  mask-image: linear-gradient(115deg, #000 0%, transparent 62%);
}
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 7fr 5fr; gap: 3rem; } .hero { padding: 4.5rem 0 3.5rem; } }
.eyebrow { display: inline-block; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; border: 2px solid var(--mg-line); padding: 0.25rem 0.6rem; margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 4.4rem); }
.hero .lede { margin-top: 1.2rem; font-size: 1.15rem; }
.hero-art { position: relative; max-width: 26rem; margin-inline: auto; width: 100%; }
.hero-art .scene { border: 3px solid var(--mg-line); box-shadow: 8px 8px 0 var(--mg-shadow); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transform: rotate(1.2deg); }
.hero-art .char { position: absolute; bottom: -1rem; left: -0.5rem; width: 46%; filter: drop-shadow(5px 5px 0 rgba(16, 17, 22, 0.85)); }

/* ---------- tool area ---------- */
.tool { padding: 1.25rem; }
@media (min-width: 640px) { .tool { padding: 2rem; } }
.controls { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .controls { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mg-label { display: block; margin-bottom: 0.4rem; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.mg-input {
  width: 100%; padding: 0.75rem 0.9rem;
  background: var(--mg-panel); color: var(--mg-fg);
  border: 3px solid var(--mg-line); font: inherit; font-size: 1rem;
  border-radius: 0;
}
textarea.mg-input { resize: vertical; min-height: 5.5rem; line-height: 1.5; }
.mg-input:focus { outline: none; box-shadow: 5px 5px 0 var(--mg-accent); }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.5rem; }

.results { list-style: none; display: grid; gap: 0.9rem; margin-top: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.result {
  border: 3px solid var(--mg-line); background: var(--mg-bg); padding: 0.9rem 1rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; min-width: 0;
}
.result .name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.15; overflow-wrap: anywhere; }
.result .meta { color: var(--mg-fg-soft); font-size: 0.9rem; margin-top: 0.3rem; }
.copy-btn { flex-shrink: 0; font: inherit; font-weight: 800; font-size: 0.8rem; padding: 0.35rem 0.6rem; border: 2px solid var(--mg-line); background: transparent; color: var(--mg-fg); cursor: pointer; }
.copy-btn:hover { background: var(--mg-accent); color: var(--mg-accent-ink); }

.oc-card { margin-top: 1.75rem; display: grid; gap: 0; border: 3px solid var(--mg-line); background: var(--mg-bg); }
.oc-row { display: grid; grid-template-columns: 1fr; gap: 0.15rem; padding: 0.75rem 1rem; border-bottom: 2px solid color-mix(in srgb, var(--mg-line) 25%, transparent); }
.oc-row:last-child { border-bottom: 0; }
@media (min-width: 640px) { .oc-row { grid-template-columns: 11rem 1fr; gap: 1rem; } }
.oc-row dt { font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mg-fg-soft); }
.oc-row dd { overflow-wrap: anywhere; }
.oc-row dd.big { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.15; }

/* character sheet */
.sheet-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sheet-grid .wide { grid-column: 1 / -1; } }
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.25rem; }
.sheet-head h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
.note { font-size: 0.9rem; color: var(--mg-fg-soft); margin-top: 1rem; }

/* ---------- content ---------- */
.section { padding: 3rem 0; }
.section h2 { font-size: clamp(1.6rem, 4.5vw, 2.6rem); margin-bottom: 1rem; }
.section h3 { font-size: 1.15rem; font-weight: 800; margin: 1.6rem 0 0.4rem; }
.prose p + p { margin-top: 1rem; }
.prose ul, .prose ol { margin: 0.8rem 0 0 1.3rem; color: var(--mg-fg-soft); }
.prose li + li { margin-top: 0.4rem; }
.prose strong { color: var(--mg-fg); }
.steps { list-style: none; counter-reset: s; display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.steps li { counter-increment: s; position: relative; padding: 1.1rem 1.1rem 1.1rem 4.1rem; border: 3px solid var(--mg-line); background: var(--mg-panel); }
.steps li::before {
  content: counter(s); position: absolute; left: 1rem; top: 1rem;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  font-family: var(--font-display); background: var(--mg-accent); color: var(--mg-accent-ink); border: 2px solid var(--mg-line);
}
.steps h3 { margin: 0 0 0.25rem; }
.steps p { color: var(--mg-fg-soft); }
.steps img { margin-top: 0.8rem; border: 2px solid var(--mg-line); width: 100%; max-width: 30rem; aspect-ratio: 16 / 9; object-fit: cover; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: block; text-decoration: none; border: 3px solid var(--mg-line); background: var(--mg-panel); box-shadow: 6px 6px 0 var(--mg-shadow); transition: transform 0.25s var(--mg-ease), box-shadow 0.25s var(--mg-ease); }
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--mg-shadow); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--mg-line); }
.card div { padding: 1rem 1.1rem 1.2rem; }
.card strong { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; display: block; line-height: 1.15; }
.card span { display: block; color: var(--mg-fg-soft); font-size: 0.95rem; margin-top: 0.4rem; }

.cta-band { margin: 1rem 0 3.5rem; padding: 2rem 1.25rem; text-align: center; }
@media (min-width: 640px) { .cta-band { padding: 3rem 2rem; } }
.cta-band h2 { font-size: clamp(1.8rem, 5vw, 3rem); }
.cta-band p { margin: 1rem auto 1.6rem; }

.faq details { border: 3px solid var(--mg-line); background: var(--mg-panel); padding: 0.9rem 1.1rem; }
.faq details + details { margin-top: 0.8rem; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details p { margin-top: 0.6rem; color: var(--mg-fg-soft); }

/* ---------- footer ---------- */
.site-foot { border-top: 3px solid var(--mg-line); padding: 2.5rem 0; }
.site-foot .row { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center; }
@media (min-width: 900px) { .site-foot .row { flex-direction: row; justify-content: space-between; text-align: left; } }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; font-weight: 700; font-size: 0.9rem; }
.site-foot nav a { text-decoration: none; }
.site-foot nav a:hover { color: var(--mg-accent); }
.site-foot small { color: var(--mg-fg-soft); font-size: 0.9rem; }

.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) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- print: the character sheet prints as a clean black-on-white form ---------- */
@media print {
  :root, .dark { --mg-bg: #fff; --mg-panel: #fff; --mg-fg: #000; --mg-fg-soft: #222; --mg-line: #000; --mg-shadow: transparent; }
  .site-nav, .site-foot, .no-print, .hero-art, .cta-band { display: none !important; }
  body { background: #fff; }
  .mg-panel { box-shadow: none; }
  .print-only-sheet .section, .print-only-sheet .hero { display: none; }
  .print-only-sheet #sheet-section { display: block !important; padding: 0; }
  .mg-input { border-width: 1px; }
}

/* Narrow phones: stack "Cloud" under "Animaker" (as the app header does) so the CTA keeps its room. */
@media (max-width: 480px) {
  .site-nav .brand > span { width: min-content; font-size: 1.05rem; }
  .site-nav .mg-btn-sm { padding: 0.55rem 0.75rem; font-size: 0.85rem; }
}

/* In-page anchors land below the sticky header. */
[id] { scroll-margin-top: 5.5rem; }
