@font-face { font-family: "BIZ UDPGothic"; src: url("sake-rice-biz-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BIZ UDPGothic"; src: url("sake-rice-biz-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Serif JP"; src: url("sake-rice-serif-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("sake-rice-newsreader.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader Body"; src: url("sake-rice-newsreader-body.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Serif JP"; src: url("sake-rice-hero-serif.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+3078,U+30AF,U+30ED,U+521D,U+52D5,U+5965,U+5C11,U+6700,U+77E5,U+89E6; }
@font-face { font-family: "BIZ UDPGothic"; src: url("sake-rice-hero-biz.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+3078,U+30AF,U+30ED,U+521D,U+52D5,U+5965,U+5C11,U+6700,U+77E5,U+89E6; }
@layer base, layout, components;
@property --rim-angle { syntax: "<angle>"; inherits: true; initial-value: 35deg; }
@property --ripple { syntax: "<percentage>"; inherits: false; initial-value: 200%; }
@keyframes rim-flow { from { --rim-angle: -325deg; } to { --rim-angle: 35deg; } }
@keyframes rim-ripple { from { --ripple: 0%; } to { --ripple: 200%; } }
@layer base {
  :root { color-scheme: dark; --page: #101e24; --surface: #213b40; --ink: #e5ebe6; --muted: #b5c6c1; --accent: #9db6a9; --line: #70898c; --rule: #3b5358; --display: "Noto Serif JP", "Yu Mincho", serif; --display-weight: 500; --ui-duration: 260ms; --ui-ease: cubic-bezier(.22, 1, .36, 1); font-family: "BIZ UDPGothic", "Hiragino Sans", sans-serif; font-synthesis: none; line-height: 1.8; line-break: strict; }
  :root:lang(en) { --display: "Newsreader", Georgia, serif; --display-weight: 400; line-height: 1.65; }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--page); color: var(--ink); background-image: radial-gradient(ellipse 44rem 28rem at 50% 29rem, var(--surface), transparent 95%); }
  button, input, output { font: inherit; }
  button { min-block-size: 2.75rem; padding: .5rem .75rem; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: .15rem; cursor: pointer; transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease), box-shadow var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease), opacity var(--ui-duration) var(--ui-ease); }
  button:hover:not(:disabled) { background: var(--surface); }
  button:active:not(:disabled) { transform: scale(.97); }
  button[aria-pressed="true"], button[aria-pressed="true"]:hover { background: var(--surface); color: var(--ink); border-color: var(--accent); }
  button:disabled, input:disabled { opacity: .5; cursor: wait; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
  [hidden] { display: none !important; }
  a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .25em; }
  p { margin-block: 0 1rem; }
  h1, h2 { font-family: var(--display); font-weight: var(--display-weight); line-height: 1.5; overflow-wrap: break-word; }
  :lang(en) h1, :lang(en) h2 { line-height: 1.12; }
  fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
  legend { padding: 0; margin-block-end: .75rem; }
  summary { cursor: pointer; padding-block: .85rem; min-block-size: 2.75rem; transition: color var(--ui-duration) var(--ui-ease); }
  strong { font-weight: 700; color: var(--ink); }
}

/* The introduction is full bleed; the comparison keeps its established layout. */
.hero-journey { position: relative; background: var(--page); view-timeline: --rice-journey block; }
.hero-journey[data-motion="scroll"] { block-size: 225svh; }
.film-handoff .hero-journey[data-motion="scroll"] { block-size: 325svh; }
.film-handoff #explore { margin-block-start: -100svh; scroll-margin-block-start: 0; background: none; }
body #explore { transform: translateY(var(--handoff-lift, 0px)); }
.film-handoff #explore[inert] { pointer-events: none; }
body #explore > *, body #explore .grain-labels, body #explore .viewer-tools,
body #explore .methods, body #explore .methods-heading, body #explore .load-state { opacity: var(--handoff-interface, 1); }
body #explore .observation { opacity: 1; }
body #rice-canvas { opacity: var(--handoff-viewer, 1); }
body #hero-canvas.rice-handoff { position: fixed; inset: 0; z-index: 4; display: block; pointer-events: none; cursor: auto; }
.hero-journey[data-film="true"] .hero-backdrop { opacity: var(--hero-room-opacity, 1); }
.hero-journey[data-film="true"][data-state="ready"][data-motion="scroll"] .hero-backdrop { opacity: 0; }
.hero-journey[data-film="true"] .hero-stage .masthead { opacity: var(--hero-masthead-opacity, 1); }
.hero-journey[data-film="true"] .hero-bottom { opacity: var(--hero-scroll-opacity, 1); }
.hero-stage { position: sticky; inset-block-start: 0; block-size: 100svh; min-block-size: 36rem; overflow: clip; isolation: isolate; background: #101e24; }
#hero-canvas, .hero-backdrop { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; }
#hero-canvas { opacity: 0; cursor: auto; }
.hero-journey[data-state="ready"] #hero-canvas { opacity: 1; }
#hero-film, #hero-film-end { display: none; position:absolute; inset:0; inline-size:100%; block-size:100%; object-fit:cover; pointer-events:none; opacity:0; }
.hero-journey[data-film="true"] #hero-film { display:block; }
.hero-journey[data-film="true"] #hero-film-end { display:block; }
.hero-journey[data-film="true"] #hero-canvas { display:none; }
.hero-journey[data-film="true"][data-state="ready"][data-motion="scroll"] #hero-film,
.hero-journey[data-film="true"][data-state="ready"][data-motion="scroll"] #hero-film-end { opacity:var(--hero-room-opacity,1); }
.hero-journey[data-film="true"] .hero-stage::after { background:linear-gradient(0deg,#101e24,transparent 12%); }
@media (max-width:48rem) and (min-aspect-ratio:1/2) {
  .hero-journey[data-film="true"] #hero-film,
  .hero-journey[data-film="true"] #hero-film-end,
  .hero-journey[data-film="true"] .hero-backdrop img { object-fit:contain; mask-image:linear-gradient(90deg,transparent 12%,#000 30%,#000 70%,transparent 88%); }
  .hero-journey[data-film="true"] .hero-backdrop { background:#000; }
}
.hero-backdrop { background: radial-gradient(ellipse at 72% 45%, #34535b, transparent 55%), linear-gradient(160deg, #0d181f, #1e353c); }
.hero-backdrop img { display:block; inline-size:100%; block-size:100%; object-fit:cover; }
.hero-stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #07131a5c, transparent 62%), linear-gradient(0deg, #101e24 0%, transparent 17%, transparent 85%, #0a161c66); }
.hero-journey[data-art="true"] .hero-stage::after { background:linear-gradient(0deg,#101e24,transparent 10%); }
.hero-stage .masthead { position: absolute; z-index: 3; inset-block-start: 0; inset-inline: clamp(1.25rem, 5vw, 5rem); border: 0; padding-block: 1.5rem; }
.hero-copy, .hero-approach { position: absolute; z-index: 2; inset-inline-start: clamp(1.5rem, 6vw, 7rem); inset-block-start: 34%; max-inline-size: 40%; }
.hero-copy { opacity: var(--hero-copy-opacity, 1); }
.hero-kicker { font-family: "BIZ UDPGothic", sans-serif; color: #bdcecb; font-size: .75rem; letter-spacing: .16em; margin-block-end: 1.5rem; }
#hero-title { font-size: clamp(2.75rem, 4.6vw, 4.75rem); font-weight: 500; letter-spacing: .06em; line-height: 1.6; margin-block: 0 1.3rem; }
#hero-title > span { display: block; }
:lang(en) #hero-title { font-size: clamp(3.5rem, 6vw, 6.5rem); line-height: 1.1; letter-spacing: -.025em; font-weight: 400; }
.hero-description { font-family: var(--reading); font-weight: var(--reading-weight); letter-spacing: var(--reading-tracking); color: #c6d6d1; font-size: 1.125rem; line-height: 1.9; max-inline-size: 20em; text-wrap: balance; word-break: auto-phrase; overflow-wrap: break-word; }
:lang(en) .hero-description { font-size: 1.4rem; line-height: 1.6; }
@supports not (word-break: auto-phrase) { .hero-description:lang(ja) { word-break: keep-all; } }
.hero-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 2.5rem; min-block-size: 2.75rem; padding-block: .5rem; margin-block-start: 1rem; font-size: 1rem; text-decoration: none; border-block-end: 1px solid #95b0a7; }
.hero-link:hover { color: white; border-color: white; }
.hero-approach { inset-block-start: 34%; opacity: var(--hero-approach-opacity,0); }
.hero-approach-title { font: var(--display-weight) clamp(1.7rem,3vw,3rem)/1.8 var(--display); max-inline-size: 9em; text-wrap: balance; }
.hero-bottom { position: absolute; z-index: 3; inset-block-end: 2rem; inset-inline: clamp(1.25rem, 5vw, 5rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hero-scroll { color: #c6d6d1; font-size: .75rem; letter-spacing: .12em; margin: 0; opacity: var(--hero-scroll-opacity,1); }
.hero-scroll > span + span { margin-inline-start: 1rem; }
#hero-motion { border-color: #597176; color: #c6d6d1; font-size: .75rem; border-radius: 2rem; padding-inline: 1rem; }
.hero-progress { position: absolute; z-index: 3; inset-block-end: 0; inset-inline: 0; block-size: 1px; background: #2b4148; opacity:var(--hero-scroll-opacity,1); }
.hero-progress span { display: block; block-size: 100%; background: #afc7bf; transform-origin: left; transform: scaleX(var(--hero-progress,0)); }
.hero-journey[data-motion="static"] .hero-scroll { visibility: hidden; }
.hero-journey[data-motion="static"] .hero-copy { opacity: 1; }
.hero-journey[data-motion="static"] .hero-approach { display: none; }
#explore { scroll-margin-block-start: 1rem; position: relative; padding-block-start: 2rem; background: radial-gradient(ellipse 40rem 25rem at 50% 32rem, #213b40, transparent 95%); }
.page-header .chapter-title { font-size: 3.5rem; letter-spacing: .06em; margin: 0 0 1rem; }
:lang(en) .page-header .chapter-title { font-size:4rem; letter-spacing:-.025em; }
@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  @keyframes hero-copy-exit { from { opacity: 1; } to { opacity: 0; } }
  .hero-journey[data-motion="scroll"]:not([data-film="true"]) .hero-copy { animation: hero-copy-exit linear both; animation-timeline: --rice-journey; animation-range: contain 3% contain 25%; }
}
@media (max-width: 48rem) {
  .hero-journey[data-art="true"] #hero-canvas, .hero-journey[data-art="true"] .hero-backdrop { inset-block-start:31%; block-size:69%; }
  .hero-journey[data-art="true"] .hero-backdrop img { object-position:70% 50%; }
  .hero-journey[data-art="true"] .hero-stage::after { background:linear-gradient(0deg,#101e24,transparent 12%,transparent 55%,#101e24 70%); }
  .hero-journey[data-art="true"] .hero-copy { inset-block-start:14%; }
  .page-header .chapter-title { font-size:2.75rem; }
  :lang(en) .page-header .chapter-title { font-size:3.25rem; }
  .hero-stage { min-block-size: 40rem; }
  .hero-stage::after { background: linear-gradient(0deg,#101e24,transparent 16%,transparent 50%,#091820b0 90%); }
  .hero-copy, .hero-approach { inset-block-start: 19%; inset-inline-start: 7%; max-inline-size: 86%; }
  #hero-title { font-size: clamp(2.3rem,7vw,3.5rem); line-height: 1.6; margin-block-end: .65rem; }
  :lang(en) #hero-title { font-size: clamp(2.9rem,10vw,4.5rem); }
  .hero-kicker { margin-block-end: .75rem; font-size: .7rem; }
  .hero-description { font-size: 1rem; max-inline-size: 19em; }
  :lang(en) .hero-description { font-size: 1.25rem; max-inline-size: 17em; }
  .hero-link { margin-block-start: .15rem; font-size: .875rem; }
  .hero-approach-title { font-size: 1.75rem; max-inline-size: 12em; }
  .hero-bottom { inset-block-end: 1rem; }
  .hero-scroll { font-size: .6875rem; letter-spacing: .05em; }
  #hero-motion { font-size: .6875rem; padding-inline: .75rem; }
  #explore { padding-block-start: .5rem; }
}
@media (max-width: 35rem) {
  .page-header .chapter-title { font-size:2.25rem; letter-spacing:.04em; margin-block-end:.75rem; }
  :lang(en) .page-header .chapter-title { font-size:2.5rem; }
}
@media (max-width: 22rem) {
  .hero-journey[data-art="true"] #hero-canvas, .hero-journey[data-art="true"] .hero-backdrop { inset-block-start:45%; block-size:55%; }
  .hero-journey[data-art="true"] .hero-stage::after { background:linear-gradient(0deg,#101e24,transparent 12%,transparent 43%,#101e24 56%); }
  .hero-stage .masthead { flex-wrap:nowrap; gap:.5rem; align-items:flex-start; padding-block:1rem; }
  .hero-stage .brand { font-size:.875rem; max-inline-size:55%; letter-spacing:0; }
  .hero-stage .languages button { padding-inline:.35rem; }
  .hero-copy, .hero-approach { inset-block-start:16%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-journey[data-motion="scroll"], .film-handoff .hero-journey[data-motion="scroll"] { block-size: auto; }
  .hero-copy { animation: none !important; opacity: 1; }
}
@media print {
  .hero-journey[data-motion], .film-handoff .hero-journey[data-motion] { block-size: auto; }
  .film-handoff #explore { margin-block-start: 0; }
  body #explore { transform: none; --handoff-interface: 1; --handoff-viewer: 1; }
  body #hero-canvas.rice-handoff { display: none; }
  .hero-stage { position: relative; block-size: 25rem; min-block-size: 0; }
  .hero-copy { opacity: 1; animation: none !important; }
  .hero-approach,.hero-bottom,.hero-progress { display: none; }
}
@layer layout {
  main { max-inline-size: 76rem; margin-inline: auto; padding: 0 clamp(1.25rem, 4vw, 4rem) 3rem; }
  .masthead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; padding-block: 1.5rem; border-block-end: 1px solid var(--rule); }
  .brand { margin: 0; font-family: var(--display); font-weight: var(--display-weight); font-size: 1.125rem; letter-spacing: .07em; line-height: 1.6; }
  .brand small { display: block; margin-block-start: .2rem; font-family: "Newsreader", Georgia, serif; font-weight: 400; font-size: .875rem; letter-spacing: .1em; color: var(--muted); }
  .page-header { text-align: center; padding-block: 2.5rem 1rem; }
  .chapter-kicker { color: var(--muted); font-size: .875rem; letter-spacing: .09em; margin-block-end: 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; }
  :is(h1, .chapter-title) { font-size: 3.5rem; letter-spacing: .06em; margin: 0 0 1rem; }
  :lang(ja) :is(h1, .chapter-title) .headline-space { display: none; }
  :lang(en) :is(h1, .chapter-title) { font-size: 4rem; letter-spacing: -.025em; }
  .intro { font-size: 1rem; color: var(--muted); margin: 0 auto; max-inline-size: 35rem; text-wrap: balance; }
  .observation { max-inline-size: 56rem; margin-inline: auto; }
  .controls { max-inline-size: 56rem; margin: 1.25rem auto 0; }
  .method-description { max-inline-size: 44rem; margin-inline: auto; }
  footer { max-inline-size: 56rem; margin: 4rem auto 0; border-block-start: 1px solid var(--rule); padding-block-start: 2rem; color: var(--muted); font-size: 1rem; }
  .footer-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-block-end: 1rem; }
  .footer-heading h2 { font-size: 1.5rem; color: var(--ink); margin: 0; }
  .footer-heading > span { font-size: .875rem; }
  .source-note { display: block; color: var(--muted); font-size: .875rem; margin-block-start: .25rem; }
  footer ul { padding-inline-start: 1.25rem; }
  footer li { margin-block-end: 1rem; }
  footer details summary { display: flex; align-items: center; gap: .45rem; list-style: none; }
  footer details summary::-webkit-details-marker { display: none; }
  footer details summary::before { content: '▸'; display: inline-block; color: var(--accent); transition: transform var(--ui-duration) var(--ui-ease); }
  footer details[data-expanded="true"] summary::before { transform: rotate(90deg); }
  footer details summary:hover { color: var(--ink); }
  .source-content { display: flow-root; padding-block-start: .25rem; }
  @media (max-width: 48rem) {
    .controls { margin-block-start: 1.25rem; }
    .page-header { padding-block: 1.75rem 0; }
    :is(h1, .chapter-title) { font-size: 2.75rem; }
    :lang(en) :is(h1, .chapter-title) { font-size: 3.25rem; }
  }
  @media (max-width: 35rem) {
    .masthead { padding-block: 1rem; gap: .5rem 1rem; }
    .brand { font-size: 1rem; letter-spacing: .025em; }
    .brand small { font-size: .875rem; }
    .page-header { padding-block: 1.5rem 0; }
    .chapter-kicker { margin-block-end: .75rem; font-size: .875rem; letter-spacing: .04em; }
    :is(h1, .chapter-title) { font-size: 2.25rem; letter-spacing: .04em; line-height: 1.45; margin-block-end: .75rem; }
    :is(h1, .chapter-title) > span { display: block; }
    :is(h1, .chapter-title) .headline-space { display: none; }
    :lang(en) :is(h1, .chapter-title) { font-size: 2.5rem; }
    .intro { max-inline-size: 21em; }
    footer { margin-block-start: 2.5rem; }
  }
}
@layer components {
  :root { --reading: "Noto Serif JP", "Yu Mincho", serif; --reading-weight: 500; --reading-tracking: .04em; }
  :root:lang(en) { --reading: "Newsreader Body", Georgia, serif; --reading-weight: 400; --reading-tracking: normal; }
  .intro, #method-description, #model-note, footer details p, footer li { font-family: var(--reading); font-weight: var(--reading-weight); font-optical-sizing: auto; letter-spacing: var(--reading-tracking); line-height: 1.9; overflow-wrap: anywhere; }
  .intro, #method-description, #model-note, footer details p { font-size: 1.125rem; }
  :lang(en) .intro, :lang(en) #method-description, :lang(en) #model-note, :lang(en) footer details p { font-size: 1.25rem; line-height: 1.65; }
  #model-note strong { font-weight: inherit; }
  footer .source-note { font-family: "BIZ UDPGothic", sans-serif; font-weight: 400; letter-spacing: normal; }
  .languages { display: flex; gap: .25rem; }
  .languages button { border: 0; border-radius: 0; padding-inline: .65rem; color: var(--muted); font-size: .875rem; }
  .languages button[aria-pressed="true"] { color: var(--ink); background: transparent; box-shadow: inset 0 -1px 0 var(--accent); }
  .viewer { position: relative; display: grid; grid-template-rows: 3.5rem 22rem auto; max-inline-size: 48rem; margin-inline: auto; }
  #rice-canvas { grid-row: 2; }
  canvas { display: block; min-block-size: 0; inline-size: 100%; block-size: 100%; cursor: grab; }
  canvas:active { cursor: grabbing; }
  canvas:focus-visible { outline-offset: -4px; }
  .grain-labels { grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: center; gap: 1rem; padding-block: 0 1.5rem; padding-inline: .5rem; font-family: var(--display); font-size: 1.375rem; font-weight: var(--display-weight); line-height: 1.6; pointer-events: none; }
  .grain-labels small { display: block; font-family: "BIZ UDPGothic", sans-serif; font-size: .875rem; color: var(--muted); margin-block-end: .35rem; line-height: 1.5; }
  .grain-labels b { font-weight: var(--display-weight); overflow-wrap: anywhere; }
  .viewer[data-comparing="false"] .grain-labels { grid-template-columns: 1fr; }
  .viewer[data-comparing="false"] #after-label { display: none; }
  .viewer-tools { grid-row: 1; position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-inline-size: 0; padding-inline: .4rem; }
  .direction-controls { flex: 0 0 auto; min-inline-size: 0; }
  .direction-controls legend { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .direction-stepper { display: flex; align-items: center; block-size: 2.75rem; }
  .direction-arrow { display: grid; place-items: center; flex: 0 0 2.75rem; inline-size: 2.75rem; block-size: 2.75rem; min-block-size: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
  .direction-arrow:hover:not(:disabled) { background: #b6cdb122; }
  .direction-arrow:disabled { opacity: .3; cursor: default; }
  .direction-arrow span { display: block; font-family: Georgia, serif; font-size: 1.5rem; line-height: 1; }
  #direction-current { display: grid; place-items: center; inline-size: 5rem; min-block-size: 2.75rem; color: var(--ink); font-family: var(--display); font-size: .9375rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
  .viewer[data-hint="playing"] .direction-arrow:not(:disabled) span { animation: direction-blink .58s ease-in-out 3; }
  @keyframes direction-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .12; transform: scale(1.16); } }
  .fine-controls { position: relative; display: flex; gap: .25rem; flex: 0 0 auto; z-index: 4; }
  .settings-toggle { display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; min-block-size: 2.75rem; padding: .55rem; border: 0; border-radius: 50%; background: transparent; }
  .settings-toggle:hover:not(:disabled), .settings-toggle[aria-expanded="true"] { background: #b6cdb122; }
  .settings-toggle svg { inline-size: 1.35rem; block-size: 1.35rem; transition: transform var(--ui-duration) var(--ui-ease); }
  .fine-controls[data-open="true"] #settings-toggle svg { transform: rotate(35deg); }
  .fine-panel { position: absolute; inset-block-start: calc(100% + .5rem); inset-inline-end: 0; inline-size: min(20.5rem, calc(100vw - 2.5rem)); padding: .9rem 1rem; background: #21383c; border-radius: .75rem; box-shadow: 0 1rem 2.5rem #071519b8; line-height: 1.5; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-.45rem); transition: opacity var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease), visibility 0s linear var(--ui-duration); }
  .fine-panel[data-open="true"] { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition: opacity var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease), visibility 0s; }
  .fine-panel h3 { font-size: .95rem; font-weight: 700; margin: 0 0 .65rem; line-height: 1.5; }
  .load-state { position: absolute; inset: 0; background: var(--page); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; text-align: center; z-index: 5; }
  .load-grain { inline-size: 1.5rem; block-size: 1.5rem; border: 2px solid var(--rule); border-block-start-color: var(--accent); border-radius: 50%; margin-block-end: 1rem; animation: turn 1s linear infinite; }
  @keyframes turn { to { transform: rotate(1turn); } }
  .viewer-caption { text-align: center; color: var(--muted); padding-block: 1rem 1.5rem; }
  .viewer-caption p { font-size: .875rem; margin: 0; line-height: 1.8; }
  .viewer-caption p + p { margin-block-start: .25rem; }
  .help-panel .viewer-caption { padding: 0; text-align: start; }
  .methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; padding-block: 1rem; }
  .methods button { position: relative; border: 0; border-radius: 0; text-align: center; padding: .75rem .5rem; display: grid; gap: .35rem; align-content: start; color: var(--muted); font-size: 1rem; line-height: 1.5; }
  .methods button[aria-pressed="true"], .methods button[aria-pressed="true"]:hover { background: transparent; color: var(--ink); box-shadow: none; }
  .methods button:hover:not(:disabled) { color: var(--ink); }
  .methods button::after { content: ''; position: absolute; inset-inline: 26%; inset-block-end: .2rem; block-size: 1px; background: var(--accent); opacity: 0; transform: scaleX(.4); transition: opacity var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease); }
  .methods button[aria-pressed="true"]::after { opacity: 1; transform: scaleX(1); }
  .methods small { color: var(--muted); font-size: .875rem; font-weight: 400; transition: color var(--ui-duration) var(--ui-ease); }
  .methods button[aria-pressed="true"] small { color: var(--ink); }
  .methods-heading { display: none; }
  .eyebrow { font-size: .875rem; color: var(--muted); letter-spacing: .08em; margin-block-end: .75rem; }
  h2 { font-size: 1.625rem; margin-block: 0 1rem; }
  :lang(en) .controls h2 { font-size: 2rem; }
  #method-description { font-size: 1.125rem; margin-block-end: .75rem; }
  .view-suggestion { border: 0; padding: .5rem 0; font-size: .875rem; text-align: start; text-decoration: underline; text-underline-offset: .4em; }
  .light-controls { padding-block-start: 0; }
  .fine-panel .light-controls legend { margin-block-end: .4rem; }
  .lighting { display: flex; padding: .2rem; gap: .2rem; border-radius: 2rem; background: #172b30; }
  .lighting button { flex: 1 1 0; min-inline-size: 0; border: 0; border-radius: 2rem; padding: .5rem .25rem; color: var(--muted); font-size: .875rem; }
  .lighting button[aria-pressed="true"], .lighting button[aria-pressed="true"]:hover { background: #e4eee6; color: #14252a; }
  #light-help { font-size: .875rem; color: var(--muted); margin-block: .5rem 0; line-height: 1.5; }
  .zoom-controls { margin-block: .9rem .35rem; }
  .zoom-controls label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
  output { font-variant-numeric: tabular-nums; }
  input[type="range"] { appearance: none; inline-size: 100%; block-size: 2.75rem; margin: .25rem 0 0; background: transparent; cursor: pointer; }
  input[type="range"]::-webkit-slider-runnable-track { block-size: 1px; background: var(--accent); }
  input[type="range"]::-webkit-slider-thumb { appearance: none; inline-size: .875rem; block-size: .875rem; border: 0; border-radius: 50%; background: var(--ink); margin-block-start: -.4rem; }
  input[type="range"]::-moz-range-track { block-size: 1px; background: var(--accent); }
  input[type="range"]::-moz-range-thumb { inline-size: .875rem; block-size: .875rem; border: 0; border-radius: 50%; background: var(--ink); }
  .fine-panel input[type="range"] { block-size: 2rem; }
  .reset { inline-size: 100%; border: 0; padding-inline: 0; text-align: start; font-size: .875rem; color: var(--muted); }
  .keyboard-help { color: var(--muted); font-size: .875rem; margin-block: 1rem 0; }
  @media (max-width: 35rem) {
    .viewer { grid-template-rows: 3.5rem 17rem auto; }
    .grain-labels { font-size: 1.125rem; gap: .5rem; padding-block-end: 1rem; }
    :lang(en) .grain-labels { font-size: 1.375rem; }
    .grain-labels small { font-size: .875rem; }
    /* Narrow screens hide the axis notes, so give the choices a metal-rimmed key shape that reads apart from the grain labels. */
    .methods-heading { display: block; margin: .25rem 0 0; padding-block-start: 1rem; border-block-start: 1px solid var(--rule); color: var(--muted); font-size: .8125rem; letter-spacing: .04em; }
    .methods { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: .625rem; padding-block: .75rem .5rem; }
    .methods button { --rim-angle: 35deg; --ripple: 200%; isolation: isolate; overflow: hidden; padding: .625rem .5rem; gap: .25rem; align-content: center; border-radius: 1.375rem; color: var(--muted); background: radial-gradient(120% 90% at 50% 0%, #23363a, #152428 60%, #0f1c1f); box-shadow: inset 0 1px 0 #ffffff12, inset 0 -1px 2px #00000080, 0 2px 4px #00000073; }
    .methods small { display: none; }
    .methods button::before, .methods button::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.25px; pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
    .methods button::before { background: linear-gradient(180deg, #5b6f71, #2b3c3f 45%, #1c2b2e 55%, #3f5356); }
    .methods button::after { inset-inline: 0; inset-block-end: 0; block-size: auto; opacity: 0; transform: none; mix-blend-mode: screen; transition: none; }
    .methods button:hover:not(:disabled) { background: radial-gradient(120% 90% at 50% 0%, #283d41, #172a2e 60%, #101e21); }
    .methods button[aria-pressed="true"], .methods button[aria-pressed="true"]:hover { color: #f3f6f4; background: radial-gradient(circle, transparent calc(var(--ripple) - 35%), #e6f0ec38 var(--ripple), transparent calc(var(--ripple) + 3%)), radial-gradient(120% 100% at 50% 0%, #2e4549, #182a2e 55%, #101e21); box-shadow: inset 0 1px 0 #ffffff24, inset 0 -2px 3px #0000008c, 0 0 0 1px #00000066, 0 4px 12px #00000080, 0 0 18px #d6e4e01a; animation: rim-ripple .6s ease-out; }
    .methods button[aria-pressed="true"]::before { padding: 1.5px; background: conic-gradient(from var(--rim-angle), #f7faf9, #6e7f80 30deg, #1d2a2c 50deg, #c9d3d1 75deg, #f7faf9 90deg, #6e7f80 120deg, #1d2a2c 140deg, #c9d3d1 165deg, #f7faf9 180deg, #6e7f80 210deg, #1d2a2c 230deg, #c9d3d1 255deg, #f7faf9 270deg, #6e7f80 300deg, #1d2a2c 320deg, #c9d3d1 345deg, #f7faf9); animation: rim-flow 1.1s cubic-bezier(.2, .7, .3, 1); }
    .methods button[aria-pressed="true"]::after { opacity: .35; padding: 1.5px; background: conic-gradient(from calc(var(--rim-angle) + 6deg), transparent 80deg, #ff6a5c 88deg, transparent 96deg 170deg, #ff6a5c 178deg, transparent 186deg 260deg, #ff6a5c 268deg, transparent 276deg 350deg, #ff6a5c 358deg), conic-gradient(from calc(var(--rim-angle) - 6deg), transparent 80deg, #6aa8ff 88deg, transparent 96deg 170deg, #6aa8ff 178deg, transparent 186deg 260deg, #6aa8ff 268deg, transparent 276deg 350deg, #6aa8ff 358deg); animation: rim-flow 1.1s cubic-bezier(.2, .7, .3, 1); }
    .controls { margin-block-start: 1rem; }
    .method-description .eyebrow { margin-block-end: .25rem; }
    .languages button { padding-inline: .5rem; }
  }
  @media (max-width: 22rem) and (max-height: 44rem) {
    /* Trim the canvas margin on small, short screens; comparison scale is shared. */
    .viewer { grid-template-rows: 3.5rem 13rem auto; }
  }
  @media (max-width: 22rem) {
    :lang(en) .grain-labels { font-size: 1rem; }
    .grain-labels small { font-size: .75rem; }
    .viewer-tools { gap: .25rem; padding-inline: 0; }
  }
  @media (max-width: 16rem) {
    .viewer-tools { margin-inline: -.875rem; }
    #direction-current { inline-size: 2.75rem; font-size: .8125rem; }
  }
  @media (prefers-reduced-motion: reduce) { .methods button, .methods button::before, .methods button::after { animation: none !important; } }
  @media (prefers-reduced-motion: reduce) { button, summary, footer details summary::before, .methods button::after, .methods small, .settings-toggle svg, .fine-panel, .fine-panel[data-open="true"] { transition: none; } button:active:not(:disabled) { transform: none; } .load-grain, .viewer[data-hint="playing"] .direction-arrow span { animation: none; } }
  @media (forced-colors: active) { button[aria-pressed="true"] { outline: 2px solid Highlight; } }
}
