:root {
  color-scheme: light;
  --paper: #f8f9f6;
  --white: #fff;
  --ink: #1b2440;
  --muted: #545e73;
  --blue: #284bd7;
  --dark-blue: #1d38bc;
  --line: #dce2e0;
  --pale: #edf0fb;
  --body: 'DM Sans', Arial, sans-serif;
  --display: 'Instrument Serif', Georgia, serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font: 1rem/1.55 var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, textarea, select, input { font: inherit; }
button, select, summary { cursor: pointer; }
a { color: var(--dark-blue); text-underline-offset: .22em; }
button, textarea, select { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #5577ed; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(1184px, calc(100% - 88px)); margin-inline: auto; }
.skip { position: fixed; z-index: 3; top: .5rem; left: .5rem; padding: .75rem; transform: translateY(-150%); background: white; }
.skip:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { min-height: 73px; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; gap: .62rem; align-items: center; font-weight: 800; font-size: 1.26rem; letter-spacing: -.065em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; background: var(--blue); color: white; border-radius: 9px; display: inline-grid; place-content: center; position: relative; font: 1.5rem/.8 var(--display); letter-spacing: -.12em; padding-right: 5px; padding-bottom: 3px; }
.brand-mark span { position: absolute; right: 5px; bottom: 5px; font-size: .8em; font-style: italic; color: #e6f581; }
.brand-accent { color: var(--blue); }
.header-inner nav, .footer-inner nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.6vw, 2rem); }
.header-inner nav a, .footer-inner nav a { color: var(--ink); text-decoration: none; font-size: .94rem; font-weight: 600; }
.header-inner nav a:hover,.footer-inner nav a:hover { color: var(--blue); }
.header-button { margin-left: auto; display: inline-flex; align-items: center; gap: .65rem; padding: .55rem .92rem; border: 1px solid #ccd5f7; border-radius: 8px; color: #233ea9; background: #eef1ff; text-decoration: none; font-weight: 700; font-size: .88rem; white-space: nowrap; }
.header-button:hover { background: #e0e7ff; }
.section-kicker, .breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .875rem; font-weight: 650; }
.section-kicker { font: 650 .8rem/1.45 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: #334dac; }
.section-kicker span { font-size: .95rem; }
.hero { padding-top: clamp(2.7rem, 5vw, 4.55rem); }
.hero.is-inner { padding-top: 2.5rem; }
h1, h2 { font-family: var(--display); font-weight: 400; }
.hero h1 { font-size: clamp(4.15rem, 8.1vw, 7.2rem); line-height: .92; letter-spacing: -.052em; margin-top: .55rem; }
.is-inner h1 { font-size: clamp(3.35rem, 6.9vw, 6rem); margin-top: .75rem; }
.hero-period { color: var(--blue); }
.hero-intro { font-size: clamp(1rem, 2.1vw, 1.17rem); color: var(--muted); max-width: 685px; margin-top: 1rem; }
.workbench { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(1.1rem, 2.3vw, 1.75rem); margin-top: 1.9rem; padding: clamp(1.1rem, 2.3vw, 1.65rem); background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 24px #2d3f6510; scroll-margin-top: 1rem; }
.editor, .stage-column { min-width: 0; }
.segments { display: grid; grid-template-columns: 1fr 1fr; background: #eef0f4; border: 1px solid #e8ebef; padding: 4px; gap: 4px; border-radius: 10px; margin-bottom: .95rem; }
.segments button { border: 0; border-radius: 7px; min-height: 34px; background: transparent; color: #4e5871; font-weight: 750; font-size: .88rem; }
.segments button[aria-pressed='true'] { background: #fff; color: #2540b0; box-shadow: 0 1px 4px #252e5619; }
.segments button:hover:not([aria-pressed='true']) { background: #e1e5ed; }
.field-heading { display: flex; align-items: center; justify-content: space-between; }
label, .text-button { font-size: .86rem; font-weight: 750; }
.text-button { min-height: 30px; border: 0; background: none; color: var(--muted); padding: 0 .2rem; }
.text-button:hover { text-decoration: underline; }
textarea { width: 100%; display: block; resize: vertical; min-height: 87px; border-radius: 9px; padding: .65rem .8rem; border: 1px solid #d5dce6; background: #fbfcfe; font-size: 1.12rem; font-weight: 600; line-height: 1.35; margin-top: .2rem; }
.input-meta { display: flex; gap: .45rem; justify-content: space-between; align-items: flex-start; margin-top: .6rem; margin-bottom: .92rem; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; min-width: 0; }
.examples button { background: #f1f3f6; border: 1px solid #e8ebf0; padding: .23rem .47rem; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 5px; color: #4a556f; font-size: .75rem; }
.examples button:hover { border-color: #9aaafa; background: #eaf0ff; }
.count { padding-top: .18rem; color: #626c82; font: .75rem/1.35 var(--mono); flex-shrink: 0; }
select { inline-size: 100%; min-height: 42px; border: 1px solid #d5dce6; margin-top: .3rem; border-radius: 8px; background-color: #fff; appearance: none; padding: .4rem 1.8rem .4rem .62rem; font-size: .93rem; font-weight: 650; }
.editor label + select, .option-row select, .tuning-grid select { background-image: linear-gradient(45deg, transparent 50%, #495d91 50%), linear-gradient(135deg, #495d91 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.option-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: .75rem; }
.option-row.reading-option { grid-template-columns: minmax(0, 1fr); }
.actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .95rem; }
.primary, .secondary { min-height: 42px; border: 1px solid var(--blue); border-radius: 8px; padding: .42rem .9rem; font-weight: 750; font-size: .9rem; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--dark-blue); }
.secondary { color: #2540b0; background: #f0f3ff; border-color: #dbe2ff; }
.secondary:hover { background: #e2e9ff; }
.primary:disabled, .secondary:disabled, .style-card button:disabled { opacity: .55; cursor: default; }
.action-status { align-self: center; font-size: .82rem; color: var(--dark-blue); }
.action-status:empty { display: none; }
.design-tuning { margin-top: .7rem; padding: .46rem .58rem; border: 1px solid #e1e5ee; border-radius: 7px; }
.design-tuning summary { font-size: .86rem; font-weight: 650; }
.tuning-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-block: .65rem; }
.tuning-grid label { display: block; }
.tuning-grid input, .reading-tuning input { display: block; width: 100%; margin: .25rem 0 .1rem; accent-color: var(--blue); }
.tuning-grid input[type='color'] { height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.check { display: flex; align-items: center; gap: .35rem; }
.check input { accent-color: var(--blue); }
.reading-tuning { display: grid; gap: .15rem; margin-top: .6rem; }
.reading-tuning label { display: flex; justify-content: space-between; }
.reading-tuning output { color: var(--muted); font-family: var(--mono); }

.stage-column { display: flex; flex-direction: column; }
.stage { --stage-bg: #284bd7; --stage-ink: #f4f8ff; --stage-accent: #e0f37d; --stage-lines: #dfe6ff24; min-height: 316px; flex: 1; display: grid; grid-template-rows: auto minmax(200px,1fr) auto; position: relative; isolation: isolate; overflow: hidden; color: var(--stage-ink); background-color: var(--stage-bg); border-radius: 13px; border: 1px solid #202d4430; }
.stage[data-theme='sunset'] { --stage-bg: #391c50; --stage-ink: #ffeadb; --stage-accent: #ffd386; --stage-lines: #ffbfce2c; }
.stage[data-theme='night'] { --stage-bg: #142341; --stage-ink: #e3fcff; --stage-accent: #70ebf9; --stage-lines: #b9e9ff25; }
.stage[data-theme='plum'] { --stage-bg: #6251b4; --stage-ink: #fff0fa; --stage-accent: #ffde87; --stage-lines: #f8dfff33; }
.stage[data-theme='candy'] { --stage-bg: #73257b; --stage-ink: #fff0f8; --stage-accent: #ffd38b; --stage-lines: #f8dfff33; }
.stage[data-theme='acid'] { --stage-bg: #1d342e; --stage-ink: #e3fac5; --stage-accent: #e5fb88; --stage-lines: #d3f5aa36; }
.stage:not(.reading-stage)::before { content: ''; z-index: -1; position: absolute; inset: 0; background-image: linear-gradient(to right, var(--stage-lines) 1px, transparent 1px), linear-gradient(to bottom, var(--stage-lines) 1px, transparent 1px); background-size: 35px 35px; mask-image: linear-gradient(105deg, #0005, black); }
.stage-top, .stage-bottom { display: flex; align-items: center; padding: .85rem 1rem; gap: .6rem; justify-content: space-between; position: relative; z-index: 1; min-height: 46px; }
.stage-top { border-bottom: 1px solid var(--stage-lines); }
.stage-bottom { border-top: 1px solid var(--stage-lines); padding-block: .45rem; font-size: .9rem; font-weight: 650; }
.stage-label { display: inline-flex; align-items: center; gap: .42rem; font-size: .88rem; font-weight: 750; }
.live-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--stage-accent); }
.stage-format { font: .76rem var(--mono); letter-spacing: .065em; }
.stage-star { color: var(--stage-accent); font-size: 1.35rem; line-height: 1; }
.stage-art { display: grid; align-items: center; justify-items: center; overflow: hidden; isolation: isolate; position: relative; min-width: 0; padding: .8rem 1rem; }
.stage-decoration { color: #ffffff1d; position: absolute; z-index: -1; font: italic 13rem/.9 var(--display); letter-spacing: -.08em; transform: rotate(-12deg); pointer-events: none; user-select: none; }
.stage-text { font-family: var(--specimen-font, Georgia), 'Segoe UI Symbol', 'Cambria Math', serif; font-size: clamp(2rem, 4.5vw, 4.2rem); line-height: 1.14; width: 100%; max-height: 397px; overflow: auto; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; }
.stage-text[data-length='medium'] { font-size: clamp(1.65rem, 3vw, 2.9rem); }
.stage-text[data-length='long'] { font-size: clamp(1.2rem, 2vw, 1.75rem); }
.stage[data-mode='image'] .stage-decoration, .reading-stage .stage-decoration { display: none; }
.live-canvas { background-color: #f1f2f6; background-image: conic-gradient(#dce3f0 25%, #f1f2f6 0 50%, #dce3f0 0 75%, #f1f2f6 0); background-size: 16px 16px; display: block; width: 100%; max-width: 100%; max-height: 280px; block-size: auto; object-fit: contain; border-radius: 7px; }
.reading-stage { --stage-bg: #edf0fc; --stage-ink: #1a2858; --stage-accent: #2c49c4; --stage-lines: #d4dcf8; }
.reading-stage .stage-text { text-align: start; font: var(--reading-size, 24px)/var(--reading-leading, 1.6) var(--specimen-font, Arial), sans-serif; letter-spacing: var(--reading-spacing, 0); color: #19233a; align-self: start; padding: .45rem .35rem; }
.stage-hint { font-size: .82rem; color: var(--muted); margin-top: .55rem; }
.no-script { color: var(--muted); margin-top: 1rem; }

.section { margin-top: clamp(3rem, 5vw, 5rem); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.section h2 { font-size: clamp(2.28rem, 4.2vw, 3.65rem); line-height: 1; letter-spacing: -.039em; }
.section-heading p { margin-top: .5rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; }
.filters button { border: 1px solid var(--line); background: #fff; font-size: .85rem; font-weight: 700; border-radius: 99px; padding: .35rem .75rem; min-height: 36px; }
.filters button:hover { border-color: #7b8de2; }
.filters button[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.style-grid, .tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; }
.style-card { display: grid; grid-template-rows: auto minmax(55px,1fr) auto; min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: .75rem; background: #fff; }
.style-card:has(button:hover), .style-card:focus-within { border-color: #a1afea; }
.style-card-top,.style-card-bottom { display: flex; justify-content: space-between; gap: .4rem; align-items: center; }
.style-card-top h3, .tool-info h3 { font-size: .98rem; line-height: 1.22; font-weight: 800; }
.style-card-top span,.style-card-bottom span { color: var(--muted); font-size: .76rem; }
.card-preview { overflow-wrap: anywhere; white-space: pre-wrap; max-height: 130px; overflow: hidden; color: #26385f; padding: .45rem 0; font-family: var(--specimen-font, Georgia), 'Segoe UI Symbol', 'Cambria Math', serif; font-size: 1.49rem; line-height: 1.2; align-self: center; }
.style-marker { color: #185042; }
.style-balloon { color: #573eac; }
.style-card button { min-height: 32px; border: 1px solid #dae1fe; background: #eff2ff; color: #2540b0; border-radius: 6px; padding: .17rem .5rem; white-space: nowrap; font-size: .75rem; font-weight: 750; }
.style-card button:hover { background: #e1e7ff; }
.tool-card { border: 1px solid var(--line); border-radius: 11px; background: #fff; overflow: hidden; text-decoration: none; color: var(--ink); }
.tool-card:hover { border-color: #8799e9; }
.tool-card:hover h3 { color: var(--blue); }
.tool-sample { min-height: 84px; display: grid; place-content: center; text-align: center; padding: .75rem .42rem; font-family: var(--specimen-font, Georgia), 'Segoe UI Symbol', 'Cambria Math', serif; font-size: clamp(1.35rem,2.35vw,2.3rem); line-height: 1.07; overflow-wrap: anywhere; }
.tone-peach { background: #f7dfd1; color: #63324c; }
.tone-blue { background: #dce5ff; color: #2740a9; }
.tone-lilac { background: #eae0ff; color: #603c9f; }
.tone-lime { background: #e8efcb; color: #38522b; }
.tool-info { padding: .75rem; }
.tool-info p { font-size: .89rem; color: var(--muted); margin-top: .3rem; }
.subtle-link { font-weight: 750; }
.site-ad { margin-top: clamp(2rem, 4vw, 3rem); padding-block: .8rem; border-block: 1px solid var(--line); }
.site-ad > p { margin-bottom: .35rem; color: var(--muted); font-size: .82rem; text-align: center; }
.guide { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(1rem,3vw,3rem); align-items: start; }
.guide-main p { margin-top: .95rem; max-width: 66ch; color: var(--muted); }
.how-to { background: #edf0fc; border: 1px solid #dde3f9; border-radius: 13px; padding: 1.2rem; }
.how-to h2 { font-size: 2.15rem; }
.how-to ol { margin-bottom: 0; padding-left: 1.25rem; }
.how-to li { padding-left: .15rem; margin-top: .3rem; }
.how-to li::marker { color: var(--dark-blue); font-weight: 800; }
.source-links { padding-left: 1.15rem; margin-bottom: 0; }
.source-links li + li { margin-top: .38rem; }
.faq > div { margin-top: 1rem; max-width: 790px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 750; padding-block: .8rem; }
.faq summary::after { content: '+'; color: var(--blue); font-size: 1.2rem; }
.faq details[open] summary::after { content: '−'; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { color: var(--muted); padding-bottom: 1rem; max-width: 65ch; }
.site-footer { margin-top: 4.75rem; border-top: 1px solid var(--line); }
.footer-inner { min-height: 93px; display: flex; align-items: center; justify-content: space-between; gap: 1.15rem; flex-wrap: wrap; padding-block: 1rem; }
.utility { padding-top: 2rem; min-height: 60vh; }
.utility h1 { font-size: clamp(3.3rem,8vw,6rem); line-height: 1; margin-block: 1.15rem; }
.utility p { max-width: 65ch; margin-bottom: 1rem; }
.license-list { list-style: none; padding: 0; max-width: 660px; }
.license-list li { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.license-list strong { flex: 1 0 13rem; }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 54px); }
  .style-grid, .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 730px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 61px; gap: .8rem; }
  .header-inner nav { margin-left: auto; gap: .8rem; }
  .header-inner nav a:first-child { display: none; }
  .header-button { display: none; }
  .hero.is-home { padding-top: 2.1rem; }
  .hero-intro { margin-top: .75rem; line-height: 1.45; }
  .workbench { grid-template-columns: minmax(0, 1fr); margin-top: 1.25rem; }
  .is-home textarea { min-height: 74px; height: 74px; }
  .stage { min-height: 237px; grid-template-rows: auto minmax(138px, 1fr) auto; }
  .stage-decoration { font-size: 9.4rem; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .tool-sample { font-size: 1.6rem; }
  .section-heading { align-items: start; }
}
@media (max-width: 540px) {
  .style-grid, .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .style-card { padding: .55rem; }
  .style-card-top { flex-wrap: wrap; align-content: start; }
  .style-card-top h3 { width: 100%; }
  .style-card-bottom { flex-wrap: wrap; margin-top: .3rem; }
  .tool-info { padding: .6rem; }
  .section-heading { flex-direction: column; gap: .45rem; }
  .stage-art { padding-inline: .6rem; }
  .input-meta { gap: .3rem; }
  .examples button { max-width: min(100%, 210px); }
}
@media (max-width: 350px) {
  .hero h1 { font-size: 3.4rem; }
  .is-inner h1 { font-size: 2.9rem; }
  .tuning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
