/* =============================================================
   SkillCreator · styles.css
   1. Tokens · 2. Reset · 3. Utilities · 4. Typography
   5. Components · 6. Sections · 7. Wizard · 8. Preview
   9. Modal · 10. Responsive · 11. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --ink:        #14121c;
  --ink-soft:   #413c52;
  --muted:      #6c6780;
  --line:       #e7e4ef;
  --line-soft:  #f0eef6;
  --bg:         #faf9fd;
  --surface:    #ffffff;
  --surface-2:  #f6f4fc;

  --accent:     #6d4bff;   /* violeta principal */
  --accent-2:   #9b6bff;   /* violeta claro para degradados */
  --accent-ink: #4a2fd6;
  --accent-wash:#efeaff;

  --good:       #18b26b;
  --good-wash:  #e4f7ee;
  --warn:       #e0930b;
  --warn-wash:  #fcf1dc;
  --bad:        #e5484d;
  --bad-wash:   #fce8e8;

  --code-bg:    #17151f;
  --code-ink:   #e9e6f5;
  --code-key:   #b79bff;
  --code-str:   #7fd6a8;
  --code-com:   #6b6780;

  --radius:     16px;
  --radius-sm:  10px;
  --radius-lg:  24px;
  --shadow-sm:  0 1px 2px rgba(20,18,28,.05), 0 2px 8px rgba(20,18,28,.04);
  --shadow-md:  0 6px 24px rgba(20,18,28,.08), 0 2px 8px rgba(20,18,28,.05);
  --shadow-lg:  0 24px 64px rgba(46,30,120,.16), 0 8px 24px rgba(20,18,28,.08);

  --gutter:     clamp(1.1rem, 4vw, 2.4rem);
  --maxw:       1200px;

  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.4, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #f2f0fa;
    --ink-soft:   #c6c1d8;
    --muted:      #928da6;
    --line:       #2b2740;
    --line-soft:  #232036;
    --bg:         #0e0c16;
    --surface:    #17141f;
    --surface-2:  #1e1a2b;

    --accent:     #8f6dff;
    --accent-2:   #b48cff;
    --accent-ink: #b9a3ff;
    --accent-wash:#221b3d;

    --good-wash:  #10281d;
    --warn-wash:  #2c2310;
    --bad-wash:   #2c1618;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
    --shadow-md:  0 8px 28px rgba(0,0,0,.5);
    --shadow-lg:  0 28px 70px rgba(0,0,0,.6);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: #fff; z-index: 9999; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 500; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.hl { color: var(--accent-ink); }

/* =============================================================
   4. Typography
   ============================================================= */
.h1 { font-family: var(--display); font-size: clamp(2.2rem, 6vw, 3.9rem); font-weight: 600; letter-spacing: -0.035em; }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.28rem); color: var(--ink-soft); line-height: 1.55; }
.section-title { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 2.4rem 0 .9rem; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; }

/* =============================================================
   5. Components
   ============================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; font-family: var(--display); font-weight: 500; font-size: 1rem; padding: .85rem 1.5rem; border-radius: 999px; transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 18px rgba(109,75,255,.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(109,75,255,.4); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.btn-soft { background: var(--accent-wash); color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent); color: #fff; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.08rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 500; color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.pill svg { width: 15px; height: 15px; color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Ad slots — placeholder only */
.ad-slot { min-height: 96px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); margin: 2.4rem auto; max-width: 970px; }

/* =============================================================
   6. Header / Footer / Sections
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 600; font-size: 1.18rem; letter-spacing: -0.02em; color: var(--ink); }
.brand .logo { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { font-size: .94rem; color: var(--ink-soft); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--accent-ink); }
.nav-links .btn { padding: .55rem 1.15rem; font-size: .92rem; }
.nav-toggle { display: none; }

.footer { border-top: 1px solid var(--line); margin-top: 5rem; padding: 3rem 0 2.5rem; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; font-weight: 600; }
.footer a { display: block; color: var(--ink-soft); font-size: .95rem; margin-bottom: .55rem; transition: color .2s; }
.footer a:hover { color: var(--accent-ink); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-head { max-width: 60ch; margin-bottom: 2.6rem; }
.section-head .lead { margin-top: .8rem; }

/* =============================================================
   6b. Hero
   ============================================================= */
.hero { position: relative; padding-top: clamp(2.5rem, 6vw, 4rem); overflow: clip; }
.hero-glow { position: absolute; inset: -20% 0 auto 0; height: 620px; background:
    radial-gradient(50% 60% at 25% 0%, rgba(109,75,255,.20), transparent 70%),
    radial-gradient(45% 55% at 80% 10%, rgba(155,107,255,.18), transparent 72%);
  filter: blur(8px); z-index: -1; pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy .h1 { margin: 1rem 0 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }

/* Hero visual: a floating SKILL.md card */
.hero-visual { position: relative; }
.mock { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: var(--code-bg); transform: rotate(1.2deg); transition: transform .5s var(--ease-out); }
.hero-visual:hover .mock { transform: rotate(0); }
.mock-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); }
.mock-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #4b4760; }
.mock-bar .fname { margin-left: .6rem; font-family: var(--mono); font-size: .78rem; color: #9d97b8; }
.mock-body { padding: 1.1rem 1.2rem; font-family: var(--mono); font-size: .82rem; line-height: 1.75; color: var(--code-ink); white-space: pre-wrap; word-break: break-word; }
.mock-body .k { color: var(--code-key); }
.mock-body .s { color: var(--code-str); }
.mock-body .c { color: var(--code-com); }
.hero-badge { position: absolute; bottom: -18px; right: -6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: .7rem .95rem; display: flex; align-items: center; gap: .6rem; font-size: .82rem; font-weight: 600; }
.hero-badge .ring { width: 34px; height: 34px; }

/* =============================================================
   6c. Feature / steps / compare grids
   ============================================================= */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.feature { padding: 1.6rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .35s var(--ease-out), box-shadow .35s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink); margin-bottom: 1rem; }
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.14rem; margin-bottom: .45rem; }
.feature p { color: var(--ink-soft); font-size: .96rem; }

.steps { counter-reset: step; display: grid; gap: 1rem; }
.step-row { display: flex; gap: 1.1rem; padding: 1.3rem 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.step-row::before { counter-increment: step; content: counter(step); flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 600; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.step-row h3 { font-size: 1.1rem; margin-bottom: .25rem; }
.step-row p { color: var(--ink-soft); font-size: .95rem; }

/* Comparison table */
.compare { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.compare table { width: 100%; border-collapse: collapse; min-width: 520px; background: var(--surface); }
.compare th, .compare td { padding: 1rem 1.2rem; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .95rem; }
.compare thead th { font-family: var(--display); font-size: .9rem; color: var(--muted); font-weight: 600; }
.compare thead th.us { color: var(--accent-ink); }
.compare tbody td:first-child { color: var(--ink-soft); }
.compare .yes { color: var(--good); font-weight: 600; }
.compare .no { color: var(--muted); }
.compare col.us-col { background: var(--accent-wash); }

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .8rem; box-shadow: var(--shadow-sm); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 1.3rem; font-family: var(--display); font-weight: 500; font-size: 1.04rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }

/* =============================================================
   7. Wizard (the tool)
   ============================================================= */
.studio { scroll-margin-top: 90px; }
.studio-shell { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.4rem; align-items: start; }
.wizard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }

/* Template picker */
.templates { padding: 1.5rem; border-bottom: 1px solid var(--line); }
.templates h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.templates p { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.tpl { text-align: left; padding: .95rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); display: flex; gap: .8rem; align-items: flex-start; transition: border-color .2s, transform .2s, background .2s; }
.tpl:hover { border-color: var(--accent); transform: translateY(-2px); }
.tpl .ico { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink); }
.tpl .ico svg { width: 18px; height: 18px; }
.tpl strong { display: block; font-family: var(--display); font-size: .95rem; font-weight: 600; }
.tpl span { font-size: .82rem; color: var(--muted); line-height: 1.35; }

/* Progress */
.wiz-progress { padding: 1.3rem 1.5rem .3rem; }
.wiz-steps { display: flex; gap: .35rem; margin-bottom: .6rem; }
.wiz-steps .seg { flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wiz-steps .seg.done { background: var(--accent); }
.wiz-steps .seg.active { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.wiz-count { font-size: .82rem; color: var(--muted); font-weight: 500; }
.wiz-count b { color: var(--accent-ink); }

/* Block panel */
.wiz-body { padding: .6rem 1.5rem 1.5rem; }
.block { display: none; animation: blockIn .4s var(--ease-out); }
.block.is-active { display: block; }
@keyframes blockIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.block-step { font-family: var(--display); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.block h3 { font-size: 1.4rem; margin: .35rem 0 .5rem; }
.block-help { color: var(--ink-soft); font-size: .96rem; margin-bottom: 1.1rem; }

.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.input, .textarea { width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 1rem; transition: border-color .2s, box-shadow .2s, background .2s; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-wash); }
.textarea { min-height: 118px; resize: vertical; line-height: 1.55; }
.field .hint { display: flex; justify-content: space-between; gap: 1rem; margin-top: .4rem; font-size: .8rem; color: var(--muted); }
.field .slug-preview { font-family: var(--mono); color: var(--accent-ink); }

/* Repeatable list */
.list-rows { display: grid; gap: .6rem; margin-bottom: .7rem; }
.list-row { display: flex; gap: .5rem; align-items: flex-start; }
.list-row .num { flex: none; width: 26px; height: 26px; margin-top: .55rem; border-radius: 7px; display: grid; place-items: center; font-family: var(--mono); font-size: .78rem; font-weight: 600; background: var(--accent-wash); color: var(--accent-ink); }
.list-row textarea { min-height: 52px; }
.list-row .del { flex: none; margin-top: .4rem; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: var(--surface); transition: color .2s, border-color .2s; }
.list-row .del:hover { color: var(--bad); border-color: var(--bad); }
.add-row { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9rem; color: var(--accent-ink); padding: .5rem .9rem; border-radius: 999px; border: 1px dashed var(--accent); background: var(--accent-wash); transition: background .2s; }
.add-row:hover { background: var(--accent); color: #fff; }

/* Resources toggles */
.toggle-row { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: .7rem; cursor: pointer; }
.toggle-row input { margin-top: .25rem; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.toggle-row strong { display: block; font-size: .96rem; }
.toggle-row span { font-size: .86rem; color: var(--muted); }

/* Quality meter */
.meter { margin-top: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 1rem 1.1rem; }
.meter-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.meter-top strong { font-family: var(--display); font-size: .92rem; }
.meter-score { font-family: var(--display); font-weight: 600; font-size: .9rem; padding: .2rem .7rem; border-radius: 999px; }
.meter-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; transition: width .5s var(--ease-out), background .3s; }
.meter-tips { margin: .8rem 0 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.meter-tips li { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; color: var(--ink-soft); }
.meter-tips li svg { width: 16px; height: 16px; flex: none; margin-top: .15rem; }
.meter-tips li.ok svg { color: var(--good); }
.meter-tips li.tip svg { color: var(--warn); }

/* Wizard nav */
.wiz-nav { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.wiz-nav .spacer { flex: 1; }

/* =============================================================
   8. Live preview
   ============================================================= */
.preview { position: sticky; top: 90px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; background: var(--code-bg); border-bottom: 1px solid rgba(255,255,255,.08); }
.preview-head .fname { display: flex; align-items: center; gap: .55rem; font-family: var(--mono); font-size: .82rem; color: #b9b3d4; }
.preview-head .fname svg { width: 15px; height: 15px; color: var(--accent-2); }
.preview-live { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; color: #8f89aa; text-transform: uppercase; letter-spacing: .05em; }
.preview-live .blip { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(24,178,107,.5); animation: blip 2s infinite; }
@keyframes blip { 0% { box-shadow: 0 0 0 0 rgba(24,178,107,.5); } 70% { box-shadow: 0 0 0 7px rgba(24,178,107,0); } 100% { box-shadow: 0 0 0 0 rgba(24,178,107,0); } }
.preview-code { margin: 0; padding: 1.2rem 1.3rem; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: .82rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; }
.preview-code .k { color: var(--code-key); }
.preview-code .s { color: var(--code-str); }
.preview-code .c { color: var(--code-com); }
.preview-code .h { color: #ff9ecb; }
.preview-foot { padding: .7rem 1.1rem; background: var(--code-bg); border-top: 1px solid rgba(255,255,255,.08); font-family: var(--mono); font-size: .74rem; color: #7c7699; display: flex; justify-content: space-between; }

/* =============================================================
   9. Result modal
   ============================================================= */
.modal { position: fixed; inset: 0; z-index: 200; display: none; padding: var(--gutter); }
.modal.is-open { display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14,12,22,.55); backdrop-filter: blur(6px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(720px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .4s var(--ease-bounce); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.modal-head { padding: 1.8rem 1.8rem 1.2rem; text-align: center; border-bottom: 1px solid var(--line); }
.modal-head .check { width: 60px; height: 60px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--good-wash); color: var(--good); animation: pop .5s var(--ease-bounce) .1s both; }
.modal-head h3 { font-size: 1.6rem; }
.modal-head p { color: var(--ink-soft); margin-top: .4rem; }
.modal-body { padding: 1.4rem 1.8rem 1.8rem; }
.modal-file { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 1rem; font-family: var(--mono); font-size: .85rem; }
.modal-file svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.modal-file .tree { color: var(--ink-soft); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1.2rem; }
.modal-actions .btn { width: 100%; }
.modal-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.modal-preview summary { cursor: pointer; list-style: none; padding: .8rem 1.1rem; font-weight: 600; font-size: .92rem; background: var(--surface-2); }
.modal-preview summary::-webkit-details-marker { display: none; }
.modal-preview pre { margin: 0; padding: 1.1rem; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: .78rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.modal-close { position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); transition: color .2s, transform .2s; }
.modal-close:hover { color: var(--ink); transform: rotate(90deg); }
.modal-next { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--accent-wash); font-size: .9rem; color: var(--accent-ink); }
.modal-next a { text-decoration: underline; font-weight: 600; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: .75rem 1.3rem; border-radius: 999px; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 300; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================================
   10. Responsive
   ============================================================= */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 460px; }
  .studio-shell { grid-template-columns: 1fr; }
  .preview { position: relative; top: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1.2rem; box-shadow: var(--shadow-md); transform: translateY(-120%); transition: transform .35s var(--ease-out); }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .7rem 0; border-bottom: 1px solid var(--line-soft); }
  .nav-links .btn { margin-top: .6rem; }
  .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); }
  .tpl-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .modal-actions { grid-template-columns: 1fr; }
}

/* =============================================================
   11. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .preview-live .blip { animation: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* =============================================================
   12b. Breadcrumbs
   ============================================================= */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--accent-ink); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--muted); }

/* =============================================================
   12c. Examples gallery
   ============================================================= */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .3s var(--ease-out), box-shadow .3s; }
.ex-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ex-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.ex-ico { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink); }
.ex-ico svg { width: 21px; height: 21px; }
.ex-head h3 { font-family: var(--display); font-size: 1.1rem; font-weight: 600; margin-bottom: .1rem; }
.ex-slug { font-family: var(--mono); font-size: .78rem; color: var(--muted); background: none; border: 0; padding: 0; }
.ex-tag { color: var(--ink-soft); font-size: .93rem; margin-bottom: 1.1rem; flex: 1; }
.ex-actions { display: flex; gap: .6rem; margin-bottom: .7rem; }
.ex-actions .btn { padding: .6rem 1rem; font-size: .9rem; }
.ex-actions .ex-dl { flex: 1; }
.ex-view summary { cursor: pointer; list-style: none; font-weight: 600; font-size: .85rem; color: var(--accent-ink); padding: .4rem 0; }
.ex-view summary::-webkit-details-marker { display: none; }
.ex-view summary::before { content: "› "; }
.ex-view[open] summary::before { content: "⌄ "; }
.ex-view pre { margin: .5rem 0 0; padding: 1rem; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: .76rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; border-radius: var(--radius-sm); max-height: 340px; overflow: auto; }

/* =============================================================
   12. Cookie consent banner
   ============================================================= */
.cookie-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(140%); width: min(680px, calc(100% - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.2rem 1.3rem; z-index: 250; transition: transform .5s var(--ease-out); }
.cookie-banner.show { transform: translateX(-50%) translateY(0); }
.cookie-banner p { font-size: .92rem; color: var(--ink-soft); margin-bottom: 1rem; }
.cookie-banner a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.cookie-actions .btn { padding: .7rem 1.3rem; font-size: .92rem; flex: 1 1 auto; }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }
@media (max-width: 480px) { .cookie-actions { flex-direction: column-reverse; } }
