@font-face {
    font-family: Outfit;
    src: url("./assets/Outfit-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Share Tech Mono";
    src: url("./assets/Share-Tech-Mono.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --page: #080d10;
    --panel: #0e1519;
    --ink: #e6eeed;
    --muted: #829491;
    --line: #263436;
    --cyan: #00f3ff;
    --lime: #baff3f;
    --amber: #ffc433;
    --mono: "Share Tech Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: Outfit, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; }
body {
    overflow: hidden;
    background: radial-gradient(ellipse at 52% 43%, #122123 0%, #0b1317 36%, var(--page) 73%);
    color: var(--ink);
    font-family: var(--sans);
}

button, input { font: inherit; }
button { color: inherit; }
a, button, input, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
}

.page-shell {
    width: min(100%, 1600px);
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 480px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4.8vw, 76px);
    display: grid;
    grid-template-rows: 56px minmax(0, 1fr) 25px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: .04em;
    text-decoration: none;
}
.brand strong { color: #a9c7c1; font-weight: 650; }
.product-mark { display: flex; align-items: center; gap: 10px; color: #cad7d4; font-size: 13px; }
.product-mark-divider { color: #53645f; }
.product-mark a { color: var(--muted); text-decoration: none; }
.product-mark a:hover, .page-links a:hover { color: var(--cyan); }

.page-main {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 9px 0 7px;
}

.hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.visual-stage { flex: 1 1 0; width: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; }
.canvas-shell {
    position: relative;
    width: min(62svh, 56vw);
    aspect-ratio: 1;
    overflow: visible;
    flex: none;
}
.ring-fallback, .ring-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ring-fallback { object-fit: contain; filter: drop-shadow(0 0 25px #00e8f31c); }
.ring-canvas { opacity: 0; transition: opacity 160ms ease; }
.canvas-shell.canvas-ready .ring-fallback { display: none; }
.canvas-shell.canvas-ready .ring-canvas { opacity: 1; }
.readout {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    min-width: 104px;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    text-shadow: 0 1px 8px #071014;
}
.canvas-shell.canvas-ready .readout { display: flex; }
.readout-label, .readout-unit, .readout-phase { font-family: var(--mono); text-transform: uppercase; }
.readout-label { color: #91aaa1; font-size: 10px; letter-spacing: .18em; }
.readout-value { margin-top: 1px; color: #e3f4e9; font-size: clamp(25px, 3.4vh, 34px); font-weight: 500; line-height: 1.06; font-variant-numeric: tabular-nums; }
.readout-unit { color: #93b2a0; font-size: 10px; letter-spacing: .12em; }
.readout-phase { margin-top: 6px; color: var(--lime); font-size: 10px; letter-spacing: .18em; }
.hero-copy { margin-top: 0; text-align: center; }
.eyebrow { color: #78908a; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(24px, 3.3vh, 34px); font-weight: 550; letter-spacing: -.015em; line-height: 1.12; }
h1 span { color: #9db8af; font-weight: 420; }
.hero-copy p { margin: 4px 0 0; color: #9aaca7; font-size: 14px; line-height: 1.35; }

.control-panel {
    padding: 11px 15px 9px;
    border: 1px solid #2a3a3c;
    border-radius: 11px;
    background: linear-gradient(115deg, #111b1eec, #0d1519f2 56%, #10191bed);
    box-shadow: 0 14px 48px #0006, inset 0 1px #ffffff09;
}
.controls-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: clamp(14px, 3vw, 34px); }
.control-group { min-width: 0; }
.control-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #d8e3df; font-size: 14px; font-weight: 500; }
.control-heading output { color: #a8c1b7; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
input[type="range"] {
    display: block;
    width: 100%;
    height: 20px;
    margin: 6px 0 0;
    padding: 0;
    accent-color: var(--cyan);
    cursor: pointer;
}
input[type="range"]:disabled, button:disabled { cursor: not-allowed; opacity: .48; }
.scale { display: flex; justify-content: space-between; gap: 8px; color: #71847e; font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.motion-control { min-width: 86px; display: grid; grid-template-columns: auto auto; align-items: center; gap: 10px; }
.motion-label { grid-column: 1 / -1; color: #d8e3df; font-size: 14px; font-weight: 500; }
.pause-button, .export-button, .details-disclosure > summary {
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid #526a66;
    border-radius: 7px;
    background: #182426;
    color: #e3efeb;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}
.pause-button { min-width: 76px; }
.pause-button:hover:not(:disabled), .export-button:hover:not(:disabled), .details-disclosure > summary:hover { border-color: var(--cyan); background: #1b2a2d; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; }
.disclosure { margin: 0; color: #87a098; font-size: 12px; letter-spacing: .02em; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.details-disclosure { position: static; }
.details-disclosure > summary { display: block; list-style: none; }
.details-disclosure > summary::-webkit-details-marker { display: none; }
.details-close-label { display: none; }
.details-disclosure[open] > summary {
    position: fixed;
    z-index: 102;
    top: max(12px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    border-color: #577069;
    background: #152124;
    box-shadow: 0 7px 24px #0008;
}
.details-disclosure[open] .details-open-label { display: none; }
.details-disclosure[open] .details-close-label { display: inline; }
.details-disclosure[data-modal-open] > summary { display: none; }
.details-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.details-close-button {
    display: none;
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid #526a66;
    border-radius: 7px;
    background: #182426;
    color: #e3efeb;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}
html.js-enabled .details-close-button { display: inline-flex; align-items: center; justify-content: center; }
.details-close-button:hover { border-color: var(--cyan); background: #1b2a2d; }
.export-button { border-color: #24595b; background: #103033; color: #bdfbfb; }
.export-button:disabled { opacity: .48; }

.page-links { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 3vw, 34px); min-height: 24px; font-size: 13px; }
.page-links a { color: #a6b6b1; text-decoration: none; white-space: nowrap; }
.page-links .visualizer-link { color: #d9e7e2; font-weight: 600; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #62746f; font-family: var(--mono); font-size: 9px; letter-spacing: .02em; }

.details-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: max(56px, env(safe-area-inset-top) + 48px) 16px max(18px, env(safe-area-inset-bottom)); background: #05090be8; backdrop-filter: blur(8px); }
.details-card {
    width: min(920px, 100%);
    max-height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    padding: clamp(20px, 4vw, 38px);
    border: 1px solid #344a48;
    border-radius: 15px;
    background: linear-gradient(145deg, #10191c, #0a1114 78%);
    box-shadow: 0 24px 90px #000a;
    scrollbar-color: #526a66 #121c1e;
}
.details-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.details-heading h2 { margin: 4px 0 0; font-size: clamp(23px, 4vw, 31px); font-weight: 550; }
.details-hint { color: var(--muted); font-size: 12px; }
.details-description { max-width: 76ch; margin: 18px 0 22px; color: #c0ceca; font-size: 15px; line-height: 1.65; }
.details-body { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: 25px; align-items: start; }
.specification-block h3 { margin: 0 0 10px; color: #a7c0b6; font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; }
.specifications { margin: 0; }
.specifications div { display: grid; grid-template-columns: minmax(105px, .9fr) 1.1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ffffff10; font-size: 14px; }
.specifications dt { color: #7f948c; }
.specifications dd { margin: 0; color: #d4e0dc; }
.screenshot-block { margin: 0; }
.screenshot-block img { display: block; width: 100%; height: auto; border: 1px solid #354442; border-radius: 8px; background: #050910; }
.screenshot-block figcaption { margin-top: 7px; color: var(--muted); font-size: 12px; }

.sr-only {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-height: 680px) {
    .page-shell { grid-template-rows: 50px minmax(0, 1fr) 22px; }
    .page-main { gap: 7px; padding: 5px 0 4px; }
    .canvas-shell { width: min(46svh, 52vw); }
    .control-panel { padding: 8px 13px 7px; }
    .controls-grid { gap: clamp(12px, 2.4vw, 28px); }
    .page-footer { font-size: 8px; }
}

@media (max-width: 560px) {
    .page-shell { padding-right: 14px; padding-left: 14px; }
    .topbar { gap: 12px; }
    .product-mark { gap: 7px; font-size: 12px; }
    .canvas-shell { width: min(51svh, 88vw, 440px); }
    .control-panel { padding: 9px 10px 8px; }
    .controls-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 9px; }
    .control-heading { gap: 4px; font-size: 14px; }
    .control-heading output { font-size: 11px; }
    .motion-control { min-width: 66px; grid-template-columns: 1fr; justify-items: center; gap: 4px; }
    .motion-label { text-align: center; }
    .pause-button { min-width: 66px; padding-right: 9px; padding-left: 9px; }
    .scale { font-size: 8px; }
    .panel-footer { flex-direction: column; gap: 7px; margin-top: 7px; }
    .disclosure { font-size: 12px; }
    .panel-actions { justify-content: center; gap: 7px; }
    .details-disclosure > summary, .export-button { min-height: 33px; padding: 6px 9px; font-size: 13px; }
    .page-links { gap: clamp(13px, 5vw, 22px); font-size: 12px; }
    .page-footer { font-size: 8px; }
    .details-overlay { padding: 58px 9px max(9px, env(safe-area-inset-bottom)); }
    .details-card { padding: 18px 15px; border-radius: 12px; }
    .details-body { grid-template-columns: 1fr; gap: 18px; }
    .details-description { font-size: 14px; line-height: 1.55; }
    .specifications div { grid-template-columns: minmax(105px, .8fr) 1.2fr; gap: 8px; font-size: 13px; }
    .details-hint { display: none; }
    .details-close-button { min-height: 33px; padding: 6px 9px; font-size: 13px; }
}

@media (max-height: 560px) {
    .page-shell { min-height: 0; grid-template-rows: 42px minmax(0, 1fr) 20px; }
    .canvas-shell { width: min(37svh, 49vw, 265px); }
    .hero-copy .eyebrow { display: none; }
    h1 { font-size: 23px; }
    .hero-copy p { margin-top: 2px; font-size: 13px; }
    .page-main { gap: 5px; padding: 3px 0; }
    .control-panel { padding: 6px 10px; }
    .panel-footer { margin-top: 5px; }
    .page-links { min-height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@supports (width: 1cqh) {
    .visual-stage { container-type: size; }
    .canvas-shell {
        width: min(100cqw, 100cqh);
        height: min(100cqw, 100cqh);
        aspect-ratio: auto;
    }
}
