/* Unitypackage Importer site — design tokens (direction "E2": soft, orange key, CUD-checked)
   Light palette lives on :root; dark redefines tokens only. The theme toggle stamps data-theme. */
:root {
  --bg: #ffffff;
  --surface: #fff5ec;
  --surface-2: #fff9f4;
  --text: #3a322c;
  --muted: #72665d;
  --line: #f2e4d8;
  --accent: #f07f2a;      /* fills: always with --on-accent text */
  --ink: #ad5410;         /* orange for text and links (5.2:1 on white) */
  --ink-strong: #964709;  /* orange text on peach tints (5.3:1 on peach) */
  --accent-2: #1f7a62;    /* deep teal: text-level counterweight */
  --mint: #4fc4a8;        /* tint and ornament only, never text */
  --peach: #ffe3cc;
  --apricot: #ffd2b0;
  --on-accent: #3a322c;
  --focus: #1f7a62;
  --shadow: 0 10px 30px -18px rgba(58, 50, 44, .35);
  --radius: 18px;
  --radius-s: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #231d19; --surface: #2f2722; --surface-2: #2a2320; --text: #f6efe8; --muted: #b5a79c; --line: #3f352e;
    --accent: #ff9a4a; --ink: #ff9a4a; --ink-strong: #ff9a4a; --accent-2: #63d1b3; --mint: #63d1b3; --peach: #5b3d2a; --apricot: #5f3a2c;
    --on-accent: #231d19; --focus: #63d1b3; --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #231d19; --surface: #2f2722; --surface-2: #2a2320; --text: #f6efe8; --muted: #b5a79c; --line: #3f352e;
  --accent: #ff9a4a; --ink: #ff9a4a; --ink-strong: #ff9a4a; --accent-2: #63d1b3; --mint: #63d1b3; --peach: #5b3d2a; --apricot: #5f3a2c;
  --on-accent: #231d19; --focus: #63d1b3; --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
html[lang="ja"] body { font-family: "Zen Maru Gothic", "Nunito", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", system-ui, sans-serif; line-height: 1.85; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
code, kbd { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; background: var(--surface); padding: .1em .4em; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; font-weight: 800; letter-spacing: -0.01em; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3 { letter-spacing: 0; line-height: 1.35; }
html[lang="ja"] h1, html[lang="ja"] h2 { word-break: keep-all; overflow-wrap: anywhere; } /* break only at <wbr> and spaces; mid-word only when nothing else fits */
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.3em; }
li + li { margin-top: .35em; }
.nb { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section-head { display: grid; gap: 12px; max-width: 62ch; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .85rem; color: var(--ink); background: var(--surface); padding: 6px 14px; border-radius: 999px; width: fit-content; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; white-space: nowrap; }
@media (max-width: 480px) { .brand { font-size: .95rem; gap: 8px; } }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 6px 10px; border-radius: 999px; }
.nav a:hover { background: var(--surface); }
.nav .lang { color: var(--ink); }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
@media (max-width: 720px) { .nav a:not(.lang):not(.gh) { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 64px); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 60vw; max-width: 720px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--peach), transparent 70%); opacity: .9; pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--ink), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { display: grid; gap: 22px; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 800; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; font-family: inherit; line-height: 1.2; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-secondary:hover { background: var(--peach); }
.btn svg { width: 18px; height: 18px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--muted); }
.hero-meta span::before { content: "✓"; color: var(--accent-2); font-weight: 800; margin-right: 6px; }
.hero .lede sup { font-size: .6em; line-height: 0; vertical-align: super; margin-left: 1px; }
.hero-note { font-size: .82rem; color: var(--muted); margin-top: -10px; text-wrap: pretty; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

/* ---------- figures / placeholders ---------- */
.shot { margin: 0; display: grid; gap: 10px; }
.shot .frame { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.shot .frame img, .shot .frame video { display: block; width: 100%; height: auto; }
.shot .frame video { aspect-ratio: 16 / 9; background: #393939; }
.shot figcaption { font-size: .88rem; color: var(--muted); }
.shot figcaption b { color: var(--ink); font-weight: 800; }
.shot figcaption .credit { display: block; margin-top: 2px; font-size: .78rem; }

/* ---------- before / after slider (two stacked images; the range input drives --pos) ---------- */
.shot .frame.ba { position: relative; aspect-ratio: 4 / 5; background: #393939; user-select: none; }
.shot .frame.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .ba-after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.ba-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a322c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 7-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 24px no-repeat;
  border: 3px solid #fff; box-shadow: var(--shadow);
}
.ba:has(.ba-range:focus-visible) .ba-handle::after { outline: 3px solid var(--focus); outline-offset: 3px; }
.ba-label { position: absolute; top: 12px; font-size: .85rem; font-weight: 800; line-height: 1.3; padding: 5px 12px; border-radius: 999px; pointer-events: none; }
.ba-label-before { left: 12px; background: rgba(35, 29, 25, .82); color: #fff; }
.ba-label-after { right: 12px; background: #f07f2a; color: #3a322c; }
@media (max-width: 480px) { .ba-label { top: 8px; font-size: .74rem; padding: 4px 9px; } .ba-label-before { left: 8px; } .ba-label-after { right: 8px; } }

/* ---------- worries → this add-on ---------- */
.flow { max-width: 760px; margin-inline: auto; margin-bottom: clamp(32px, 5vw, 56px); }
.flow .section-head { max-width: none; }
.worry-title { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; }
.worry-title .face { width: 64px; height: 64px; }
@media (max-width: 480px) { .worry-title { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; } .worry-title .face { width: 48px; height: 48px; } }
.worries { list-style: none; margin: 0; padding: clamp(18px, 3vw, 28px); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 12px; }
.worries li { margin: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 1.05rem; font-weight: 700; line-height: 1.6; }
.worries .box { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; color: var(--ink); background: var(--bg); margin-top: 1px; }
.worries .box svg { width: 18px; height: 18px; }
.turn { display: grid; justify-items: center; gap: 6px; margin-block: 20px; text-align: center; }
.turn .arrow { width: 0; height: 0; border-style: solid; border-width: 18px 34px 0; border-color: var(--accent) transparent transparent; }
.turn p { font-weight: 800; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.5; }
.turn em { font-style: normal; color: var(--ink); }
.vs-after { background: var(--peach); border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); display: grid; gap: 16px; }
.vs-after h3 { color: var(--ink-strong); }
.vs-after p { color: var(--text); }
.vs-steps { list-style: none; padding: 0; display: grid; gap: 10px; counter-reset: vs; }
.vs-steps li { counter-increment: vs; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; }
.vs-steps li::before { content: counter(vs); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--accent); color: var(--on-accent); margin-top: 4px; }
.vs-after li { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); font-weight: 800; line-height: 1.45; }
html[lang="ja"] .vs-after li span { word-break: keep-all; overflow-wrap: anywhere; }
.shot.demo { max-width: 880px; margin-inline: auto; }
.shot.demo figcaption { text-align: center; }

/* ---------- use cases ---------- */
.uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.use { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.use img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--line); }
.use .body { padding: 18px 22px 24px; display: grid; gap: 8px; align-content: start; }
.use p { color: var(--muted); font-size: .98rem; }
@media (max-width: 860px) { .uses { grid-template-columns: 1fr; } }
.uses-note { margin-top: 16px; }

/* ---------- what comes through ---------- */
.included { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: clamp(32px, 5vw, 48px); }
.inc { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px 18px; }
.inc .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--peach); color: var(--ink-strong); }
.inc .icon svg { width: 22px; height: 22px; }
.inc b { display: block; font-size: 1.02rem; line-height: 1.4; margin-bottom: 2px; }
.inc span:not(.icon) { color: var(--muted); font-size: .93rem; }
@media (max-width: 860px) { .included { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .included { grid-template-columns: 1fr; } }
.support-shaders { display: grid; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 8px 18px; border-radius: 999px; background: var(--peach); color: var(--ink-strong); font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.chip small { font-size: .78em; font-weight: 700; color: var(--text); margin-left: 2px; }
.support-shaders .note { color: var(--muted); font-size: .95rem; max-width: 70ch; }
details.more { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
details.more > summary { cursor: pointer; font-weight: 800; color: var(--ink); width: fit-content; list-style: none; display: flex; align-items: center; gap: 10px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 8px; height: 8px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more[open] > summary { margin-bottom: 18px; }

/* ---------- shader table ---------- */
.shaders { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.shader { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; }
.shader .tag { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; margin-top: 3px; }
.tag-full { background: var(--peach); color: var(--ink-strong); }
.tag-generic { background: var(--surface); color: var(--accent-2); border: 1px solid var(--line); }
.shader b { display: block; font-size: 1rem; }
.shader span { color: var(--muted); font-size: .9rem; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.legend .tag { margin-right: 6px; }

/* ---------- modes ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.modes { display: grid; gap: 8px; }
.mode { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }
.mode.default { border-color: var(--accent); }
.mode span { color: var(--muted); font-size: .95rem; }
.mode .name { font-weight: 800; white-space: nowrap; color: var(--text); font-size: 1rem; }
@media (max-width: 480px) { .mode { grid-template-columns: 1fr; gap: 2px; } }
.modes-note { color: var(--muted); font-size: .92rem; margin-top: 12px; }

/* ---------- install ---------- */
.install { background: var(--surface); border-radius: calc(var(--radius) + 8px); padding: clamp(24px, 4vw, 48px); display: grid; gap: 28px; }
.install-step { display: grid; gap: 16px; }
.install-step > h3 { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; }
.install-step .num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; display: grid; place-items: center; font-size: 1rem; flex: none; }
.install-step > p { color: var(--muted); max-width: 70ch; }
.routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.route { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 26px); display: grid; gap: 12px; align-content: start; }
.route-easy { border: 2px solid var(--accent); }
.route h4 { margin: 0; font-size: 1.1rem; font-weight: 800; line-height: 1.4; }
.route p { color: var(--muted); font-size: .95rem; }
.route .btn { justify-self: start; }
.route .repo-url { background: var(--surface-2); }
.route-tag { width: fit-content; font-size: .78rem; font-weight: 800; line-height: 1.4; padding: 3px 10px; border-radius: 999px; background: var(--peach); color: var(--ink-strong); }
.route-tag-alt { background: color-mix(in srgb, var(--mint) 18%, var(--bg)); color: var(--accent-2); }
@media (max-width: 860px) { .routes { grid-template-columns: 1fr; } }
.repo-url { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 16px; }
.repo-url code { background: transparent; padding: 0; font-size: .92rem; overflow-x: auto; white-space: nowrap; display: block; }
.copy-btn { padding: 10px 16px; font-size: .92rem; }
.copy-btn[data-copied="true"] { background: var(--accent-2); color: #fff; }
:root[data-theme="dark"] .copy-btn[data-copied="true"] { color: var(--on-accent); }
.alt { font-size: .95rem; color: var(--muted); }
.install .shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 860px) { .install .shots { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
.faq summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; font-weight: 800; font-size: 1.05rem; line-height: 1.5; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); margin: -5px 4px 0 0; transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 5px; }
.faq .answer { padding: 0 20px 18px; display: grid; gap: 10px; color: var(--muted); }
.faq .answer ul { padding-left: 1.2em; }
.faq-more { margin-top: 18px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px 48px; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 18px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer .links a { color: var(--text); }
.site-footer .fine { max-width: 80ch; }
.site-footer .fine p + p { margin-top: 6px; }
