:root { color-scheme: light; --ink: #182f37; --muted: #49646a; --sea: #125f58; --rule: #ceddd9; }
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; background: #fff; color: var(--ink); font: 1rem/1.95 "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif; }
a { color: var(--sea); text-underline-offset: .25em; }
a:focus-visible { outline: 3px solid #ad5918; outline-offset: 4px; }
a:hover { text-decoration: underline; }
.mast, footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 76rem; margin: auto; padding: 1rem clamp(1.2rem, 5vw, 4rem); }
.mast > a { font-weight: 760; font-size: 1.08rem; color: var(--ink); }
.mast a { text-decoration: none; }
.mast nav { display: flex; gap: clamp(.8rem, 4vw, 2rem); font-size: .9rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(12rem, .8fr); align-items: center; gap: clamp(1rem, 4vw, 5rem); max-width: 76rem; margin: auto; padding: clamp(1.8rem, 5vw, 4.4rem) clamp(1.25rem, 5vw, 4rem); background: #e9f3ee; border-block: 1px solid #d3e3d9; }
h1, h2, h3 { line-height: 1.45; text-wrap: pretty; }
h1 { font-size: clamp(1.5rem, 3.9vw, 3.05rem); letter-spacing: -.05em; margin: .35em 0; }
h1 span { white-space: nowrap; }
.meta { font-size: .87rem; font-weight: 700; color: var(--sea); margin: 0; }
.meta span { font-weight: 500; border-left: 1px solid #a9c8bb; margin-left: .65rem; padding-left: .75rem; }
.intro { max-width: 36em; margin: .6rem 0 1.35rem; }
.button, .experiment button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 6px; border: 1px solid transparent; padding: .5rem 1.1rem; font: inherit; font-weight: 660; text-decoration: none; cursor: pointer; }
.button { background: var(--sea); color: white; }
.experiment { border: 1px solid #71a398; border-radius: 8px; margin: .2rem 0 .4rem; overflow: hidden; }
.experiment summary { padding: .65rem 1rem; background: #eff5f2; color: var(--sea); font-weight: 700; cursor: pointer; }
.experiment summary:focus-visible, .experiment button:focus-visible { outline: 2px solid #ad5918; outline-offset: -3px; }
.experiment-body { padding: 1rem; display: grid; grid-template-columns: 9rem minmax(0, 1fr); align-items: start; gap: 1rem; }
.experiment canvas { width: 100%; height: auto; background: #eff5f2; border-radius: 6px; }
.experiment button { margin: 0 .25rem .3rem 0; }
.experiment button[hidden] { display: none; }
.experiment button:disabled { opacity: .55; cursor: default; }
.experiment pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }
.experiment [role=status]:empty { display: none; }
.cube-figure { margin: 0; text-align: center; background: radial-gradient(#9bb9a9 1px, transparent 1.2px) center / 14px 14px; padding: 0 .7rem .6rem; border-radius: .4rem; }
.cube-figure img { display: block; margin: auto; width: min(100%, 18rem); height: auto; }
figcaption { background: #e9f3ee; display: inline-block; padding: .1rem .65rem; font-size: .85rem; color: var(--muted); }
.reading { max-width: 68rem; padding: 2.8rem clamp(1.25rem, 4vw, 3rem); margin: auto; display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(0, 3fr); gap: clamp(2rem, 5vw, 5rem); }
aside nav { position: sticky; top: 2rem; display: grid; align-content: start; border-left: 2px solid var(--rule); padding-left: 1.1rem; }
aside p { margin: 0 0 .5rem; font-weight: 700; }
aside a { padding: .2rem 0; font-size: .91rem; text-decoration: none; }
article section { border-bottom: 1px solid var(--rule); padding-bottom: 2rem; margin-bottom: 2rem; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.95rem); margin: 0 0 .65em; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 1.3rem; }
article p { margin: .8em 0; }
.example { border-left: .25rem solid #d99146; background: #fcf5e9; padding: .9rem 1.2rem; margin: 1.2rem 0; }
.example b, .example code { display: block; }
.example code { margin: .2rem 0; font-size: 1.12rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.example p, .note { font-size: .94rem; }
table { width: 100%; border-collapse: collapse; margin: 1.8rem 0 1rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; margin-bottom: .5rem; }
th, td { padding: .55rem .45rem; border-bottom: 1px solid var(--rule); text-align: right; }
th:first-child { text-align: left; }
thead { background: #eff5f2; }
.trial { color: #eff7f2; background: #183d3b; border-radius: 9px; padding: clamp(1.1rem, 3vw, 2rem); margin-top: 1.6rem; }
.trial .button { background: #d4ecdb; color: #16413c; }
footer { justify-content: flex-end; border-top: 1px solid var(--rule); }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .cube-figure { display: flex; justify-content: center; align-items: center; gap: .5rem; }
  .cube-figure img { width: 7.5rem; margin: 0; }
  .reading { display: block; padding-top: 1.7rem; }
  aside nav { position: static; display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin-bottom: 2rem; }
  aside p { width: 100%; margin: 0; }
}
@media (max-width: 410px) { .mast { flex-wrap: wrap; gap: .1rem .8rem; } .mast nav { gap: 1rem; } }
@media (max-width: 480px) {
  h1 { font-size: clamp(1.12rem, 7vw, 1.8rem); }
  .experiment-body { grid-template-columns: 1fr; }
  .experiment canvas { width: 8rem; }
}
