/* Home page eras (index.php). Each era is a full-width section with its own backdrop
   drawn by ::before. Each one overlaps the one above and fades in over it, so scrolling blends
   one screen into the next. */

@font-face {
    font-family: 'White Rabbit';
    src: url('/fonts/whitrabt.ttf') format('truetype');
    font-display: swap;
}

:root {
    --seam: clamp(9rem, 28vh, 16rem);
}

.era {
    position: relative;
    isolation: isolate;
    padding: 5rem 1.5rem calc(var(--seam) + 4rem);
}

.era::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
}

.era + .era {
    margin-top: calc(var(--seam) * -1);
    padding-top: calc(var(--seam) + 4rem);
}

.era + .era::before {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--seam));
    mask-image: linear-gradient(to bottom, transparent, #000 var(--seam));
}

/* Black to black needs no blend, just a gap between the two screens */
.era-3270 {
    padding-bottom: 4rem;
}

.era-3270 + .era-pericom {
    margin-top: 0;
    padding-top: 4rem;
}

/* Room for the X root window to read as a desktop round the windows */
.era-x11 {
    padding-bottom: calc(var(--seam) + 8rem);
}

.era-pericom + .era-x11 {
    padding-top: calc(var(--seam) + 7rem);
}

/* Brought in by eras.js as it scrolls into view */
.reveal {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.tw-on .reveal:not(.in) {
    opacity: 0;
    transform: translateY(1.5rem);
}

/* The year, ticking over as the page scrolls, dressed for whichever era it is in */
.era-year {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 30;
    pointer-events: none;
    font-family: var(--vdu);
    font-size: 3.2rem;
    line-height: 1;
    padding: 0.6rem 1.2rem;
    color: #000000;
    background: var(--fg);
    transition: all 0.4s ease;
}

[data-era="pericom"] .era-year {
    font-family: 'White Rabbit', var(--mono);
    font-size: 2.2rem;
    color: #04121C;
    background: #8FD8FF;
    box-shadow: 0 0 10px rgba(120, 200, 255, 0.6);
}

[data-era="x11"] .era-year {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #000000;
    background: #FFFFFF;
    border: 2px solid #000000;
}

[data-era="aqua"] .era-year {
    font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif;
    font-size: 2rem;
    color: #FFFFFF;
    padding: 0.7rem 1.8rem;
    border-radius: 2rem;
    background: linear-gradient(#8CC4FF, #2A78E4 50%, #0D55C4 51%, #5FB0FF);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}

[data-era="html5"] .era-year {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: #FFFFFF;
    padding: 1rem 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* ===== 1989, 3270 ===== */
/* The screen itself is styles.css; only the backdrop and the logo's dither colour live here */
.era-3270::before {
    background: #000000;
}

/* ===== 1991, PERICOM ===== */
.era-pericom {
    --pc: #8FD8FF;
    --pc-hi: #E2F6FF;
    --pc-dim: #4A8DB8;
    --pc-glow: 0 0 6px rgba(120, 200, 255, 0.55);
}

.era-pericom::before {
    background: radial-gradient(ellipse at 50% 35%, #0A1118 0%, #030507 70%);
}

.crt {
    margin: 0 auto;
    padding: 1.75rem;
    border-radius: 2.5rem;
    background: linear-gradient(160deg, #3A3C40, #1B1C1E 60%, #111214);
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Glass: near-black blue, vignetted, a curved highlight and faint scan lines over it */
.crt-glass {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 2rem 2rem;
    border-radius: 1.75rem / 2.5rem;
    background: radial-gradient(ellipse at 50% 45%, #0C2233 0%, #06121C 60%, #02070B 100%);
    box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(140, 210, 255, 0.15);
    color: var(--pc);
    font-family: 'White Rabbit', var(--mono);
    font-size: 1rem;
    line-height: 1.6;
    text-shadow: var(--pc-glow);
}

.crt-glass::before,
.crt-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crt-glass::before {
    background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
}

.crt-glass::after {
    background:
        radial-gradient(ellipse 70% 40% at 28% 8%, rgba(200, 235, 255, 0.13), transparent 70%),
        linear-gradient(115deg, transparent 55%, rgba(200, 235, 255, 0.04) 62%, transparent 70%);
}

.pc-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 1rem;
    background: var(--pc);
    color: #04121C;
    text-shadow: none;
    padding: 0 0.5rem;
    margin-bottom: 2rem;
}

.pc-logo {
    display: block;
    width: 100%;
    max-width: 34rem;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 5px rgba(120, 200, 255, 0.55));
}

.pc-logo .h { fill: var(--pc-hi); }
.pc-logo .n { fill: var(--pc); }
.pc-logo .d { fill: var(--pc-dim); }
.pc-logo .s { fill: #1E4D6B; }

/* Line drawing: a double rule round the page with a single rule teeing into it under the heading */
.pc-box {
    border: 4px double var(--pc);
    padding: 0 1.25rem 1.25rem;
    box-shadow: var(--pc-glow), inset var(--pc-glow);
}

.pc-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 1rem;
    color: var(--pc-hi);
    border-bottom: 1px solid var(--pc);
    margin: 0 -1.25rem 1.25rem;
    padding: 0.25rem 1.25rem;
}

.pc-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.75rem 2rem;
    margin: 0;
}

.pc-fields dt {
    color: var(--pc-hi);
    text-shadow: 0 0 8px rgba(160, 220, 255, 0.8);
}

.pc-fields dd {
    margin: 0;
}

.pc-prompt {
    margin-top: 1.5rem;
}

/* ===== 1996, X11 ===== */
/* The default X root window weave. Two pixels to a bit and grey on grey rather than black on white,
   on a layer of its own: one pixel black and white flickers as the page scrolls over it. */
.era-x11::before {
    background: #7A7A7A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Cpath fill='%23333333' d='M0 0h3v1H0zM0 1h1v1H0zM2 1h2v1H2zM0 2h2v1H0zM3 2h1v1H3zM1 3h3v1H1z'/%3E%3C/svg%3E") 0 0 / 8px 8px;
    image-rendering: pixelated;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.xdesk {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: start;
    margin: 0 auto;
}

/* twm frames: no shadows, no rounding, one pixel of ink */
.xwin {
    position: relative;
    background: #FFFFFF;
    border: 2px solid #000000;
    color: #000000;
}

.xtitle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 1.6rem;
    padding: 0 0.25rem;
    border-bottom: 2px solid #000000;
    font: 700 0.85rem/1 Helvetica, Arial, sans-serif;
    white-space: nowrap;
}

/* The focus highlight, twm's ruled lines between the name and the resize button */
.xtitle b {
    flex: 1;
    align-self: stretch;
    margin: 0.3rem 0;
    background: repeating-linear-gradient(to bottom, #000000 0 1px, transparent 1px 3px);
}

.xb-icon,
.xb-size {
    position: relative;
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    border: 1px solid #000000;
}

.xb-icon::after {
    content: '';
    position: absolute;
    inset: 30%;
    background: #000000;
}

.xb-size::after {
    content: '';
    position: absolute;
    left: 2px;
    bottom: 2px;
    width: 55%;
    height: 55%;
    border: 1px solid #000000;
    box-shadow: 2px -2px 0 -1px #FFFFFF, 3px -3px 0 -1px #000000;
}

.xbitmap {
    grid-column: 1 / 8;
    grid-row: 1;
}

.xbm-body {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem;
}

.xbm-tools {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font: 0.7rem/1.2 Helvetica, Arial, sans-serif;
}

.xbm-tools span {
    border: 1px solid #000000;
    border-radius: 3px;
    padding: 0.15rem 0.35rem;
    white-space: nowrap;
}

.xbm {
    flex: 1;
    min-width: 0;
    height: auto;
    align-self: center;
    border: 1px solid #000000;
}

.xclock {
    grid-column: 9 / 11;
    grid-row: 1;
    margin-top: 1.5rem;
}

.xclock svg {
    display: block;
    width: 100%;
    height: auto;
    padding: 0.3rem;
}

.xeyes {
    grid-column: 11 / 13;
    grid-row: 1;
    margin: 6rem 0 0 0.75rem;
    z-index: 3;
}

.xeyes svg {
    display: block;
    width: 100%;
    height: auto;
    padding: 0.3rem;
}

.xeyes ellipse {
    fill: #FFFFFF;
    stroke: #000000;
    stroke-width: 5;
}

.xterm {
    grid-column: 2 / 12;
    grid-row: 2;
    margin-top: -2rem;
    z-index: 2;
}

.xt-body {
    padding: 0.4rem 0.6rem 0.8rem;
    font-family: 'Cousine', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.35;
}

.xt-body p {
    margin: 0;
}

.xt-fields {
    display: grid;
    grid-template-columns: 6ch 1fr;
    margin: 0;
}

.xt-fields dd {
    margin: 0;
}

/* ===== 2000, AQUA ===== */
.era-aqua {
    --aq-font: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Helvetica, Arial, sans-serif;
}

.era-aqua::before {
    background:
        radial-gradient(ellipse 120% 60% at 20% 110%, rgba(90, 160, 255, 0.28), transparent 60%),
        radial-gradient(ellipse 90% 45% at 85% 0%, rgba(70, 140, 240, 0.3), transparent 60%),
        radial-gradient(ellipse 140% 30% at 50% 55%, rgba(160, 200, 255, 0.1), transparent 70%),
        linear-gradient(170deg, #0C1A3A, #17397A 45%, #0A1430);
}

.aq-logo {
    position: relative;
    max-width: 30rem;
    margin: 0 auto 1rem;
}

.aq-logo svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.aq-logo .aq-reflect {
    margin-top: -0.25rem;
    transform: scaleY(-1);
    filter: none;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 55%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 55%);
}

.aq-beta {
    position: absolute;
    top: 0;
    right: -1.5rem;
    transform: rotate(12deg);
    font: 700 0.75rem/1 var(--aq-font);
    color: #FFFFFF;
    padding: 0.3rem 0.55rem;
    border-radius: 0.6rem;
    background: linear-gradient(#FFB066, #F26B0F);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-transform: lowercase;
}

.aq-win {
    max-width: 64rem;
    margin: 0 auto;
    border-radius: 7px 7px 5px 5px;
    overflow: hidden;
    background: repeating-linear-gradient(to bottom, #FFFFFF 0 2px, #EEEFF2 2px 4px);
    box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.25);
    color: #111111;
    font-family: var(--aq-font);
    font-size: 0.85rem;
}

.aq-title {
    position: relative;
    text-align: center;
    padding: 0.3rem 0;
    background:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 2px),
        linear-gradient(#F4F4F4, #C8C8C8);
    border-bottom: 1px solid #8E8E8E;
    font-size: 0.85rem;
    color: #222222;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.aq-lights {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.4rem;
}

/* Gel buttons: a coloured sphere, a white gloss at the top and a glow at the bottom */
.aq-lights i {
    position: relative;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 80%, #FFB8A8, #FF5F4C 45%, #B71E0A 100%);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.aq-lights i:nth-child(2) { background: radial-gradient(circle at 50% 80%, #FFE6A0, #F5A623 45%, #A86A08 100%); }
.aq-lights i:nth-child(3) { background: radial-gradient(circle at 50% 80%, #C6F5A0, #5AC234 45%, #2A7512 100%); }

.aq-lights i::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    top: 6%;
    height: 40%;
    border-radius: 50%;
    background: linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.1));
}

.aq-list {
    width: 100%;
    border-collapse: collapse;
}

.aq-list th {
    text-align: left;
    font-weight: 400;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(#FFFFFF, #DCDCDC);
    border-bottom: 1px solid #A5A5A5;
    border-right: 1px solid #C2C2C2;
    color: #222222;
}

.aq-list td {
    padding: 0.35rem 0.6rem;
    vertical-align: top;
}

.aq-list td:first-child {
    width: 4.5rem;
    color: #444444;
}

.aq-list tbody tr:nth-child(odd) {
    background: #FFFFFF;
}

.aq-list tbody tr:nth-child(even) {
    background: #EDF3FE;
}

.aq-list tbody tr:hover {
    background: linear-gradient(#6CA3F7, #3874D8);
    color: #FFFFFF;
}

.aq-list tbody tr:hover td:first-child {
    color: #FFFFFF;
}

.aq-status {
    text-align: center;
    font-size: 0.7rem;
    color: #444444;
    padding: 0.25rem;
    border-top: 1px solid #B5B5B5;
    background: linear-gradient(#E8E8E8, #D2D2D2);
}

/* ===== NOW, HTML5 ===== */
.era-html5 {
    --h5-text: #E8E9F3;
    --h5-muted: #A3A8C3;
    --h5-grad: linear-gradient(90deg, #3B82F6, #22D3EE, #34D399, #22D3EE, #3B82F6);
    overflow: hidden;
    overflow: clip;
    padding-bottom: 6rem;
    color: var(--h5-text);
    font-family: 'Inter', system-ui, sans-serif;
}

.era-html5::before {
    background: #070816;
}

.h5-blobs {
    position: absolute;
    inset: 0;
    z-index: -1;
    filter: blur(70px);
    opacity: 0.65;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--seam) * 2));
    mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--seam) * 2));
}

.h5-blobs i {
    position: absolute;
    width: 45vmax;
    height: 45vmax;
    border-radius: 50%;
    animation: drift 14s ease-in-out infinite alternate;
}

.h5-blobs i:nth-child(1) { background: #1D4ED8; left: -10%; top: 0; }
.h5-blobs i:nth-child(2) { background: #0891B2; right: -15%; top: 20%; animation-duration: 17s; animation-direction: alternate-reverse; }
.h5-blobs i:nth-child(3) { background: #059669; right: 0; bottom: -10%; animation-duration: 15s; animation-direction: alternate-reverse; }

@keyframes drift {
    50% { transform: translate(18vw, -6vh) scale(1.25); }
    to { transform: translate(-6vw, 14vh) scale(0.9); }
}

/* A canvas network of drifting points, drawn by eras.js. It sticks to the viewport while the section
   scrolls under it, so it costs one screen of pixels, not the whole section. */
.h5-canvas {
    position: sticky;
    top: 0;
    display: block;
    z-index: -1;
    width: calc(100% + 3rem);
    height: 100vh;
    margin: calc(-4rem - var(--seam)) -1.5rem calc(-100vh + 4rem + var(--seam));
    pointer-events: none;
}

.era-html5 a {
    color: #FFFFFF;
}

.h5-logo {
    max-width: 26rem;
    margin: 0 auto 3rem;
}

.h5-logo svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 24px rgba(0, 116, 255, 0.55));
}

.h5-eyebrow {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--h5-muted);
    margin-bottom: 2rem;
}

.h5-time {
    position: relative;
    list-style: none;
    max-width: 46rem;
    margin: 0 auto;
    padding: 0 0 0 2rem;
}

/* The line draws itself down once the first entry is in */
.h5-time::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(#3B82F6, #22D3EE, #34D399);
    transform-origin: top;
    transition: transform 1.6s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.tw-on .h5-time:not(:has(li.in))::before {
    transform: scaleY(0);
}

.h5-time li {
    position: relative;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.h5-time li::before {
    content: '';
    position: absolute;
    left: calc(-2rem - 7px);
    top: 1.75rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22D3EE;
    box-shadow: 0 0 12px #22D3EE;
    animation: pulse 2.4s ease-out infinite;
}

.h5-time li:nth-child(2)::before { animation-delay: 0.6s; }
.h5-time li:nth-child(3)::before { animation-delay: 1.2s; }
.h5-time li:nth-child(4)::before { animation-delay: 1.8s; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7), 0 0 12px #22D3EE; }
    70% { box-shadow: 0 0 0 14px rgba(34, 211, 238, 0), 0 0 12px #22D3EE; }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0), 0 0 12px #22D3EE; }
}

.h5-year,
.h5-h {
    font-weight: 800;
    background: var(--h5-grad) 0 0 / 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    to { background-position: 300% 0; }
}

.h5-year {
    display: inline-block;
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.h5-time p,
.h5-card p,
.h5-who p {
    color: var(--h5-muted);
    line-height: 1.65;
}

.h5-note {
    max-width: 46rem;
    margin: 1.5rem auto 0;
    color: var(--h5-muted);
}

.h5-h {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    text-align: center;
    margin: 6rem 0 2.5rem;
}

.h5-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
}

/* Full rows only: seven cards as three then four, five as two then three */
.h5-grid > * {
    grid-column: span 3;
}

.h5-grid.is-3-4 > :nth-child(-n+3),
.h5-grid.is-2-3 > :nth-child(n+3) {
    grid-column: span 4;
}

.h5-grid.is-2-3 > :nth-child(-n+2) {
    grid-column: span 6;
}

/* Cards rise in one after another along the row */
.tw-on .h5-card.in {
    animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.h5-card:nth-child(2) { animation-delay: 0.08s; }
.h5-card:nth-child(3) { animation-delay: 0.16s; }
.h5-card:nth-child(4) { animation-delay: 0.24s; }
.h5-card:nth-child(5) { animation-delay: 0.32s; }
.h5-card:nth-child(6) { animation-delay: 0.4s; }
.h5-card:nth-child(7) { animation-delay: 0.48s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(2.5rem) scale(0.96); }
}

.h5-card {
    display: block;
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.h5-card:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.6);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1rem 2.5rem rgba(8, 145, 178, 0.25);
}

.h5-card:hover i {
    transform: rotate(-8deg) scale(1.1);
}

.h5-card i {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    color: #FFFFFF;
    background: linear-gradient(135deg, #7C3AED, #0891B2);
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.35);
    transition: transform 0.3s ease;
}

.h5-card h3 {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.h5-who {
    max-width: 46rem;
    margin: 0 auto;
    font-size: 1.05rem;
}

.h5-who p {
    margin-bottom: 1rem;
}

.h5-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.h5-btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    color: #FFFFFF;
    background: linear-gradient(135deg, #7C3AED, #0891B2);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.h5-btn:hover {
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.5);
}

.h5-btn.is-glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* ===== GRAFANA-STYLE PANEL ===== */
/* Grafana's dark theme: near-black dashboard, panels a step lighter, its green, orange and blue */
.gf-intro {
    max-width: 46rem;
    margin: -1rem auto 2rem;
    text-align: center;
    color: var(--h5-muted);
}

.gf {
    --gf-panel: #181B1F;
    --gf-line: #2C3235;
    --gf-text: #CCCCDC;
    --gf-dim: #8E8E9E;
    padding: 0.75rem;
    border: 1px solid var(--gf-line);
    border-radius: 6px;
    background: #111217;
    color: var(--gf-text);
    font-size: 0.85rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45);
}

.gf-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.gf-crumb {
    flex: 1;
    color: var(--gf-dim);
    white-space: nowrap;
}

.gf-crumb b {
    color: var(--gf-text);
    font-weight: 600;
}

.gf button {
    font: inherit;
    color: var(--gf-text);
    background: var(--gf-panel);
    border: 0;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}

.gf button:hover {
    color: #FFFFFF;
}

.gf-ranges {
    display: flex;
    border: 1px solid var(--gf-line);
    border-radius: 3px;
    overflow: hidden;
}

.gf-ranges button + button {
    border-left: 1px solid var(--gf-line);
}

.gf-ranges button.on {
    background: #3D71D9;
    color: #FFFFFF;
}

.gf .gf-zoom,
.gf .gf-refresh {
    border: 1px solid var(--gf-line);
    border-radius: 3px;
}

.gf-zoom[hidden] {
    display: none;
}

.gf.busy .gf-refresh i {
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gf-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.gf-panel {
    position: relative;
    overflow: hidden;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gf-line);
    border-radius: 4px;
    background: var(--gf-panel);
}

.gf-panel h4 {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gf-text);
}

.gf-sub {
    color: var(--gf-dim);
    font-weight: 400;
}

.gf-stat {
    min-height: 7.5rem;
}

.gf-stat b {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

.gf-stat canvas {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 38%;
}

.gf-plot {
    position: relative;
    height: 300px;
}

.gf-plot canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: pan-y;
}

.gf-tip {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gf-line);
    border-radius: 3px;
    background: #22252B;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 0.75rem;
    line-height: 1.6;
    white-space: nowrap;
}

.gf-tip b {
    display: block;
    color: #FFFFFF;
    font-weight: 600;
}

.gf-tip i,
.gf-legend i {
    display: inline-block;
    width: 0.9rem;
    height: 0.25rem;
    margin-right: 0.4rem;
    border-radius: 2px;
    vertical-align: middle;
}

.gf-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-top: 0.5rem;
}

.gf .gf-legend button {
    padding: 0.15rem 0;
    background: none;
}

.gf .gf-legend button.off {
    opacity: 0.4;
}

.gf-legend span {
    margin-left: 0.5rem;
    color: var(--gf-dim);
}

/* ===== NARROW SCREENS ===== */
/* Cards two to a row, the odd one out full width */
@media screen and (max-width: 1023px) {
    .h5-grid > *,
    .h5-grid.is-3-4 > *,
    .h5-grid.is-2-3 > * {
        grid-column: span 6;
    }

    .h5-grid > :last-child:nth-child(odd) {
        grid-column: span 12;
    }
}

@media screen and (max-width: 768px) {
    .h5-grid > *,
    .h5-grid.is-3-4 > *,
    .h5-grid.is-2-3 > * {
        grid-column: span 12;
    }

    :root {
        --seam: clamp(6rem, 18vh, 9rem);
    }

    .crt {
        padding: 0.75rem;
        border-radius: 1.5rem;
    }

    .crt-glass {
        padding: 1rem 1rem 1.5rem;
        font-size: 0.85rem;
    }

    .pc-fields,
    .xt-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .pc-fields dd {
        margin-bottom: 0.75rem;
    }

    .xt-fields dd {
        margin-bottom: 0.5rem;
    }

    .xdesk {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: flex-start;
    }

    .xbitmap,
    .xterm {
        flex: 1 1 100%;
        margin: 0;
    }

    .xterm {
        order: -1;
    }

    .xbm-tools {
        display: none;
    }

    .xclock,
    .xeyes {
        flex: 0 0 8rem;
        margin: 0;
    }

    .aq-beta {
        right: 0;
    }

    .gf-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .gf-crumb {
        flex-basis: 100%;
    }

    .gf-plot {
        height: 240px;
    }

    .era-year {
        transform: scale(0.65);
        transform-origin: left bottom;
    }
}

@media (prefers-reduced-motion: reduce) {
    .h5-blobs i,
    .h5-time li::before,
    .h5-year,
    .h5-h {
        animation: none;
    }
}
