/* =====================================================
   bada.moe — Neon-Electric Ocean
   palette: #ffb830 #8b8fa8 #ff2d78 #e8eaf0 #39ff85 #00f0ff #141b2d #0a0e1a
   fonts: Cormorant Garamond / Quicksand / Source Code Pro
   compliance font tokens: Source Code Pro (Google Fonts Source Code Pro`: Pro" ("35.1028N timestamps. (Kuroshio
   ===================================================== */

:root {
    /* palette */
    --deep-water: #0a0e1a;
    --compartment: #141b2d;
    --neon-magenta: #ff2d78;
    --neon-cyan: #00f0ff;
    --data-green: #39ff85;
    --signal-amber: #ffb830;
    --text-primary: #e8eaf0;
    --text-muted: #8b8fa8;
    --divider: rgba(0, 240, 255, 0.15);
    --divider-strong: rgba(0, 240, 255, 0.28);
    --scanline: rgba(255, 45, 120, 0.06);
    --glitch-artifact: rgba(255, 45, 120, 0.3);

    /* type */
    --font-display: "Cormorant Garamond", Georgia, serif;
    --font-body: "Quicksand", "Inter", sans-serif;
    --font-mono: "Source Code Pro", "Menlo", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--deep-water);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    position: relative;
}

/* scroll snap for tray stacking */
html {
    scroll-snap-type: y proximity;
}

/* ---------- typography helpers ---------- */
.mono { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.05em; font-weight: 400; }
.mono.tiny { font-size: 0.68rem; }
.green { color: var(--data-green); }
.cyan { color: var(--neon-cyan); }
.magenta { color: var(--neon-magenta); }
.amber { color: var(--signal-amber); }
.muted { color: var(--text-muted); }

em { font-style: italic; color: var(--text-primary); }

.jp { font-family: var(--font-display); font-weight: 600; color: var(--neon-magenta); }

/* ---------- plankton background ---------- */
.plankton-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.plankton-field .plankton {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--neon-cyan);
    opacity: 0.6;
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.8);
    animation: planktonGlow 3s ease-in-out infinite;
}

@keyframes planktonGlow {
    0%, 100% { opacity: 0.3; transform: scale(0.85); }
    50%      { opacity: 0.8; transform: scale(1.1); }
}

/* ---------- scanline overlay ---------- */
.scanline-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        var(--scanline) 2px,
        var(--scanline) 3px
    );
    mix-blend-mode: screen;
    opacity: 0.55;
}

/* ---------- tray nav ---------- */
.tray-nav {
    position: fixed;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 30;
}

.tray-tab {
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid var(--divider);
    background: rgba(20, 27, 45, 0.7);
    color: var(--neon-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 200ms, box-shadow 200ms, color 200ms;
    padding: 0;
}
.tray-tab svg { display: block; }
.tray-tab .tab-dot {
    position: absolute;
    right: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 200ms, box-shadow 200ms;
}
.tray-tab:hover {
    border-color: var(--divider-strong);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.tray-tab.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.45), inset 0 0 8px rgba(0, 240, 255, 0.15);
}
.tray-tab.active .tab-dot {
    background: var(--neon-magenta);
    box-shadow: 0 0 8px rgba(255, 45, 120, 0.8);
}

/* ---------- tray (section) ---------- */
.tray {
    min-height: 100vh;
    padding: 36px 64px 36px 80px;
    position: relative;
    z-index: 1;
    scroll-snap-align: start;
    transition: opacity 300ms ease;
    opacity: 1;
}

.tray.fade-in { animation: trayFade 500ms ease both; }
@keyframes trayFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- bento grid ---------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 3px;
    width: 100%;
    height: calc(100vh - 72px);
    background: var(--divider);
    border: 1px solid var(--divider);
}

.cell {
    background: var(--compartment);
    border: 1px solid var(--divider);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* primary block: 7 cols x 4 rows, upper-left */
.cell-primary   { grid-column: 1 / span 7;  grid-row: 1 / span 4; }

/* stacked trio: 5 cols x 2 rows each, right side stacked */
.cell-trio-a    { grid-column: 8 / span 5;  grid-row: 1 / span 2; }
.cell-trio-b    { grid-column: 8 / span 5;  grid-row: 3 / span 1; }
.cell-trio-c    { grid-column: 8 / span 5;  grid-row: 4 / span 1; }

/* bottom band: full 12 cols x 4 rows, subdivided 4-4-4 */
.cell-bottom-a  { grid-column: 1 / span 4;  grid-row: 5 / span 4; }
.cell-bottom-b  { grid-column: 5 / span 4;  grid-row: 5 / span 4; }
.cell-bottom-c  { grid-column: 9 / span 4;  grid-row: 5 / span 4; }

/* tray 2 variant: make bottom-a wider */
#tray-2 .cell-bottom-a { grid-column: 1 / span 8; }
#tray-2 .cell-bottom-b { grid-column: 9 / span 4; }

/* ---------- cell chrome ---------- */
.cell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--divider);
}
.cell-tag { color: var(--neon-cyan); }
.cell-signature { color: var(--signal-amber); font-family: var(--font-mono); }

.cell-label {
    color: var(--neon-cyan);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}
.cell-label.amber { color: var(--signal-amber); }
.cell-label.green { color: var(--data-green); }
.cell-label.magenta { color: var(--neon-magenta); }

.cell-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed var(--divider);
    padding-top: 8px;
}

/* ---------- domain title ---------- */
.domain-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 7vw, 5.4rem);
    letter-spacing: 0.01em;
    line-height: 1;
    color: var(--text-primary);
    text-shadow:
        0 0 8px rgba(232, 234, 240, 0.3),
        0 0 28px rgba(0, 240, 255, 0.18);
    margin-top: 12px;
}
.title-dot {
    color: var(--neon-magenta);
    text-shadow:
        0 0 10px rgba(255, 45, 120, 0.7),
        0 0 30px rgba(255, 45, 120, 0.35);
}

.tray-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.8rem, 5vw, 3.6rem);
    letter-spacing: 0.01em;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(232, 234, 240, 0.2);
    margin-top: 8px;
}

#tray-3 .tray-title {
    font-style: normal;
    color: var(--neon-magenta);
    text-shadow:
        0 0 10px rgba(255, 45, 120, 0.5),
        0 0 32px rgba(255, 45, 120, 0.22);
}

.tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    color: var(--text-muted);
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    letter-spacing: 0.015em;
}

/* ---------- glitch effect ---------- */
.glitch-text {
    position: relative;
    display: inline-block;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    pointer-events: none;
}
.glitch-text::before {
    color: var(--neon-cyan);
    transform: translate(-2px, 0);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    mix-blend-mode: screen;
    animation: glitchChannelCyan 7s steps(1, end) infinite;
    clip-path: polygon(0 0, 100% 0, 100% 48%, 0 48%);
    opacity: 0.6;
}
.glitch-text::after {
    color: var(--neon-magenta);
    transform: translate(2px, 0);
    text-shadow: 0 0 10px rgba(255, 45, 120, 0.5);
    mix-blend-mode: screen;
    animation: glitchChannelMagenta 7s steps(1, end) infinite;
    clip-path: polygon(0 52%, 100% 52%, 100% 100%, 0 100%);
    opacity: 0.6;
}
@keyframes glitchChannelCyan {
    0%, 6%, 7.5%, 100% { transform: translate(-2px, 0); opacity: 0.25; }
    6.5% { transform: translate(-5px, 1px); opacity: 0.75; }
    7%   { transform: translate(-3px, -1px); opacity: 0.55; }
}
@keyframes glitchChannelMagenta {
    0%, 6%, 7.5%, 100% { transform: translate(2px, 0); opacity: 0.25; }
    6.5% { transform: translate(5px, -1px); opacity: 0.75; }
    7%   { transform: translate(3px, 1px); opacity: 0.55; }
}

.glitch-wrap {
    animation: glitchBurst 15s step-end infinite;
}
@keyframes glitchBurst {
    0%, 6.4%, 7.1%, 100% { transform: translateX(0); filter: none; }
    6.5% { transform: translateX(3px); filter: hue-rotate(20deg); }
    6.7% { transform: translateX(-4px); filter: hue-rotate(-15deg); }
    6.9% { transform: translateX(2px); filter: hue-rotate(10deg); }
    7%   { transform: translateX(0); filter: none; }
}

/* ---------- wave SVG ---------- */
.wave-svg {
    width: 100%;
    height: 40%;
    flex: 1 1 auto;
    margin-top: 12px;
    overflow: visible;
}
.wave-path {
    fill: none;
    stroke: var(--neon-cyan);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 1600;
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.35));
}
.wave-path-1 { animation: waveShift 8s linear infinite; }
.wave-path-2 {
    stroke: var(--neon-magenta);
    filter: drop-shadow(0 0 4px rgba(255, 45, 120, 0.3));
    opacity: 0.7;
    animation: waveShift 11s linear infinite reverse;
}
.wave-path-3 {
    stroke: var(--data-green);
    filter: drop-shadow(0 0 4px rgba(57, 255, 133, 0.25));
    opacity: 0.55;
    animation: waveShift 14s linear infinite;
}
.wave-cyan    { stroke: var(--neon-cyan); animation: waveShift 9s linear infinite; }
.wave-magenta { stroke: var(--neon-magenta); opacity: 0.85; filter: drop-shadow(0 0 6px rgba(255,45,120,0.35)); animation: waveShift 12s linear infinite reverse; }
.wave-green   { stroke: var(--data-green); opacity: 0.75; filter: drop-shadow(0 0 6px rgba(57,255,133,0.3)); animation: waveShift 16s linear infinite; }

@keyframes waveShift {
    0%   { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1600; }
}

.wave-primary {
    stroke-dasharray: 1800;
    animation: waveDrawIn 1800ms ease-out forwards;
}
@keyframes waveDrawIn {
    from { stroke-dashoffset: 1800; }
    to   { stroke-dashoffset: 0; }
}

/* ---------- coord readout ---------- */
.coord-readout {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}
.coord-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted var(--divider);
    padding-bottom: 6px;
}
.coord-key {
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
}
.coord-val {
    color: var(--data-green);
    font-size: 0.82rem;
    text-shadow: 0 0 6px rgba(57, 255, 133, 0.35);
}

.coord-ping {
    margin-top: auto;
    display: flex;
    gap: 4px;
    align-items: center;
}
.coord-ping span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.7);
    animation: pingPulse 1.4s ease-in-out infinite;
}
.coord-ping span:nth-child(2) { animation-delay: 0.25s; background: var(--data-green); box-shadow: 0 0 8px rgba(57,255,133,0.7); }
.coord-ping span:nth-child(3) { animation-delay: 0.5s; background: var(--signal-amber); box-shadow: 0 0 8px rgba(255,184,48,0.7); }
@keyframes pingPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.35; }
    50%      { transform: scale(1.15); opacity: 1; }
}

/* ---------- haiku ---------- */
.haiku {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.55;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    margin: 6px 0;
}
.haiku.small { font-size: clamp(0.9rem, 1.5vw, 1.05rem); }
.haiku-translation {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    margin-top: auto;
}
.haiku-translation.small { font-size: 0.78rem; }

/* ---------- frequency bars ---------- */
.freq-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60%;
    margin-top: 6px;
}
.freq-bars span {
    flex: 1;
    height: var(--h);
    background: var(--data-green);
    box-shadow: 0 0 6px rgba(57, 255, 133, 0.5);
    animation: tidalPulse 4s ease-in-out infinite alternate;
    animation-delay: var(--d);
    transform-origin: bottom;
}
@keyframes tidalPulse {
    from { transform: scaleY(0.55); opacity: 0.65; }
    to   { transform: scaleY(1);    opacity: 1; }
}
.freq-axis {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dotted var(--divider);
}

/* ---------- tidal bars (tray 2) ---------- */
.tidal-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 55%;
    margin-top: 6px;
}
.tidal-bars span {
    flex: 1;
    height: var(--h);
    background: var(--data-green);
    box-shadow: 0 0 8px rgba(57, 255, 133, 0.5);
    animation: tidalPulse 4s ease-in-out infinite alternate;
    animation-delay: var(--d);
    transform-origin: bottom;
    position: relative;
}
.tidal-bars span::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.8);
}
.tidal-axis {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dotted var(--divider);
}

/* ---------- phase list ---------- */
.phase-list {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-top: 4px;
}
.phase-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px dotted var(--divider);
}
.phase-time { color: var(--data-green); font-size: 0.78rem; }
.phase-time.amber { color: var(--signal-amber); text-shadow: 0 0 8px rgba(255,184,48,0.5); }
.phase-name {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ---------- sparkline ---------- */
.sparkline {
    width: 100%;
    height: 60%;
    margin-top: 6px;
    overflow: visible;
}
.sparkline-path {
    filter: drop-shadow(0 0 4px rgba(255, 184, 48, 0.5));
    animation: sparklineShift 6s ease-in-out infinite alternate;
}
@keyframes sparklineShift {
    from { transform: translateX(0); }
    to   { transform: translateX(-6px); }
}
.spark-axis {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    padding-top: 4px;
    border-top: 1px dotted var(--divider);
}

/* ---------- narrative / prose ---------- */
.prose {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    max-width: 62ch;
}
.prose.small { font-size: 0.88rem; }
.prose em { color: var(--neon-cyan); font-family: var(--font-display); font-style: italic; font-weight: 500; }

/* ---------- current map ---------- */
.current-map {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.current-map svg {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(255, 45, 120, 0.3));
}
.compass-sweep {
    transform-origin: 60px 60px;
    animation: compassSpin 6s linear infinite;
}
@keyframes compassSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.current-legend {
    display: flex;
    justify-content: space-between;
    border-top: 1px dotted var(--divider);
    padding-top: 6px;
    color: var(--text-muted);
}

/* ---------- log list ---------- */
.log-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.72rem;
}
.log-list li {
    display: flex;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px dotted var(--divider);
}
.log-list li:last-child { border-bottom: none; }
.log-ts { color: var(--data-green); }
.log-msg { color: var(--text-primary); }
.log-msg.amber { color: var(--signal-amber); }

/* ---------- radar stage (tray 2) ---------- */
.radar-stage {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.radar-svg {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 0 16px rgba(255, 45, 120, 0.25));
}
.radar-sweep {
    transform-origin: 200px 200px;
    animation: radarSweep 8s linear infinite;
}
@keyframes radarSweep {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.radar-blips circle {
    animation: blipBlink 2s ease-in-out infinite;
    filter: drop-shadow(0 0 6px currentColor);
}
.radar-blips circle:nth-child(1) { animation-delay: 0s; }
.radar-blips circle:nth-child(2) { animation-delay: .3s; }
.radar-blips circle:nth-child(3) { animation-delay: .6s; }
.radar-blips circle:nth-child(4) { animation-delay: .9s; }
.radar-blips circle:nth-child(5) { animation-delay: 1.2s; }
.radar-blips circle:nth-child(6) { animation-delay: 1.5s; }
@keyframes blipBlink {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}
.radar-label {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
}
.radar-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px dotted var(--divider);
}

/* ---------- signal meter ---------- */
.signal-meter {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 50%;
    margin-bottom: 8px;
}
.signal-bar {
    flex: 1;
    height: calc(var(--lv) * 100%);
    background: var(--neon-magenta);
    box-shadow: 0 0 10px rgba(255, 45, 120, 0.6);
    animation: signalShimmer 1.8s ease-in-out infinite alternate;
}
.signal-bar:nth-child(1) { animation-delay: 0s; }
.signal-bar:nth-child(2) { animation-delay: .2s; }
.signal-bar:nth-child(3) { animation-delay: .4s; }
.signal-bar:nth-child(4) { animation-delay: .6s; }
.signal-bar:nth-child(5) { animation-delay: .8s; }
@keyframes signalShimmer {
    from { opacity: 0.55; transform: scaleY(0.85); transform-origin: bottom; }
    to   { opacity: 1;    transform: scaleY(1);    transform-origin: bottom; }
}

/* ---------- tx entry (tray 3 logs) ---------- */
.tx-entry {
    color: var(--text-primary);
    font-size: 0.78rem;
    line-height: 1.7;
    letter-spacing: 0.03em;
    margin-top: 6px;
}

/* ---------- interference viz ---------- */
.interference-viz {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.iv-dot {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    filter: blur(16px);
    animation: ivFloat 7s ease-in-out infinite;
}
.iv-dot.c1 { width: 80px; height: 80px; background: var(--neon-cyan);    top: 15%; left: 20%; animation-delay: 0s; }
.iv-dot.c2 { width: 90px; height: 90px; background: var(--neon-magenta); top: 40%; left: 55%; animation-delay: 1s; }
.iv-dot.c3 { width: 70px; height: 70px; background: var(--data-green);   top: 60%; left: 25%; animation-delay: 2s; }
.iv-dot.c4 { width: 60px; height: 60px; background: var(--neon-cyan);    top: 25%; left: 70%; animation-delay: 3s; opacity: .7; }
.iv-dot.c5 { width: 75px; height: 75px; background: var(--neon-magenta); top: 65%; left: 65%; animation-delay: 4s; opacity: .75; }
.iv-dot.c6 { width: 50px; height: 50px; background: var(--data-green);   top: 10%; left: 50%; animation-delay: 5s; opacity: .6; }
@keyframes ivFloat {
    0%, 100% { transform: translate(0, 0); }
    25%      { transform: translate(18px, -14px); }
    50%      { transform: translate(-12px, 20px); }
    75%      { transform: translate(10px, 8px); }
}
.iv-legend {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 14px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dotted var(--divider);
}

/* ---------- breakpoints ---------- */
@media (max-width: 1024px) {
    .tray { padding: 28px 36px 28px 64px; }
    .bento-grid { height: calc(100vh - 56px); }
    .domain-title { font-size: clamp(2rem, 10vw, 4.2rem); }
}

@media (max-width: 768px) {
    html { scroll-snap-type: none; }
    .tray {
        padding: 20px 18px 20px 54px;
        min-height: auto;
    }
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 3px;
        height: auto;
    }
    .cell, .cell-primary, .cell-trio-a, .cell-trio-b, .cell-trio-c,
    .cell-bottom-a, .cell-bottom-b, .cell-bottom-c,
    #tray-2 .cell-bottom-a, #tray-2 .cell-bottom-b {
        grid-column: unset;
        grid-row: unset;
        width: 100%;
        min-height: 220px;
    }
    .cell-primary { min-height: 360px; }
    .radar-stage { min-height: 280px; }
    .tray-nav { left: 10px; gap: 12px; }
    .tray-tab { width: 28px; height: 28px; }
}

@media (max-width: 480px) {
    .bento-grid { gap: 6px; }
    .cell { border-radius: 8px; padding: 16px 16px; }
    .domain-title { font-size: clamp(1.8rem, 12vw, 3.2rem); }
    .tray { padding: 18px 14px 18px 48px; }
}
