/* 旅の拠点になる村 — 羊皮紙とランタンのテーマ */
:root {
  --bg: #f4ede0;
  --bg-2: #ece2cf;
  --panel: #fffaf2;
  --panel-2: #f7efe1;
  --line: #ddccb0;
  --ink: #2b2017;
  --ink-2: #66533f;
  --ink-3: #8f7b63;
  --accent: #b0502a;
  --accent-2: #e39a35;
  --accent-ink: #fff8ee;
  --warn: #a8600f;
  --warn-bg: #fbeedb;
  --ok: #3d7a50;
  --window-bg: rgba(22, 16, 28, .84);
  --shadow: 0 18px 40px -22px rgba(70, 40, 10, .45);
  --font-display: var(--font-serif);
  color-scheme: light;
}
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(900px 500px at 110% 20%, rgba(227, 154, 53, .10), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.section-alt { background: rgba(120, 80, 30, .06); border-block: 1px solid rgba(120, 80, 30, .08); }
.section-head h2 { font-weight: 700; letter-spacing: .06em; }
.eyebrow { color: var(--accent); }
.site-header { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.brand-mark { color: var(--accent); }
:root { --btn-neutral-bg: rgba(43, 32, 23, .05); }
.btn-secondary { --btn-line: color-mix(in srgb, var(--accent) 55%, transparent); }
.checklist li > svg { color: var(--accent); }
.filetree { background: #2a211a; color: #f3e9d8; border-color: #3d3127; }
.filetree .n { color: #b9a68c; }
.filetree .hl { color: #f2b766; }
.filetree .d::before { color: #f2b766; }
.filetree-title { color: #b9a68c; }
.steps > li::before { background: var(--accent); color: var(--accent-ink); }
.faq summary::before { color: var(--accent); }
.license-col.cannot h3 svg { color: #b3423a; }
.cta-band { background: linear-gradient(135deg, #2a1d14, #3b2717); color: #fff3e2; border-color: #4a3523; }
.cta-band .muted { color: #e2cfb4; }
.cta-band .btn-secondary { --btn-ink: #fff3e2; }
.related-card .rc-why { background: rgba(176, 80, 42, .08); }
.price-card .ribbon { color: var(--accent-ink); }

/* ------------------------------------------------------------ hero */
.hero { position: relative; background: #120d0a; color: #fff; }
.hero-stage { position: relative; min-height: max(640px, min(calc(100svh - var(--header-h) - 30px), 940px)); display: grid; grid-template-rows: 1fr auto; overflow: hidden; isolation: isolate; }
.hero-images { position: absolute; inset: 0; z-index: -2; }
.hero-images img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; transform: scale(1.05); will-change: opacity, transform; }
.hero-images img.is-on { opacity: 1; animation: kenburns 26s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-1.6%, -1.2%, 0); } }
html.reduced .hero-images img.is-on { animation: none; }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(14, 9, 6, .82) 0%, rgba(14, 9, 6, .5) 38%, rgba(14, 9, 6, 0) 66%),
    linear-gradient(0deg, rgba(10, 7, 5, .85) 0%, rgba(10, 7, 5, 0) 38%),
    linear-gradient(180deg, rgba(10, 7, 5, .55) 0%, rgba(10, 7, 5, 0) 22%);
}
.hero-copy { padding-top: clamp(28px, 6vh, 84px); max-width: none; align-self: center; }
.hero-copy > * { max-width: 640px; }
.hero .eyebrow { color: #ffcf86; }
.hero h1 { font-family: var(--font-serif); font-size: clamp(38px, 5.2vw, 76px); font-weight: 700; line-height: 1.2; letter-spacing: .06em; text-shadow: 0 4px 30px rgba(0, 0, 0, .55); margin-bottom: .4em; max-width: 900px !important; }
.hero-lead { font-size: clamp(15.5px, 1.6vw, 18px); color: #f6e8d4; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.hero-lead strong { color: #ffd7a0; font-weight: 700; }
.hero .chip { color: #fff; border-color: rgba(255, 255, 255, .28); background: rgba(20, 12, 6, .45); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 22px; padding-left: 4px; }
.hero .btn-secondary { --btn-ink: #fff; --btn-line: rgba(255, 255, 255, .45); --btn-bg: rgba(0, 0, 0, .25); }
.hero .btn-primary { --btn-bg: #e39a35; --btn-ink: #24160b; box-shadow: 0 12px 36px -12px rgba(227, 154, 53, .9); }
.hero-ui { width: min(100% - var(--gutter) * 2, 980px); margin: 0 auto; padding: 14px 0 22px; display: grid; gap: 20px; }
.hero-time { justify-self: center; display: inline-flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(12, 8, 6, .55); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-time button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 11px; border: 0; background: transparent; color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 700; transition: background .25s, color .25s, box-shadow .25s; }
.hero-time button svg { width: 18px; height: 18px; }
.hero-time button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.hero-time button[aria-checked="true"] { background: #fff3df; color: #2b1a0c; box-shadow: 0 0 24px rgba(255, 207, 134, .55); }
.hero-time .t-progress { display: none; }
.hero-window { margin-top: 6px; }
.hero-window .window-text { min-height: 3.5em; }
.hero-caption { margin: -8px 0 0; font-size: 12px; color: rgba(255, 255, 255, .7); text-align: center; }
.hero-caption span { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 5px; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .3); font-weight: 700; color: #fff; }
@media (max-width: 760px) {
  .hero-stage { min-height: 0; }
  .hero-copy { padding-top: 40px; padding-bottom: 8px; }
  .hero h1 { font-size: clamp(27px, 8.2vw, 38px); }
  .hero-shade { background: linear-gradient(180deg, rgba(14, 9, 6, .78) 0%, rgba(14, 9, 6, .45) 45%, rgba(10, 7, 5, .88) 100%); }
  .hero-time { width: 100%; justify-content: space-between; }
  .hero-time button { padding: 8px 8px; font-size: 13px; flex: 1; justify-content: center; }
  .hero-ui { padding-top: 40px; }
}

/* ------------------------------------------------------------ use cases */
.usecase { aspect-ratio: 3 / 2; border-color: #cdb894; box-shadow: var(--shadow); container-type: inline-size; }
.uc-dialog { position: absolute; left: 5%; right: 5%; bottom: 6%; padding: 9px 13px 11px; }
.uc-dialog .window-text { min-height: 0; font-size: clamp(11px, 3.6cqw, 14px); line-height: 1.65; }
.uc-dialog .window-name { font-size: clamp(10px, 3.2cqw, 12px); top: -13px; padding: 1px 9px; }
.uc-shop { position: absolute; right: 5%; top: 14%; display: grid; gap: 8px; justify-items: end; }
.uc-shop .menu-window li { font-size: clamp(11px, 3.6cqw, 14px); }
.uc-gold { padding: 5px 12px; font-size: clamp(11px, 3.4cqw, 13px); }
.uc-gold b { font-family: var(--font-mono); color: #ffd36b; }
.uc-chapter { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; background: radial-gradient(ellipse at center, rgba(10, 6, 4, .55), rgba(10, 6, 4, 0) 72%); font-family: var(--font-serif); }
.uc-chapter span { font-size: clamp(11px, 3.4cqw, 14px); letter-spacing: .5em; padding-left: .5em; opacity: .85; }
.uc-chapter strong { font-size: clamp(22px, 9cqw, 40px); letter-spacing: .14em; padding: 6px 18px; border-block: 1px solid rgba(255, 255, 255, .7); margin-top: 6px; text-shadow: 0 2px 16px rgba(0, 0, 0, .6); }
figure { margin: 0; }

/* ------------------------------------------------------------ matrix */
.matrix-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.matrix-count { margin: 0; font-size: 14px; color: var(--ink-2); }
.matrix-count b { font-family: var(--font-mono); font-size: 20px; color: var(--accent); }
.matrix { display: grid; gap: 12px; }
.matrix-head, .matrix-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; }
.matrix-head { position: sticky; top: var(--header-h); z-index: 5; padding: 8px 0; background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.matrix-head { grid-template-columns: 150px repeat(4, minmax(0, 1fr)); }
.matrix-head span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.matrix-head svg { width: 16px; height: 16px; color: var(--accent); }
.matrix-row .loc { display: grid; gap: 2px; padding-left: 4px; border-left: 3px solid var(--accent); }
.matrix-row .loc .no { font: 700 12px/1 var(--font-mono); color: var(--accent); letter-spacing: .08em; }
.matrix-row .loc .name { font-family: var(--font-serif); font-size: 19px; font-weight: 700; line-height: 1.3; }
.matrix-row .loc .en { font: 11px/1 var(--font-mono); color: var(--ink-3); letter-spacing: .06em; }
.cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mcell { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; padding: 0; border: 1px solid #c9b48f; border-radius: 10px; overflow: hidden; background: #2b2017; cursor: zoom-in; box-shadow: 0 6px 16px -10px rgba(60, 30, 5, .6); }
.mcell img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease-out), filter .3s; }
.mcell:hover img, .mcell:focus-visible img { transform: scale(1.07); }
.mcell .t { position: absolute; left: 8px; bottom: 7px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 2px 7px; border-radius: 5px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.mcell:hover .t, .mcell:focus-visible .t { opacity: 1; transform: none; }
.mcell .badge-free { position: absolute; top: 7px; right: 7px; }
.matrix.is-filtered .matrix-head { display: none; }
.matrix.is-filtered { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.matrix.is-filtered .matrix-row { display: block; }
.matrix.is-filtered .loc { margin-bottom: 8px; }
.matrix.is-filtered .cells { display: block; }
.matrix.is-filtered .mcell:not(.is-match) { display: none; }
@media (max-width: 760px) {
  .matrix-head { display: none; }
  .matrix-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cells { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 66%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cells .mcell { scroll-snap-align: start; }
  .mcell .t { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ compare */
.variants-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.variants-controls { margin-bottom: 14px; }
.compare { box-shadow: var(--shadow); border: 1px solid #c9b48f; }
.score { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.score b { font: 800 46px/1 var(--font-mono); color: var(--accent); letter-spacing: -.02em; }
.score span { font: 700 14px var(--font-mono); color: var(--ink-3); }
.cmp-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); }
@media (max-width: 900px) { .variants-layout { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ fit tester */
.fit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.fit-screen-wrap { display: grid; place-items: center; min-height: 380px; padding: clamp(14px, 3vw, 30px); border-radius: 22px; background: linear-gradient(160deg, #2b221b, #1a140f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), var(--shadow); }
.fit-screen { position: relative; width: 100%; overflow: hidden; border-radius: 6px; container-type: inline-size;
  background: repeating-linear-gradient(45deg, #2f261e 0 10px, #29211a 10px 20px);
  box-shadow: 0 0 0 2px #0b0806, 0 0 0 5px #3d3126, 0 20px 40px -20px #000; }
.fit-screen[data-ratio="9:16"] { width: auto; height: min(68vh, 620px); }
.fit-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transition: object-position .15s; }
.fit-dialog { position: absolute; left: 4%; right: 4%; bottom: 4.5%; padding: 2.2cqw 3cqw 2.6cqw; border-width: 2px; transition: opacity .25s; }
.fit-dialog .window-text { min-height: 0; font-size: clamp(9px, 2.6cqw, 17px); line-height: 1.6; }
.fit-screen[data-ratio="9:16"] .fit-dialog .window-text { font-size: clamp(9px, 4.4cqw, 15px); }
.fit-dialog.is-hidden { opacity: 0; }
.fit-controls { display: grid; gap: 18px; }
.fit-controls .seg span { padding: 6px 11px; font-size: 13.5px; }
.fit-controls fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fit-controls legend { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.fit-range { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.fit-range.is-disabled { opacity: .45; }
.fit-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fit-check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 900px) { .fit-layout { grid-template-columns: minmax(0, 1fr); } .fit-screen-wrap { min-height: 0; } }

/* ------------------------------------------------------------ filename decoder */
.start-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .start-layout { grid-template-columns: minmax(0, 1fr); } }
.fname { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #2a211a; color: #f3e9d8; }
.fname code { display: block; font-size: clamp(12.5px, 1.6vw, 15.5px); overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
.fname code span { padding: 1px 3px; border-radius: 4px; transition: background .3s; }
.seg-series { color: #b9a68c; }
.seg-num { color: #ffb37a; background: rgba(255, 179, 122, .14); }
.seg-loc { color: #9fe0a8; background: rgba(159, 224, 168, .13); }
.seg-time { color: #ffd76e; background: rgba(255, 215, 110, .14); }
.fname-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: #d9c8ae; }
.fname-legend b { color: #fff; font-weight: 700; }
.fname-legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k.series { background: #b9a68c; } .k.num { background: #ffb37a; } .k.loc { background: #9fe0a8; } .k.time { background: #ffd76e; }
.fname .btn { --btn-bg: rgba(255, 255, 255, .08); --btn-ink: #f3e9d8; --btn-line: rgba(255, 255, 255, .2); }
.fname.is-flash code span:not(.seg-series) { animation: fname-flash .6s ease; }
@keyframes fname-flash { from { background: rgba(255, 255, 255, .45); } }

/* ------------------------------------------------------------ viewer */
dialog.viewer { background: #16110d; color: #f6ecdf; border-color: #3a2e24; --line: #3a2e24; --ink: #f6ecdf; --ink-2: #d6c5ae; --ink-3: #a8957d; color-scheme: dark; }
.viewer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; max-height: 94vh; }
.viewer-stage { position: relative; background: #000; display: grid; place-items: center; min-height: 0; }
.viewer-stage img { width: 100%; height: auto; max-height: 94vh; aspect-ratio: 3 / 2; object-fit: contain; transition: opacity .2s; }
.viewer-stage img.is-loading { opacity: .55; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .3); transition: background .2s; }
.viewer-nav:hover { background: rgba(0, 0, 0, .8); }
.viewer-nav svg { width: 20px; height: 20px; }
.viewer-nav.prev { left: 12px; } .viewer-nav.next { right: 12px; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.viewer-side { padding: 26px 24px; overflow-y: auto; border-left: 1px solid #3a2e24; }
.viewer-kicker { font: 700 12px/1 var(--font-mono); letter-spacing: .12em; color: #f2b766; margin: 0 0 8px; }
.viewer-side h2 { font-family: var(--font-serif); font-size: 26px; margin-bottom: 14px; }
.viewer-times { width: 100%; }
.viewer-times label { flex: 1; }
.viewer-times span { justify-content: center; width: 100%; padding: 6px 6px; font-size: 13px; }
dialog.viewer .seg input:checked + span { background: #f2b766; color: #24160b; }
dialog.viewer .inspector dt { background: rgba(255, 255, 255, .04); }
.copy-mini { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 4px; vertical-align: middle; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: inherit; }
.copy-mini svg { width: 14px; height: 14px; }
.v-notes { margin: 14px 0; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: 13.5px; color: #d6c5ae; }
.viewer-keys { line-height: 2.2; }
@media (max-width: 900px) {
  .viewer-grid { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .viewer-side { border-left: 0; border-top: 1px solid #3a2e24; }
  .viewer-nav { width: 40px; height: 40px; }
}
