:root {
  color-scheme: light;
  --ink: #19231d;
  --muted: #647369;
  --paper: #f4f1e9;
  --white: #fffef9;
  --line: #cbd5cc;
  --green: #b7ff31;
  --teal: #008b74;
  --purple: #6c70f4;
  --orange: #ff6d55;
  font-family: Inter, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
.page { width: min(100% - 44px, 1540px); margin: 0 auto; }
.hero { padding: 44px 20px 32px; }
.eyebrow, .section-heading p, .section-kicker, .workspace-intro p, .panel-label span, .panel-note, .region-legend, .inspector-head p, .summary-label, .code-toolbar, .guide-grid article > span, .source-links, .page-footer, .workspace-top, .heading-pill { font: 800 11px/1.45 "SFMono-Regular", Consolas, monospace; letter-spacing: .07em; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 15px; color: var(--teal); }
.brand-mark { position: relative; width: 18px; height: 18px; border: 2px solid var(--purple); border-radius: 5px; }
.brand-mark::after { position: absolute; inset: 5px -7px -7px 5px; z-index: -1; border-radius: 5px; background: var(--green); content: ""; }
h1 { margin-bottom: 18px; font-size: clamp(42px, 5.1vw, 78px); font-weight: 900; line-height: 1; letter-spacing: 0; }
.hero-bottom { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.lead { margin: 0; font-size: clamp(17px, 1.8vw, 23px); font-weight: 850; line-height: 1.4; }
.lead strong { color: var(--purple); }
.hero-actions { display: flex; gap: 10px; flex: none; }
.hero-actions button, .code-toolbar button { min-height: 44px; padding: 0 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); color: var(--ink); font-size: 12px; font-weight: 850; transition: transform 160ms ease, box-shadow 160ms ease; }
.hero-actions button:last-child { border-color: var(--ink); background: var(--ink); color: #fff; }
.hero-actions button:hover, .code-toolbar button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgb(24 34 29 / 12%); }
.lab, .guide { overflow: hidden; border: 1px solid var(--line); border-radius: 27px; background: var(--white); box-shadow: 0 16px 45px rgb(33 55 40 / 6%); }
.section-heading { display: flex; align-items: center; gap: 15px; min-height: 92px; padding: 17px 24px; border-bottom: 1px solid var(--line); }
.section-number { display: grid; flex: none; place-items: center; width: 53px; height: 53px; border-radius: 16px; background: var(--orange); color: #fff; font: 900 14px "SFMono-Regular", Consolas, monospace; }
.section-number--purple { background: var(--purple); }
.section-heading p { margin: 0 0 3px; color: var(--teal); }
.section-heading h2 { margin: 0; font-size: clamp(21px, 2.4vw, 31px); line-height: 1.2; font-weight: 900; }
.heading-pill { margin-left: auto; padding: 9px 12px; border-radius: 999px; background: #e7f7ef; color: var(--teal); white-space: nowrap; }
.lab-grid { display: grid; grid-template-columns: minmax(258px, 270px) minmax(0, 1fr) minmax(274px, 300px); align-items: stretch; }
.controls { border-right: 1px solid var(--line); background: #f8f6ef; }
.control-section { padding: 23px 19px 25px; border-bottom: 1px solid var(--line); }
.control-section:last-child { border-bottom: 0; }
.section-kicker { margin: 0 0 6px; color: var(--teal); }
.control-section h3 { margin: 0 0 16px; font-size: 18px; font-weight: 900; }
.preset-list { display: grid; gap: 8px; }
.preset-list button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 59px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); text-align: left; transition: transform 160ms ease, background-color 160ms ease; }
.preset-list button:hover { transform: translateX(3px); }
.preset-list button[aria-pressed="true"] { border: 2px solid var(--ink); background: var(--green); box-shadow: 3px 4px 0 var(--ink); }
.preset-list button b, .preset-list button small { display: block; }
.preset-list button b { font-size: 12px; }
.preset-list button small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 750; }
.preset-icon { flex: none; width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: 7px; background: var(--preset-image) center / cover; }
.preset-icon--confetti { --preset-image: url("./confetti.svg"); }
.preset-icon--neon { --preset-image: url("./neon.svg"); }
.preset-icon--postage { --preset-image: url("./postage.svg"); }
.range-group { display: grid; gap: 21px; }
.range-group label, .preview-width { display: grid; gap: 11px; }
.range-group label > span, .preview-width > span { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 850; }
output { color: var(--purple); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
input[type="range"] { width: 100%; margin: 0; accent-color: var(--purple); cursor: pointer; }
.control-note { margin: 15px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.65; }
.control-note code { color: var(--teal); font-size: 11px; }
.repeat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.repeat-list button { min-height: 50px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 850; text-align: left; transition: transform 160ms ease, background-color 160ms ease; }
.repeat-list button:hover { transform: translateY(-2px); }
.repeat-list button[aria-pressed="true"] { border: 2px solid var(--ink); background: var(--green); }
.repeat-list small { display: block; margin-top: 1px; color: var(--muted); font: 750 10px "SFMono-Regular", Consolas, monospace; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.toggle-row b, .toggle-row small { display: block; }
.toggle-row b { font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--muted); font: 750 10px "SFMono-Regular", Consolas, monospace; }
.toggle-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--purple); }
.control-note--fill { margin-top: 8px; }
.preview-width { margin-top: 21px; }
.workspace { min-width: 0; background: #e9efea; }
.workspace-top { display: flex; align-items: center; gap: 10px; min-height: 53px; padding: 0 18px; border-bottom: 1px solid #c5d0c6; background: #d7e2d8; color: #55665a; font-size: 10px; }
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 8px; height: 8px; border-radius: 50%; background: #ff7058; }
.window-dots i:nth-child(2) { background: #ffd568; }
.window-dots i:nth-child(3) { background: #63caa7; }
.workspace-top strong { margin-left: auto; padding: 6px 10px; border-radius: 999px; background: var(--teal); color: white; font-size: 10px; letter-spacing: 0; }
.workspace-body { container-type: inline-size; padding: 22px; }
.workspace-intro { margin-bottom: 20px; }
.workspace-intro p { margin: 0 0 4px; color: var(--teal); font-size: 10px; }
.workspace-intro h3 { margin: 0; font-size: clamp(18px, 1.6vw, 23px); font-weight: 900; }
.visual-grid { display: grid; grid-template-columns: minmax(245px, .76fr) minmax(0, 1.24fr); gap: 13px; }
.source-panel, .result-panel { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fffdf7; }
.result-panel { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple), 4px 5px 0 rgb(110 115 245 / 20%); }
.panel-label { min-height: 60px; padding-bottom: 12px; border-bottom: 1px solid #d7ded4; }
.panel-label span { color: var(--teal); font-size: 10px; }
.panel-label h4 { margin: 5px 0 0; font-size: 17px; font-weight: 900; }
.source-stage, .result-stage { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; place-items: center; min-height: 340px; padding: 25px 8px; }
.source-stage { background: radial-gradient(circle at center, #f6f8f2 0 1px, transparent 1px) 0 0 / 14px 14px; }
.result-stage { background: linear-gradient(90deg, #ecf0e9 1px, transparent 1px) 0 0 / 21px 21px, linear-gradient(#ecf0e9 1px, transparent 1px) 0 0 / 21px 21px; }
.source-image { position: relative; width: min(100%, 240px); aspect-ratio: 1; background: url("./confetti.svg") center / contain no-repeat; box-shadow: 7px 8px 0 rgb(23 32 28 / 13%); --slice-percent: 20%; }
.slice-line { position: absolute; z-index: 1; pointer-events: none; }
.slice-line--left, .slice-line--right { top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--purple); }
.slice-line--left { left: var(--slice-percent); }
.slice-line--right { right: var(--slice-percent); }
.slice-line--top, .slice-line--bottom { right: 0; left: 0; height: 0; border-top: 2px dashed var(--purple); }
.slice-line--top { top: var(--slice-percent); }
.slice-line--bottom { bottom: var(--slice-percent); }
.slice-cell { position: absolute; z-index: 2; display: grid; place-items: center; padding: 2px 3px; border-radius: 4px; background: rgb(255 255 255 / 88%); color: #3937b3; font-size: 10px; font-weight: 900; line-height: 1.1; pointer-events: none; }
.slice-cell--corner { top: 7%; left: 7%; }
.slice-cell--edge { top: 7%; left: 50%; transform: translateX(-50%); }
.slice-cell--center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.border-frame { display: grid; place-items: center; width: 340px; max-width: 100%; min-height: 240px; background: #fff; text-align: center; }
.preview-content { padding: 20px 12px; }
.preview-content span { color: var(--teal); font: 850 10px "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; }
.preview-content strong { display: block; margin-top: 13px; font-size: clamp(18px, 1.8vw, 25px); font-weight: 900; line-height: 1.35; }
.preview-content p { max-width: 260px; margin: 12px auto 0; color: #4f5c52; font-size: 11px; font-weight: 650; line-height: 1.6; }
.panel-note { min-height: 49px; margin: 0; padding-top: 12px; border-top: 1px solid #d7ded4; color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 650; line-height: 1.55; letter-spacing: 0; }
.panel-note code { color: var(--purple); }
.region-legend { display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 17px; padding: 13px 15px; border: 1px solid #c9d7cb; border-radius: 10px; background: #f8fff2; color: #526357; font-family: inherit; font-size: 11px; font-weight: 750; letter-spacing: 0; }
.region-legend span { display: inline-flex; align-items: center; gap: 6px; }
.region-legend i { display: block; width: 11px; height: 11px; border: 2px solid var(--ink); }
.legend-corner { border-radius: 50%; background: var(--purple); }
.legend-edge { transform: rotate(45deg); background: var(--green); }
.legend-center { background: #e9f7df; }
.proof-panel { margin-top: 19px; padding: 17px; border: 1px solid #c9d7cb; border-radius: 15px; background: #f8faf5; }
.proof-heading span, .proof-unit > span { color: var(--teal); font: 850 10px "SFMono-Regular", Consolas, monospace; letter-spacing: .07em; }
.proof-heading h4 { margin: 5px 0 17px; font-size: 17px; font-weight: 900; }
.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: end; gap: 15px; }
.proof-unit { display: grid; justify-items: center; gap: 8px; min-width: 0; width: 100%; }
.proof-unit > span { justify-self: start; }
.proof-card { min-height: 143px; background: #fff; color: var(--ink); font-size: 13px; text-align: center; }
.proof-card--compact { width: min(100%, 230px); }
.proof-card--wide { width: min(100%, 360px); }
.proof-card strong { padding: 8px; font-weight: 900; }
.inspector { min-width: 0; background: #202620; color: #f8fcf4; }
.inspector-head { position: relative; min-height: 100px; padding: 25px 20px 18px; border-bottom: 1px solid #3f4c40; }
.inspector-head p { margin: 0 0 8px; color: #a7b7a7; }
.inspector-head h3 { margin: 0; font-size: 19px; font-weight: 900; }
.inspector-head > span { position: absolute; top: 42px; right: 15px; padding: 5px 7px; border-radius: 999px; background: var(--green); color: #142018; font: 900 10px "SFMono-Regular", Consolas, monospace; }
.inspector-summary { padding: 21px 19px; border-bottom: 1px solid #3f4c40; }
.summary-label { margin: 0 0 8px; color: #a8b7a9; font-size: 10px; }
.inspector-summary strong { color: var(--green); font-size: 17px; font-weight: 900; }
.inspector-summary > p:last-child { margin: 12px 0 0; color: #d5e0d4; font-size: 11px; font-weight: 650; line-height: 1.65; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 20px 18px 10px; color: var(--green); }
.code-toolbar button { min-height: 35px; padding: 0 10px; border: 0; border-radius: 9px; font-size: 11px; }
.code-block { overflow: auto; margin: 0 16px; padding: 16px 13px; border: 1px solid #475348; border-radius: 12px; background: #151c17; white-space: pre; tab-size: 2; }
.code-block code { color: #e6f2df; font: 11px/1.65 "SFMono-Regular", Consolas, monospace; }
.download-link { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; margin: 17px 16px 0; border: 1px solid #a2f334; border-radius: 11px; background: var(--green); color: var(--ink); font-size: 12px; font-weight: 900; text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
.download-link:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #5a9024; }
.download-link span { font-size: 18px; line-height: 1; }
.code-footnote { margin: 15px 18px 24px; color: #aab8aa; font-size: 11px; line-height: 1.6; }
.guide { margin-top: 20px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px 22px 14px; }
.guide-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.guide-grid article > span { color: var(--purple); }
.guide-grid h3 { margin: 17px 0 8px; font-size: 17px; font-weight: 900; }
.guide-grid p { margin: 0; color: #526457; font-size: 12px; font-weight: 650; line-height: 1.65; }
.guide-grid code, .source-links a { color: var(--purple); }
.source-links { margin: 4px 23px 21px; color: var(--muted); font-size: 12px; font-family: inherit; letter-spacing: 0; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; padding: 25px 4px 32px; color: #7c8b7e; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 10; width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 12px 17px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@container (max-width: 760px) { .visual-grid { grid-template-columns: 1fr; } .source-stage, .result-stage { min-height: 305px; } .proof-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1210px) { .lab-grid { grid-template-columns: 270px minmax(0, 1fr); } .inspector { grid-column: 1 / -1; } .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .page { width: min(100% - 24px, 560px); } .hero { padding: 29px 4px 24px; } .hero-bottom { display: block; } .hero-actions { margin-top: 17px; } .section-heading { padding: 15px; } .heading-pill { display: none; } .lab-grid { display: block; } .controls { border-right: 0; } .control-section { padding: 20px; } .preset-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } .preset-list button { display: block; min-width: 0; } .preset-icon { display: block; margin-bottom: 6px; } .workspace-body { padding: 14px; } .guide-grid { grid-template-columns: 1fr; padding: 15px; } .guide-grid article { padding: 15px; } .page-footer { font-size: 10px; } }
@media (max-width: 390px) { .page { width: min(100% - 16px, 560px); } h1 { font-size: 40px; } .hero-actions button { padding-inline: 13px; } .section-heading h2 { font-size: 20px; } .preset-list { gap: 6px; } .preset-list button { padding: 6px; } .preset-list button b { font-size: 10px; } .preset-list button small { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
