@layer reset, base, layout, components, responsive;
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, pre { margin: 0; }
  button, input { font: inherit; color: inherit; }
  button, summary, label:has(input) { cursor: pointer; }
  svg { display: block; }
  [hidden] { display: none !important; }
  :where(a, button, input, summary, pre):focus-visible { outline: 3px solid #7771d8; outline-offset: 4px; }
  .sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
}
@layer base {
  :root { font: 16px/1.75 "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; color: #203d33; background: #f4f3ec; --ink: #203d33; --muted: #617367; --green: #007967; --line: #ccd5c9; --paper: #fffef8; --lime: #c5ff80; }
  body { min-width: 320px; background: radial-gradient(ellipse at 95% 0, #dddcef70, transparent 28%); }
  code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
  :not(pre) > code { font-size: .9em; }
  h1 { font-size: clamp(34px, 4.5vw, 68px); line-height: 1.2; letter-spacing: 0; font-weight: 800; margin: 23px 0 20px; }
  h1 > span { color: var(--green); }
  h2 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.5; }
  h3 { font-size: 19px; line-height: 1.5; }
  a { color: var(--green); text-underline-offset: 4px; }
  a:hover { text-decoration-thickness: 2px; }
  .eyebrow, .kicker { color: var(--green); font-size: 12px; letter-spacing: .1em; font-weight: 750; }
  .kicker { margin-bottom: 5px; }
  .page { width: min(1560px, calc(100% - 80px)); margin-inline: auto; }
  .hero { padding: 38px 0 28px; }
  .eyebrow { display: flex; align-items: center; gap: 12px; }
  .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 10px; font: italic 800 25px/1 Georgia, serif; background: var(--lime); color: var(--ink); letter-spacing: 0; }
  .hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
  .lead { max-width: 940px; font-size: 16px; }
  .text-link { flex-shrink: 0; font-size: 14px; font-weight: 700; }
  .support-row { display: flex; align-items: center; gap: 9px 12px; flex-wrap: wrap; margin-top: 24px; }
  .support-badge { border: 1px solid var(--line); border-radius: 30px; padding: 5px 11px; font: 12px/1.6 "SFMono-Regular", Consolas, monospace; background: var(--paper); }
  .support-badge[data-supported=true] { color: #006652; border-color: #a2bca8; background: #edf5e9; }
  .support-badge[data-supported=false] { color: #994614; border-color: #dcbda8; background: #fff3e6; }
  .support-caption { font-size: 12px; color: var(--muted); }
  .notice { border-left: 3px solid #aa551b; background: #fff1dc; padding: 14px 18px; margin-top: 18px; font-size: 14px; }
  .icon-defs, .support-probe { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
}
@layer layout {
  .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 23px; overflow: clip; }
  .panel + .panel { margin-top: 36px; }
  .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); }
  .subtle-tag { padding: 6px 11px; border: 1px solid var(--line); border-radius: 30px; font-size: 12px; color: var(--green); white-space: nowrap; }
  .example-controls { display: flex; flex-wrap: wrap; align-items: start; gap: 24px 40px; padding: 20px 28px; border-bottom: 1px solid var(--line); background: #f7f7ef; }
  fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
  legend { font-size: 14px; font-weight: 750; margin-bottom: 8px; }
  legend code { margin-left: 7px; color: var(--muted); font-weight: 500; }
  .live-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .preview-stage { container-type: inline-size; padding: 22px 28px; background-color: #e8ede4; background-image: linear-gradient(#c9d6c54a 1px, transparent 1px), linear-gradient(90deg, #c9d6c54a 1px, transparent 1px); background-size: 22px 22px; }
  .stage-label { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: #587064; }
  .card-frame { min-height: 364px; display: grid; align-items: center; padding: 24px 0; }
  .lesson-code { min-width: 0; background: #172d25; color: #e9f1e5; }
  .code-heading { padding: 19px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #ffffff1d; }
  .code-heading .kicker { color: #a7c4ac; }
  .code-heading h3 { color: #f5f6ec; font-size: 17px; }
  .code-scroll { max-height: 440px; overflow: auto; }
  pre { font-size: 13px; line-height: 1.85; tab-size: 2; padding: 20px 22px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
  .code-note { padding: 14px 22px; font-size: 13px; line-height: 1.8; border-top: 1px solid #ffffff1d; color: #b9cdbd; }
  .state-details { padding: 16px 28px; border-top: 1px solid var(--line); background: #f8f8f1; }
  .state-details summary { font-size: 14px; font-weight: 700; }
  .state-details p { max-width: 920px; font-size: 14px; color: var(--muted); margin: 14px 0; }
  .state-details pre { color: #deebda; background: #172d25; margin-top: 15px; border-radius: 10px; max-height: 480px; }
  .value-intro { display: flex; justify-content: space-between; gap: 30px; align-items: center; padding: 24px 28px; }
  .value-intro > p { max-width: 850px; font-size: 15px; }
  .value-intro fieldset { flex-shrink: 0; }
  .value-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-inline: 28px; border: 1px solid var(--line); border-radius: 15px; overflow: clip; }
  .explanation-section { padding: 42px 0 34px; }
  .section-heading { margin-bottom: 22px; }
  .explanation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .explanation-grid article { padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: #fffef887; }
  .explanation-grid h3 { margin: 14px 0 12px; }
  .explanation-grid p { font-size: 15px; color: var(--muted); }
  .explanation-grid .small-note { font-size: 13px; }
  .compatibility { border: 1px solid var(--line); border-radius: 18px; padding: 27px 28px; background: #e7ede1; }
  .compatibility h2 { font-size: 24px; }
  .compatibility > p { font-size: 14px; margin: 15px 0 20px; max-width: 1100px; }
  .compatibility nav { display: flex; gap: 12px 25px; flex-wrap: wrap; font-size: 14px; }
  .page-footer { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 12px; padding: 26px 0 35px; }
}
@layer components {
  .segmented { display: flex; position: relative; isolation: isolate; padding: 4px; background: #e6ece2; border: 1px solid #c4cfc2; border-radius: 10px; anchor-scope: --choice; }
  .segmented::before { content: ""; position: absolute; z-index: -1; position-anchor: --choice; left: anchor(left); top: anchor(top); width: anchor-size(width); height: anchor-size(height); background: var(--ink); border-radius: 7px; transition: left .2s, top .2s, width .2s, height .2s; pointer-events: none; }
  .segmented label { position: relative; display: grid; min-width: max-content; flex: 1 0 auto; text-align: center; font-size: 14px; font-weight: 750; }
  .segmented input { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 7px; cursor: pointer; }
  .segmented label > span { display: grid; place-items: center; padding: 8px 15px; min-height: 38px; pointer-events: none; white-space: nowrap; }
  .segmented label:has(input:checked) { anchor-name: --choice; color: var(--lime); }
  .segmented label:hover { background: #203d330a; border-radius: 7px; }
  .segmented label:has(input:focus-visible) { outline: 3px solid #7771d8; outline-offset: 4px; border-radius: 7px; }
  .segmented input:focus-visible { outline: none; }
  .segmented input:disabled { cursor: not-allowed; }
  fieldset:disabled { opacity: .5; }
  .live-card { --accent: #5658bd; display: grid; gap: 16px; padding: 24px; width: min(100%, 500px); margin-inline: auto; border: 1px solid #8c8cc2; border-radius: 17px; background: #f1f0fa; box-shadow: 0 16px 24px -18px #2642337a, 0 4px 10px #2642330a; transition: padding .28s, background-color .28s, border-color .28s; }
  .sample-header { display: flex; align-items: center; gap: 12px; }
  .file-icon { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: white; transition: background-color .28s; }
  .file-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .sample-file { font-size: 11px; letter-spacing: .08em; color: var(--accent); font-weight: 750; }
  .state-indicator { width: 24px; height: 24px; margin-left: auto; color: var(--accent); }
  .state-indicator svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sample-eyebrow { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
  .sample-copy h3 { font-size: clamp(20px, 3cqw, 25px); line-height: 1.5; }
  .sample-copy > p:last-child { font-size: 14px; line-height: 1.85; margin-top: 8px; color: #5c6e63; }
  .sample-status { font-size: 14px; color: var(--accent); font-weight: 700; min-height: 26px; }
  .sample-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid #203d3320; }
  .member { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
  .member > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--paper); border-radius: 50%; background: #dee5d1; font-size: 10px; color: var(--ink); font-weight: 800; }
  .sample-tag { padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--accent); border: 1px solid currentColor; }
  .state-copy { display: none; }
  .state-copy.is-normal { display: block; }
  @supports (color: if(else: red)) {
    .state-copy.is-normal { display: if(style(--status: normal): block; else: none); }
    .state-copy.is-complete { display: if(style(--status: complete): block; else: none); }
    .state-copy.is-attention { display: if(style(--status: attention): block; else: none); }
  }
  .computed-values { display: grid; grid-template-columns: .8fr .9fr 1.3fr; gap: 9px; padding: 13px 14px; border: 1px solid #c3cebf; border-radius: 10px; background: #fffef8c9; }
  .computed-values > div { display: grid; gap: 4px; min-width: 0; }
  .computed-values > div > span:first-child { color: var(--muted); font-size: 12px; }
  .computed-values code { font-size: 14px; font-weight: 650; }
  .color-value { display: flex; align-items: center; gap: 7px; }
  .color-value i { width: 12px; height: 12px; flex-shrink: 0; border-radius: 3px; background: #5658bd; }
  .stage-note { font-size: 13px; color: #5a6d5e; line-height: 1.85; margin-top: 15px; }
  .copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; padding: 8px 12px; min-height: 38px; border: 1px solid #bdcbb8; border-radius: 8px; font-size: 13px; color: var(--ink); background: var(--paper); font-weight: 750; transition: background .18s; }
  .copy-button:hover { background: #d9f0c5; }
  .copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .token-at { color: #e0c4ff; }.token-name { color: #bbeb8c; }.token-number { color: #ffca9f; }.token-comment { color: #8fae9c; }.token-word { color: #a8d5f6; }
  .value-cell { min-width: 0; background: #f9faf4; }
  .value-cell + .value-cell { border-left: 1px solid var(--line); }
  .value-cell header { display: grid; gap: 6px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
  .value-kind { font-size: 12px; color: var(--muted); }
  .value-cell header code { font-size: 14px; font-weight: 650; }
  .value-stage { min-height: 198px; display: grid; place-items: center; padding: 20px 8px; }
  .value-box { padding: 8px; background: #d8deed; border: 1px dashed #7984a6; border-radius: 8px; transition: padding .28s; }
  .value-box--two { background: #cbe6d7; border-color: #689780; }
  .value-box--four { background: #e2d8f4; border-color: #9a84bd; }
  .value-box > span { display: grid; place-items: center; width: 94px; height: 48px; border: 1px solid #203d3333; border-radius: 5px; background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
  .value-cell footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--line); background: #fffef8; font-size: 12px; color: var(--muted); }
  .value-cell output { color: var(--ink); font: 700 17px/1.5 "SFMono-Regular", Consolas, monospace; }
  .comparison-note { padding: 23px 28px; font-size: 14px; color: var(--muted); }
  .comparison-note strong { color: var(--ink); }
  .detail-toolbar { margin-top: 12px; }
  .concept-name { display: inline-block; color: var(--green); background: #e4eddf; padding: 3px 10px; border-radius: 6px; font-size: 17px !important; font-weight: 700; }
  .explanation-grid .example-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0; padding: 12px; background: #eceee5; border-radius: 8px; color: var(--ink); }
  .toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 10px); z-index: 100; max-width: calc(100% - 32px); padding: 12px 19px; border-radius: 11px; background: var(--ink); color: white; font-size: 14px; box-shadow: 0 5px 22px #0002; opacity: 0; visibility: hidden; transition: .2s; }
  .toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
}
@layer responsive {
  @container (max-width: 430px) { .computed-values { grid-template-columns: 1fr 1fr; }.computed-values > div:last-child { grid-column: 1/-1; }.sample-file { font-size: 10px; letter-spacing: 0; } }
  @media (max-width: 1100px) { .hero-bottom { align-items: start; flex-direction: column; gap: 13px; }.live-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.preview-stage { padding: 20px; }.card-frame { min-height: 385px; }.value-intro { align-items: start; }.value-intro > p { max-width: 600px; }.explanation-grid { gap: 14px; }.explanation-grid article { padding: 20px; } }
  @media (max-width: 850px) { .page { width: calc(100% - 32px); }.hero { padding-top: 28px; }.live-grid { grid-template-columns: 1fr; }.card-frame { min-height: 330px; }.lesson-code { border-top: 1px solid var(--line); }.code-scroll { max-height: 350px; }.example-controls { gap: 18px; }.example-controls fieldset { flex: 1; min-width: 260px; }.panel-heading { padding: 21px; }.panel-heading .subtle-tag { display: none; }.explanation-grid { grid-template-columns: 1fr; }.value-intro { flex-direction: column; gap: 20px; }.value-cell header { padding: 15px 12px; }.value-cell header code { font-size: 12px; }.value-cell footer { flex-direction: column; align-items: start; padding: 12px; }.value-grid { margin-inline: 20px; }.value-box > span { width: 72px; }.value-stage { min-height: 205px; }.value-cell header { min-height: 90px; } }
  @media (max-width: 620px) { .eyebrow { font-size: 10px; letter-spacing: .04em; }.brand-mark { width: 29px; height: 29px; font-size: 23px; }.hero h1 { font-size: clamp(29px, 6.7vw, 40px); }.lead { font-size: 15px; }.panel { border-radius: 17px; }.example-controls { padding: 18px; }.example-controls fieldset { min-width: 0; flex-basis: 100%; }.segmented label { min-width: 0; }.segmented label > span { padding-inline: 10px; font-size: 13px; }.panel-heading { padding: 20px 18px; }h2 { font-size: 22px; }.preview-stage { padding: 18px; }.stage-label { font-size: 11px; gap: 8px; }.live-card { border-radius: 12px; }.card-frame { min-height: 380px; }.sample-copy h3 { font-size: 20px; }.sample-header { gap: 8px; }.file-icon { width: 36px; height: 36px; border-radius: 9px; }.file-icon svg { width: 24px; height: 24px; }.state-details { padding: 16px 18px; }.code-heading { padding: 18px; }.code-heading h3 { font-size: 16px; }.code-heading .kicker { font-size: 10px; }.copy-button { font-size: 12px; padding: 8px 10px; }pre { font-size: 12px; padding: 18px; }.value-intro { padding: 21px 18px; }.value-grid { grid-template-columns: 1fr; margin-inline: 18px; }.value-cell + .value-cell { border-left: 0; border-top: 1px solid var(--line); }.value-cell header { min-height: auto; display: flex; justify-content: space-between; gap: 10px; padding: 14px; align-items: center; }.value-cell header code { font-size: 13px; }.value-stage { min-height: 166px; }.value-cell footer { flex-direction: row; align-items: center; padding: 12px 15px; }.value-box > span { width: 94px; }.comparison-note { padding: 21px 18px; }.compatibility { padding: 23px 20px; }.compatibility h2 { font-size: 22px; }.page-footer { font-size: 10px; } }
  @supports not (left: anchor(left)) { .segmented::before { display: none; }.segmented label:has(input:checked) { background: var(--ink); border-radius: 7px; } }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
}
