@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500;700&family=DM+Sans:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800;900&display=swap');

:root { font-family: 'DM Sans', 'Noto Sans JP', sans-serif; color: #20251f; background: #f4f1e9; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #626cf2; outline-offset: 3px; }
.page { max-width: 1880px; margin: auto; padding: 36px clamp(18px, 3vw, 48px) 28px; }
.hero { padding: 16px 10px 34px; }
.eyebrow, .section-heading p, .section-kicker, .workspace-top, .workspace-heading p, .comparison-heading p, .inspector-head > p, .explanation-label, .guide article > span, .page-footer, .heading-pill, .source-links, .code-toolbar > span { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .09em; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 13px; color: #007e69; }
.brand-mark { display: inline-block; width: 20px; height: 20px; margin-right: 4px; border: 2px solid #007d68; border-radius: 5px; box-shadow: 5px 5px 0 #b5ff32; }
.hero h1 { margin: 0; font-size: clamp(40px, 5.3vw, 82px); font-weight: 800; line-height: 1.04; letter-spacing: 0; }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 23px; }
.lead { margin: 0; font-size: clamp(16px, 1.45vw, 21px); font-weight: 700; line-height: 1.65; white-space: nowrap; }
.lead strong { color: #646cf4; }
.hero-actions { display: flex; gap: 10px; flex: none; }
.hero-actions button { min-height: 45px; padding: 12px 17px; border: 1px solid #d4d8cf; border-radius: 13px; background: #fff; font-size: 12px; font-weight: 800; transition: transform .18s, box-shadow .18s; }
.hero-actions button:last-child { color: #fff; background: #20251f; border-color: #20251f; }
.hero-actions button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #dbe2d9; }

.lab, .guide { overflow: hidden; border: 1px solid #cbd2c9; border-radius: 27px; background: #fffdf8; box-shadow: 0 13px 40px rgb(31 42 34 / 4%); }
.section-heading { display: flex; align-items: center; gap: 18px; min-height: 98px; padding: 19px 26px; border-bottom: 1px solid #cad1c9; }
.section-number { display: grid; place-items: center; flex: none; width: 51px; height: 51px; border-radius: 14px; color: #fff; background: #ff6956; font: 800 13px 'DM Mono', monospace; }
.section-number.blue { background: #646cf4; }
.section-heading p { margin: 0 0 5px; color: #00806b; }
.section-heading h2 { margin: 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.25; }
.heading-pill { margin-left: auto; padding: 8px 11px; border-radius: 99px; color: #007b67; background: #e9f5ee; white-space: nowrap; }
.lab-grid { display: grid; grid-template-columns: minmax(255px, 280px) minmax(0, 1fr) minmax(310px, 335px); }

.controls { min-width: 0; border-right: 1px solid #cad1c9; }
.control-section { padding: 23px 20px; border-bottom: 1px solid #d9ddd6; container-type: inline-size; }
.control-section:last-child { border-bottom: 0; }
.section-kicker { margin: 0 0 8px; color: #007d69; }
.control-section h3 { margin: 0 0 16px; font-size: 16px; line-height: 1.3; }
.control-note { margin: 12px 0 0; color: #5e6b61; font-size: 10px; font-weight: 600; line-height: 1.7; }
.control-note code { color: #4e58d1; font-family: 'DM Mono', monospace; }
.operation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.operation-grid button { display: grid; gap: 2px; min-width: 0; min-height: 79px; padding: 9px 10px; border: 1px solid #cbd3ca; border-radius: 11px; background: #fff; text-align: left; }
.operation-grid button[aria-pressed='true'] { border: 2px solid #20251f; padding: 8px 9px; background: #b5ff32; box-shadow: 3px 3px 0 #20251f; }
.operation-grid button:hover { border-color: #626cf2; }
.operation-grid button span { font: 800 12px 'DM Mono', monospace; }
.operation-grid button b { font: 900 17px 'DM Sans', sans-serif; }
.operation-grid button small { color: #5a685d; font-size: 10px; font-weight: 700; }
.layer-key { display: grid; gap: 8px; margin: 0 0 17px; }
.layer-key span { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; }
.layer-dot { display: inline-block; flex: none; width: 12px; height: 12px; border: 2px solid #20251f; border-radius: 50%; }
.layer-dot--a { background: #ff6956; }
.layer-dot--b { background: #7277f5; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.preset-grid button { min-height: 39px; padding: 6px 4px; border: 1px solid #cbd3ca; border-radius: 8px; background: #fff; font-size: 10px; font-weight: 800; }
.preset-grid button[aria-pressed='true'] { border-color: #20251f; background: #20251f; color: #fff; }
.preset-grid button:hover:not([aria-pressed='true']) { border-color: #626cf2; }
.range-group { display: grid; gap: 14px; margin-top: 20px; }
.range-group label { display: block; }
.range-group label > span { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 800; }
.range-group output { color: #5e65ec; font-family: 'DM Mono', monospace; }
.range-group input { width: 100%; margin: 10px 0 0; accent-color: #646cf4; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid #c9d3ca; border-radius: 11px; background: #e9eee8; }
.segmented button { min-height: 38px; padding: 7px 5px; border: 0; border-radius: 8px; background: transparent; font-size: 11px; font-weight: 800; }
.segmented button[aria-pressed='true'] { color: #fff; background: #20251f; box-shadow: 0 2px 4px rgb(0 0 0 / 14%); }
.segmented button:hover:not([aria-pressed='true']) { color: #3949bc; }
@container (min-width: 430px) { .operation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.workspace { min-width: 0; background: #edf3ef; }
.workspace-top { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 12px 20px; border-bottom: 1px solid #bfcdc2; color: #52645b; background: #d6dfd7; letter-spacing: 0; }
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 8px; height: 8px; border-radius: 50%; background: #ff6956; }
.window-dots i:nth-child(2) { background: #ffd36b; }
.window-dots i:nth-child(3) { background: #53c4a5; }
.workspace-top strong { margin-left: auto; padding: 7px 9px; border-radius: 99px; color: #fff; background: #007e6b; font: 800 10px 'DM Mono', monospace; }
.workspace-body { padding: 21px 18px 26px; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.workspace-heading p { margin: 0 0 5px; color: #007d69; }
.workspace-heading h3 { margin: 0; font-size: 18px; }
.workspace-heading button { flex: none; min-height: 35px; padding: 7px 10px; border: 1px solid #bdd1c0; border-radius: 8px; color: #205d4e; background: #fff; font-size: 10px; font-weight: 800; }
.workspace-heading button:hover { border-color: #626cf2; }
.mask-equation { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 auto 15px; font: 900 16px 'DM Sans', sans-serif; }
.mask-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; padding: 5px 10px; border: 1px solid #becdc0; border-radius: 99px; background: #fff; font-size: 12px; }
.mask-chip small { color: #647268; font-size: 10px; }
.mask-chip--result { border-color: #20251f; color: #fff; background: #20251f; font: 800 10px 'DM Mono', monospace; }
.result-frame, .mini-frame { position: relative; overflow: hidden; background-color: #202434; background-image: linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px); background-size: 25px 25px; }
.result-frame { width: min(100%, 520px); aspect-ratio: 1; margin: auto; border: 2px solid #20251f; border-radius: 17px; box-shadow: 8px 9px 0 rgb(24 34 25 / 15%); }
.mask-art { width: 100%; height: 100%; }
.mask-guide { position: absolute; top: 50%; z-index: 2; border: 2px dashed #ff806f; border-radius: 50%; cursor: grab; touch-action: none; transform: translate(-50%, -50%); }
.mask-guide:active { cursor: grabbing; }
.mask-guide--a { border-color: #ff806f; }
.mask-guide--b { z-index: 3; border-color: #858bff; }
.mask-guide span { position: absolute; top: -13px; left: 50%; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid #20251f; border-radius: 50%; color: #20251f; background: #ff806f; font: 900 11px 'DM Mono', monospace; transform: translateX(-50%); }
.mask-guide--b span { background: #858bff; }
.result-frame[data-guides='off'] .mask-guide { display: none; }
.result-caption { max-width: 520px; margin: 18px auto 0; color: #405c4c; font-size: 12px; font-weight: 700; line-height: 1.6; }
.comparison { margin-top: 30px; padding-top: 20px; border-top: 1px solid #c9d8ca; }
.comparison-heading p { margin: 0 0 5px; color: #007d69; }
.comparison-heading h4 { margin: 0 0 15px; font-size: 16px; }
.comparison-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.comparison-grid button { min-width: 0; padding: 6px; border: 1px solid #c7d6ca; border-radius: 10px; background: #fffdfa; text-align: left; }
.comparison-grid button[aria-pressed='true'] { padding: 5px; border: 2px solid #20251f; background: #b5ff32; }
.comparison-grid button:hover { border-color: #626cf2; }
.mini-frame { display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; background-size: 17px 17px; }
.mini-art { display: block; width: 100%; height: 100%; }
.comparison-grid b { display: block; overflow: hidden; padding: 7px 2px 0; font: 800 10px 'DM Mono', monospace; text-overflow: ellipsis; }
.comparison-grid small { display: block; padding: 3px 2px 1px; color: #536358; font-size: 10px; font-weight: 800; }

.inspector { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid #20251f; color: #f7faf5; background: #252923; }
.inspector-head { padding: 25px 20px 19px; border-bottom: 1px solid #454d43; }
.inspector-head > p { margin: 0 0 7px; color: #a9bbb0; }
.inspector-head h3 { display: inline-block; margin: 0; font-size: 21px; }
.inspector-head > span { float: right; padding: 7px 9px; border-radius: 99px; color: #20251f; background: #b5ff32; font: 800 10px 'DM Mono', monospace; }
.inspector-explanation { padding: 18px 20px; border-bottom: 1px solid #454d43; }
.explanation-label { margin: 0 0 7px; color: #acbbad; }
.inspector-explanation strong { display: block; margin: 0 0 10px; color: #b5ff32; font: 900 18px 'DM Mono', monospace; }
.inspector-explanation p:not(.explanation-label) { margin: 0 0 17px; font-size: 12px; font-weight: 700; line-height: 1.65; }
.inspector-explanation p:last-child { margin-bottom: 0; }
.inspector-explanation code { color: #d5b5ff; font-family: 'DM Mono', monospace; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 14px 10px; }
.code-toolbar > span { padding-left: 5px; color: #b5ff32; }
#copyCssButton { flex: none; min-height: 35px; padding: 9px; border: 0; border-radius: 8px; color: #20251f; background: #fff; font-size: 10px; font-weight: 900; }
#copyCssButton:hover { background: #b5ff32; }
.code-block { overflow: auto; max-height: 640px; margin: 0 13px; padding: 16px 14px; border: 1px solid #465047; border-radius: 12px; color: #dcf2ce; background: #171d17; font: 500 10px/1.65 'DM Mono', monospace; tab-size: 2; white-space: pre; }
.code-footnote { margin: 0; padding: 17px 20px 22px; color: #adbdac; font-size: 10px; line-height: 1.7; }

.guide { margin-top: 22px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px; }
.guide article { min-width: 0; padding: 19px; border: 1px solid #d4dcd3; border-radius: 16px; background: #fff; }
.guide article > span { color: #626af3; }
.guide h3 { margin: 14px 0 8px; font-size: 16px; }
.guide article p { margin: 0; color: #5e6b61; font-size: 11px; line-height: 1.65; }
.guide article code { color: #4e58d1; font-family: 'DM Mono', monospace; }
.source-links { margin: 0 20px 22px; color: #66756a; font-size: 10px; line-height: 1.6; letter-spacing: 0; }
.source-links a { color: #4e56cf; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 4px 0; color: #647168; }
.toast { position: fixed; z-index: 100; bottom: 22px; left: 50%; padding: 12px 18px; border-radius: 99px; color: #fff; background: #20251f; box-shadow: 0 10px 28px #0003; font-size: 12px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .18s, transform .18s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1380px) { .lab-grid { grid-template-columns: minmax(255px, 280px) minmax(0, 1fr); } .inspector { grid-column: 1 / -1; border-top: 1px solid #20251f; border-left: 0; } .code-block { max-height: 420px; } }
@media (max-width: 1100px) { .hero-bottom { align-items: flex-start; flex-direction: column; } }
@media (max-width: 900px) { .lab-grid { grid-template-columns: 1fr; } .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; } .control-section { border-right: 1px solid #d9ddd6; } .control-section:nth-child(2n) { border-right: 0; } .workspace { border-top: 1px solid #cad1c9; } .inspector { grid-column: auto; } }
@media (max-width: 680px) { .controls { display: block; } .control-section { border-right: 0; } .guide-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .page { padding: 18px 12px 20px; } .hero { padding: 15px 4px 25px; } .hero h1 { font-size: clamp(38px, 10vw, 55px); } .lead { font-size: 15px; white-space: normal; } .hero-actions { width: 100%; } .hero-actions button { flex: 1; padding: 11px 8px; } .lab, .guide { border-radius: 20px; } .section-heading { min-height: 84px; padding: 16px; } .section-heading h2 { font-size: 18px; } .section-number { width: 44px; height: 44px; border-radius: 12px; } .heading-pill { display: none; } .control-section { padding: 20px 18px; } .workspace-top { padding-inline: 13px; } .workspace-body { padding: 18px 13px 21px; } .workspace-heading h3 { font-size: 16px; } .workspace-heading button { font-size: 10px; } .mask-equation { gap: 5px; font-size: 13px; } .mask-chip { padding: 4px 7px; } .comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .guide-grid { padding: 14px; } .page-footer { flex-direction: column; gap: 7px; } }
@media (prefers-reduced-motion: reduce) { .hero-actions button, .toast { transition: none; } }
