/* Reference page, 2026-10-18. Stone sections with the Hypha REF colours:
   A (the mix) is gold, the compared sound is cyan. Colour never scores. */
.rf-page, .rf-scope {
  --rf-bay: #0e0c09;
  --rf-bay-raised: #18140f;
  --rf-bay-line: rgb(255 238 206 / 12%);
  --rf-ivory: #efe8da;
  --rf-body: #cfc6b4;
  --rf-muted: #a59b87;
  --rf-gold: #c4a768;
  --rf-cyan: #9fd3dc;
  --rf-stone-raised: #f4f1ea;
  --rf-ink: #33322b;
  --rf-stone-body: #4b4a43;
  --rf-stone-gold: #665128;
  --rf-line: #d2ccbf;
}
/* The evaluation is the one action in the photographic entrance, a quiet text link like the other entrances (2026-10-21). */
.rf-page .entrance-content > .entrance-actions { align-items: center; }
.rf-section { padding: 110px 0 40px; scroll-margin-top: calc(var(--header-h) + 24px); }
.rf-head { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 64px; align-items: end; margin-bottom: 48px; }
.rf-head h2 { margin-bottom: 0; }
.rf-head p:not(.story-kicker) { margin: 0 0 16px; color: var(--rf-stone-body); font-size: var(--site-copy-size); line-height: 1.85; }
.rf-head p:last-child { margin-bottom: 0; }
.rf-page h3 { margin: 0; word-break: keep-all; overflow-wrap: normal; text-wrap: balance; }
.rf-page main h2 { text-wrap: balance; }
.rf-page main p, .rf-page main dd, .rf-page main figcaption { text-wrap: pretty; }

/* A / B / C / V: a dark panel, one column per button */
.rf-keys { margin: 0; padding: clamp(18px, 3vw, 40px); border-radius: 22px; background: var(--rf-bay); box-shadow: 0 0 0 1px var(--rf-bay-line), 0 24px 48px rgb(40 32 20 / 22%); color: var(--rf-body); }
.rf-keys__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 22px); margin: 0; padding: 0; list-style: none; }
.rf-key { min-width: 0; padding: 22px 20px 24px; border-radius: 14px; background: var(--rf-bay-raised); box-shadow: inset 0 0 0 1px var(--rf-bay-line); }
.rf-key__letter { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px; border-radius: 10px; border: 1px solid var(--rf-cyan); color: var(--rf-cyan); font: 600 24px/1 var(--font-mono); }
.rf-key--a .rf-key__letter { border-color: var(--rf-gold); background: var(--rf-gold); color: var(--rf-bay); }
.rf-key__role { display: block; margin-bottom: 8px; font: 12px/1.5 var(--font-mono); letter-spacing: .14em; color: var(--rf-muted); }
.rf-page .rf-key h3 { color: var(--rf-ivory); }
.rf-key p { margin: 12px 0 0; font-size: 15px; line-height: 1.75; color: var(--rf-body); }
.rf-keys figcaption, .rf-figure figcaption { padding: 22px 4px 0; font-size: 13px; line-height: 1.7; color: var(--rf-muted); }
.rf-figure figcaption { color: var(--rf-stone-body); }

/* Light diagrams on stone */
.rf-figure { margin: 0; padding: clamp(20px, 3.6vw, 52px); border-radius: 22px; background: var(--rf-stone-raised); box-shadow: inset 0 1px 0 #faf8f3, 0 16px 32px rgb(66 55 36 / 10%); }
.rf-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }
.rf-cells li { min-width: 0; padding-top: 18px; border-top: 1px solid var(--rf-line); }
.rf-cells__tag { display: block; margin-bottom: 14px; font: 12px/1.6 var(--font-mono); letter-spacing: .08em; color: var(--rf-stone-gold); }
.rf-cells p { margin: 12px 0 0; font-size: 15px; line-height: 1.75; color: var(--rf-stone-body); }
.rf-timeline { display: block; width: 100%; height: auto; }
.rf-timeline text { font-family: var(--font-mono); font-size: 13px; fill: var(--rf-ink); }
.rf-timeline .rf-t-sub { fill: var(--rf-stone-body); font-size: 12px; }

/* 03 / CHECK: the one dark band of the page */
.rf-check { margin-top: 70px; padding: 110px 0; background: var(--rf-bay); color: var(--rf-body); }
.rf-check .story-kicker { color: var(--rf-gold); }
.rf-page .rf-check h2, .rf-page .rf-check h3 { color: var(--rf-ivory); }
.rf-check .rf-head p:not(.story-kicker) { color: var(--rf-body); }
.rf-anatomy { margin: 0; padding: clamp(20px, 3.4vw, 44px); border-radius: 22px; background: var(--rf-bay-raised); box-shadow: inset 0 0 0 1px var(--rf-bay-line); }
.rf-anatomy__set { margin: 0 0 22px; font: 12px/1.6 var(--font-mono); letter-spacing: .1em; color: var(--rf-muted); }
.rf-anatomy__tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; }
.rf-anatomy__tabs li { padding: 8px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rf-bay-line); font-size: 14px; line-height: 1.5; color: var(--rf-body); }
.rf-anatomy__tabs li:first-child { box-shadow: inset 0 0 0 1px var(--rf-cyan); color: var(--rf-ivory); }
.rf-anatomy__rows { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; }
.rf-anatomy__rows div { min-width: 0; padding-top: 16px; border-top: 1px solid var(--rf-bay-line); }
.rf-anatomy__rows dt { margin: 0 0 10px; font: 12px/1.6 var(--font-mono); letter-spacing: .1em; color: var(--rf-cyan); }
.rf-anatomy__rows dd { margin: 0; font-size: 15px; line-height: 1.75; color: var(--rf-body); }
.rf-check figcaption { padding: 22px 4px 0; font-size: 13px; line-height: 1.7; color: var(--rf-muted); }

/* Start: three steps */
.rf-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; counter-reset: rf-step; }
.rf-steps li { min-width: 0; padding: 30px 28px 32px; border-radius: 18px; background: var(--rf-stone-raised); box-shadow: inset 0 1px 0 #faf8f3, 0 2px 3px rgb(51 50 43 / 10%); counter-increment: rf-step; }
.rf-steps li::before { content: '0' counter(rf-step); display: block; margin-bottom: 20px; font: 12px/1.6 var(--font-mono); letter-spacing: .14em; color: var(--rf-stone-gold); }
.rf-steps p { margin: 14px 0 0; font-size: 15px; line-height: 1.8; color: var(--rf-stone-body); }

/* Conditions */
.rf-conditions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin: 0; }
.rf-conditions div { min-width: 0; padding: 22px 0 24px; border-top: 1px solid var(--rf-line); }
.rf-conditions dt { margin: 0 0 8px; font: 12px/1.6 var(--font-mono); letter-spacing: .12em; color: var(--rf-stone-gold); }
.rf-conditions dd { margin: 0; font-size: 15px; line-height: 1.8; color: var(--rf-stone-body); }
.rf-conditions dd a { display: inline-flex; min-height: 44px; align-items: center; }

/* Evaluation */
.rf-try { margin: 110px 0 0; padding: clamp(32px, 6vw, 80px); border-radius: 26px; background: var(--rf-stone-raised); box-shadow: inset 0 1px 0 #faf8f3, 0 20px 42px rgb(66 55 36 / 12%); }
.rf-try h2 { margin-bottom: 20px; }
.rf-try > p:not(.story-kicker) { max-width: 46em; margin: 0; color: var(--rf-stone-body); font-size: var(--site-copy-size); line-height: 1.85; }
.rf-try__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 34px 0 0; }
.rf-page .rf-try .rf-try__actions a.btn.btn--primary, .rf-page .rf-try .rf-try__actions a.btn.btn--primary:hover { color: #f5f1e9; }
.rf-page .rf-try .rf-try__actions a.btn.btn--ghost { color: var(--rf-ink); border-color: #b9b2a0; }
.rf-page .rf-try .rf-try__actions a.btn.btn--ghost:hover { border-color: var(--rf-ink); }
.rf-page .rf-try__actions a:not(.btn) { display: inline-flex; min-height: 44px; align-items: center; }
.rf-page .rf-try > p.rf-try__note { margin-top: 28px; font-size: 14px; color: var(--rf-stone-body); }
.rf-try__note a { display: inline-flex; min-height: 44px; align-items: center; }

.rf-page .rf-check a:focus-visible, .rf-page .rf-keys a:focus-visible { outline-color: var(--rf-gold); }

@media (max-width: 960px) {
  .rf-keys__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-anatomy__rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .rf-section { padding-top: 72px; }
  .rf-head { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 32px; }
  .rf-cells, .rf-conditions { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .rf-conditions { gap: 0; }
  .rf-check { margin-top: 48px; padding: 72px 0; }
  .rf-try { margin-top: 72px; border-radius: 18px; }
  .rf-keys, .rf-figure, .rf-anatomy { border-radius: 16px; }
}
@media (max-width: 520px) {
  .rf-keys__row, .rf-anatomy__rows { grid-template-columns: minmax(0, 1fr); }
  .rf-key { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .rf-key__letter { grid-row: span 3; margin-bottom: 0; }
}

/* 02 / PASSAGE: where each sound plays, as text lanes that stay readable on phones */
.rf-page, .rf-scope { --rf-gold-deep: #7d6328; --rf-cyan-deep: #2f6f79; }
.rf-lanes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rf-lane { display: grid; grid-template-columns: minmax(8.5em, .32fr) minmax(0, 1fr); gap: 6px 24px; align-items: center; padding: 14px 0; }
.rf-lane + .rf-lane { border-top: 1px solid var(--rf-line); }
.rf-lane__name { grid-row: span 2; font-size: 15px; line-height: 1.6; color: var(--rf-ink); }
.rf-lane__name b { display: inline-block; min-width: 1.6em; font: 600 15px/1.6 var(--font-mono); color: var(--rf-cyan-deep); }
.rf-lane--a .rf-lane__name b { color: var(--rf-gold-deep); }
.rf-lane__track { position: relative; height: 12px; border-radius: 6px; background: #e2dccf; }
.rf-lane--a .rf-lane__track { background: var(--rf-gold-deep); }
.rf-lane--v .rf-lane__track { background: var(--rf-cyan-deep); }
.rf-lane__cue { position: absolute; top: -4px; bottom: -4px; left: 40%; width: 24%; border-radius: 6px; background: var(--rf-cyan-deep); }
.rf-lane__pos { position: absolute; top: -9px; bottom: -9px; left: 62%; width: 3px; border-radius: 2px; background: var(--rf-ink); box-shadow: 0 0 0 2px var(--rf-stone-raised); }
.rf-lane__note { font-size: 14px; line-height: 1.6; color: var(--rf-stone-body); }
@media (max-width: 520px) {
  .rf-lane { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .rf-lane__name { grid-row: auto; }
}
.rf-statement { max-width: 30em; margin: 56px 0 0; font-family: 'Waldenburg', Georgia, serif; font-size: var(--site-card-size); line-height: 1.6; color: var(--rf-ivory); }

/* Kirin OS page: the same four buttons as a compact strip beside the Reference entry */
.rf-keys-mini.rf-keys__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: clamp(14px, 2.4vw, 28px); border-radius: 22px; background: var(--rf-bay); box-shadow: 0 0 0 1px var(--rf-bay-line), 0 20px 38px rgb(40 32 20 / 18%); }
.rf-keys-mini .rf-key { display: flex; align-items: center; gap: 16px; padding: 16px; font-size: 15px; line-height: 1.5; color: var(--rf-ivory); word-break: keep-all; overflow-wrap: anywhere; }
.rf-keys-mini .rf-key__letter { flex: none; width: 44px; height: 44px; margin: 0; font-size: 20px; }
@media (max-width: 520px) { .rf-keys-mini .rf-key { gap: 12px; padding: 12px; font-size: 14px; } .rf-keys-mini .rf-key__letter { width: 38px; height: 38px; font-size: 18px; } }


/* Real screens, 2026-10-22. The REF screen rises from the lower edge of the entrance,
   as Hybrid VU does on the Hypha page, and each section then shows the Hypha or
   Kirin OS screen it explains. The lift uses the entrance grid tokens, so the screen
   starts below the headline (desktop, right of the lead) or below the action link
   (narrow screens). Nothing here moves. */
.rf-rise {
  --rf-rise-width: min(880px, 60vw);
  --rf-rise-lift: min(
    calc(min(100svh - 180px, 50svh + 172px) - 80px - 2.04 * var(--entrance-heading-size)),
    calc(.6 * var(--rf-rise-width))
  );
  position: relative;
  padding: 0 0 110px;
  background: var(--rf-bay);
  color: var(--rf-body);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.rf-rise > .story-wrap { display: flex; flex-direction: column; }
.rf-rise > .story-wrap > .rf-rise__screen { position: relative; z-index: 3; align-self: flex-end; width: var(--rf-rise-width); max-width: none; margin: calc(-1 * max(0px, var(--rf-rise-lift))) 0 0; }
.rf-rise__screen .rf-shot__frame { border-radius: 22px; padding: clamp(6px, .7vw, 10px); background: #15110c; box-shadow: inset 0 1px 0 rgb(255 240 212 / 18%), inset 0 -1px 0 rgb(0 0 0 / 70%), 0 0 0 1px rgb(255 238 206 / 6%), 0 44px 88px rgb(0 0 0 / 55%), 0 12px 24px rgb(0 0 0 / 42%); }
.rf-rise__screen .rf-shot__frame img { border-radius: 15px; }
.rf-rise .rf-head { margin-top: clamp(64px, 8vw, 104px); }
.rf-rise .story-kicker { color: var(--rf-gold); }
.rf-page .rf-rise h2, .rf-page .rf-rise h3 { color: var(--rf-ivory); }
.rf-rise .rf-head p:not(.story-kicker) { color: var(--rf-body); }
.rf-rise .rf-keys { padding: 0; background: transparent; box-shadow: none; }
.rf-page .rf-rise a:focus-visible { outline-color: var(--rf-gold); }
@media (min-width: 961px) {
  .rf-page .story-hero .entrance-content > .entrance-lead { max-width: 14em; }
}
/* The Japanese lead breaks only between its two phrases. */
.rf-page .rf-chunk { display: inline-block; max-width: 100%; }

/* One frame for every screen, the same as the Hypha page. */
.rf-shot { max-width: 1000px; margin: 0 0 32px; min-width: 0; }
.rf-shot--end { margin-left: auto; }
.rf-shot__frame { display: block; padding: clamp(4px, .5vw, 7px); border-radius: 16px; background: #1b1711; box-shadow: inset 0 1px 0 rgb(255 240 212 / 14%), inset 0 -1px 0 rgb(0 0 0 / 55%), 0 2px 4px rgb(20 16 10 / 28%), 0 22px 44px rgb(20 16 10 / 30%); }
.rf-shot__frame img { display: block; width: 100%; height: auto; border-radius: 11px; background: var(--rf-bay); }
.rf-shot figcaption { max-width: 46em; padding: 16px 4px 0; font-size: 13px; line-height: 1.7; color: var(--rf-stone-body); }
.rf-rise .rf-shot figcaption, .rf-check .rf-shot figcaption { color: var(--rf-muted); }
/* 04 / PRESET: the CHECK screen, then the wide sharing screen, each large enough to read. */
.rf-presets-shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.rf-presets-shots .rf-shot { width: 100%; margin: 0; }
.rf-presets-shots .rf-shot:first-child { justify-self: end; }
/* The level question is one row at the foot of the B screen; wide screens show that row and the legend above it. */
.rf-shot--foot { max-width: none; }
.rf-shot--foot .rf-shot__frame img { aspect-ratio: 2678 / 240; object-fit: cover; object-position: 50% 100%; }

@media (max-width: 960px) {
  /* Narrow screens: the screen spans the width and starts below the action link. */
  .rf-rise {
    --rf-rise-width: 100%;
    --rf-rise-lift: min(
      calc(100svh - max(180px, 50svh - 172px) - 184px - 2.04 * var(--entrance-heading-size) - 3.4 * clamp(1rem, 1.55vw, 1.3rem)),
      calc(.6 * (100vw - 2 * var(--entrance-gutter)))
    );
  }
  .rf-rise > .story-wrap > .rf-rise__screen { align-self: stretch; }
  .rf-shot { max-width: none; }
}
@media (max-width: 760px) {
  .rf-rise { padding-bottom: 72px; }
  .rf-presets-shots { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .rf-shot { margin-bottom: 24px; }
  .rf-shot__frame, .rf-rise__screen .rf-shot__frame { border-radius: 12px; }
  .rf-shot__frame img, .rf-rise__screen .rf-shot__frame img { border-radius: 8px; }
  .rf-shot--foot .rf-shot__frame img { aspect-ratio: auto; object-fit: fill; }
}

/* The site material (styles.css, 2026-10-26): glass bays, raised letter keys, lit stone figures, sunken tracks.
   B, C and V keep Hypha's cyan; A keeps its gold. */
.rf-keys, .rf-keys-mini.rf-keys__row, .rf-anatomy { box-shadow: var(--mat-glass-lift-dark), 0 0 0 1px var(--mat-glass-edge); background-image: var(--mat-glass); }
.rf-key { background-image: var(--mat-key); box-shadow: var(--mat-key-lift), inset 0 0 0 1px var(--mat-key-edge); }
.rf-key__letter { background-image: linear-gradient(180deg, #2a2824 0%, #141311 100%); box-shadow: inset 0 1px 0 rgb(255 250 235 / 12%), inset 0 -2px 0 rgb(0 0 0 / 50%), 0 4px 10px rgb(0 0 0 / 45%), 0 0 22px rgb(159 211 220 / 8%); text-shadow: 0 0 12px rgb(159 211 220 / 25%); }
.rf-key--a .rf-key__letter { background-image: var(--mat-sheen); box-shadow: inset 0 1px 0 rgb(255 255 255 / 40%), inset 0 -2px 0 rgb(0 0 0 / 22%), 0 4px 10px rgb(0 0 0 / 45%), 0 0 26px rgb(196 167 104 / 28%); text-shadow: 0 1px 0 rgb(255 255 255 / 25%); }
.rf-anatomy__tabs li { background-image: var(--mat-key); box-shadow: inset 0 0 0 1px var(--rf-bay-line), inset 0 1px 0 rgb(255 250 235 / 10%), 0 3px 8px rgb(0 0 0 / 40%); }
.rf-anatomy__tabs li:first-child { box-shadow: inset 0 0 0 1px var(--rf-cyan), inset 0 1px 0 rgb(255 250 235 / 12%), 0 3px 8px rgb(0 0 0 / 40%), 0 0 18px rgb(159 211 220 / 14%); }
.rf-figure, .rf-steps li, .rf-try { background-image: var(--mat-stone); box-shadow: var(--mat-stone-lift), inset 0 0 0 1px var(--mat-stone-edge); }
.rf-lane__track { box-shadow: inset 0 1px 2px rgb(51 50 43 / 22%), 0 1px 0 #fff; }
.rf-lane--a .rf-lane__track, .rf-lane--v .rf-lane__track, .rf-lane__cue { background-image: var(--mat-sheen); box-shadow: inset 0 1px 0 rgb(255 255 255 / 30%), 0 1px 2px rgb(51 50 43 / 20%), 0 4px 8px -4px rgb(51 50 43 / 40%); }
.rf-shot__frame { background-image: var(--mat-glass); box-shadow: var(--mat-glass-lift), 0 0 0 1px var(--mat-glass-edge); }
