/* sync.noisedeck.app
 *
 * Loaded after handfish index.css. The first block re-points handfish tokens
 * at the Sync palette (cobalt accents on an indigo-tinted neutral scale) and
 * adds the display face. Everything below uses tokens only. */

@font-face {
    font-family: 'Orbitron';
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
    src: url('https://fonts.noisefactor.io/fonts/orbitron/Orbitron%5Bwght%5D.woff2') format('woff2');
}

@font-face {
    font-family: 'Orbitron Blank';
    font-weight: 400 900;
    font-style: normal;
    font-display: block;
    src: url('https://fonts.noisefactor.io/fonts/orbitron/Orbitron-Blank.woff2') format('woff2');
}

:root,
[data-theme="sync"] {
    /* Neutrals: indigo-tinted, near-black to cool white (hue 275) */
    --hf-color-1: oklch(11.5% 0.030 275);
    --hf-color-2: oklch(16.5% 0.040 275);
    --hf-color-3: oklch(23.0% 0.052 275);
    --hf-color-4: oklch(30.0% 0.060 275);
    --hf-color-5: oklch(68.0% 0.045 270);
    --hf-color-6: oklch(88.0% 0.025 265);
    --hf-color-7: oklch(97.5% 0.010 260);

    /* Accents: cobalt */
    --hf-accent-1: oklch(24% 0.090 262);
    --hf-accent-2: oklch(34% 0.130 262);
    --hf-accent-3: oklch(70% 0.180 262);
    --hf-accent-4: oklch(84% 0.110 262);

    --hf-blue: oklch(70% 0.180 262);

    /* Second brand hue, used sparingly for gradients */
    --sync-indigo: oklch(58% 0.220 290);
    --sync-cobalt: var(--hf-accent-3);

    --sync-font-display: 'Orbitron', 'Orbitron Blank', var(--hf-font-family);

    /* Floating look: rounder, glassier, softer */
    --hf-radius-sm: 10px;
    --hf-radius-md: 14px;
    --hf-radius: 18px;
    --hf-radius-lg: 24px;
    --hf-radius-xl: 32px;
    --hf-panel-opacity: 62%;
    --hf-panel-transparency: 38%;
    --hf-glass-blur: blur(24px);
    --hf-border: color-mix(in srgb, var(--hf-accent-3) 22%, transparent 78%);
    --hf-border-hover: color-mix(in srgb, var(--hf-accent-3) 45%, transparent 55%);
    --hf-shadow-lg: 0 24px 60px oklch(0% 0 0 / 0.45), 0 0 0 1px color-mix(in srgb, var(--hf-accent-3) 10%, transparent 90%);
    --hf-glow-accent: 0 0 32px color-mix(in srgb, var(--hf-accent-3) 35%, transparent 65%);

    --sync-max-width: 1120px;
    --sync-gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ------------------------------------------------------------------------
 * Page
 * --------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--hf-font-family);
    font-size: var(--hf-size-md);
    line-height: var(--hf-leading-relaxed);
    color: var(--hf-text-normal);
    background:
        radial-gradient(ellipse 70% 50% at 20% 30%, color-mix(in srgb, var(--hf-accent-2) 60%, transparent 40%), transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 70%, color-mix(in srgb, var(--sync-indigo) 22%, transparent 78%), transparent 70%),
        var(--hf-bg-base);
}

.bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.6s ease;
}

.bg-canvas[data-state="running"] {
    opacity: 1;
}

main,
.topbar,
.footer {
    position: relative;
    z-index: 1;
}

a {
    color: var(--hf-link-color);
    text-decoration: none;
    transition: var(--hf-transition-color);
}

a:hover {
    color: var(--hf-link-hover);
}

.display {
    font-family: var(--sync-font-display);
    font-weight: var(--hf-weight-bold);
    letter-spacing: 0.01em;
    line-height: var(--hf-leading-tight);
    color: var(--hf-text-bright);
    margin: 0;
}

.eyebrow {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    font-weight: var(--hf-weight-medium);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hf-accent);
    margin: 0 0 var(--hf-space-4);
}

.eyebrow-sep {
    color: var(--hf-text-dim);
    margin: 0 0.4em;
}

code,
.hf-pre {
    font-family: var(--hf-font-family-mono);
}

code {
    font-size: 0.9em;
    padding: 0.1em 0.4em;
    border-radius: var(--hf-radius-sm);
    background: color-mix(in srgb, var(--hf-accent-3) 12%, transparent 88%);
    color: var(--hf-text-bright);
}

.hf-pre {
    margin: var(--hf-space-4) 0;
    padding: var(--hf-space-4);
    border-radius: var(--hf-radius-md);
    background: color-mix(in srgb, var(--hf-bg-base) 80%, transparent 20%);
    border: var(--hf-border-width) solid var(--hf-border);
    overflow-x: auto;
    line-height: var(--hf-leading-relaxed);
}

.hf-pre code {
    padding: 0;
    background: transparent;
    color: var(--hf-text-normal);
    font-size: var(--hf-size-sm);
}

.quiet-link {
    color: var(--hf-text-dim);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--hf-text-dim) 40%, transparent 60%);
    text-underline-offset: 0.2em;
}

.quiet-link:hover {
    color: var(--hf-text-bright);
}

.fine {
    font-size: var(--hf-size-sm);
    color: var(--hf-text-dim);
}

/* ------------------------------------------------------------------------
 * Buttons: larger than handfish controls, tuned for a marketing page
 * --------------------------------------------------------------------- */

.hf-btn.btn-lg {
    min-height: 3rem;
    padding: 0 var(--hf-space-6);
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-sm);
    font-weight: var(--hf-weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--hf-radius-pill);
    white-space: nowrap;
}

.hf-btn.hf-btn-primary.btn-lg {
    background: linear-gradient(135deg, var(--sync-cobalt), var(--sync-indigo));
    border-color: transparent;
    color: var(--hf-text-bright);
    box-shadow: var(--hf-glow-accent);
}

.hf-btn.hf-btn-primary.btn-lg:hover {
    background: linear-gradient(135deg, var(--hf-accent-4), var(--sync-indigo));
    color: var(--hf-bg-base);
}

.hf-btn.btn-lg:not(.hf-btn-primary):not(.hf-btn-ghost) {
    background: color-mix(in srgb, var(--hf-bg-elevated) var(--hf-panel-opacity), transparent var(--hf-panel-transparency));
    backdrop-filter: var(--hf-glass-blur-sm);
    -webkit-backdrop-filter: var(--hf-glass-blur-sm);
    color: var(--hf-text-bright);
}

/* ------------------------------------------------------------------------
 * Floating top bar
 * --------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: var(--hf-space-4);
    display: flex;
    justify-content: center;
    padding: 0 var(--sync-gutter);
    z-index: var(--hf-z-sticky);
}

.topbar-pill {
    display: flex;
    align-items: center;
    gap: var(--hf-space-6);
    padding: var(--hf-space-2) var(--hf-space-3) var(--hf-space-2) var(--hf-space-4);
    border-radius: var(--hf-radius-pill);
    background: color-mix(in srgb, var(--hf-bg-surface) 70%, transparent 30%);
    backdrop-filter: var(--hf-glass-blur);
    -webkit-backdrop-filter: var(--hf-glass-blur);
    border: var(--hf-border-width) solid var(--hf-border);
    box-shadow: var(--hf-shadow-lg);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--hf-space-2);
    color: var(--hf-text-bright);
}

.brand-mark {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--hf-accent-4), var(--sync-cobalt) 55%, var(--sync-indigo));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--hf-accent-3) 60%, transparent 40%));
}

.brand-mark-sm {
    font-size: 1.25rem;
}

.brand-word {
    font-family: var(--sync-font-display);
    font-weight: var(--hf-weight-bold);
    font-size: var(--hf-size-md);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hf-text-bright);
}

.brand-word-parent {
    font-weight: var(--hf-weight-normal);
    color: var(--hf-text-dim);
    letter-spacing: 0.08em;
    font-size: 0.72em;
    margin-inline-end: 0.35em;
}

.topbar-links {
    display: flex;
    gap: var(--hf-space-4);
}

.topbar-links a {
    font-size: var(--hf-size-sm);
    font-weight: var(--hf-weight-medium);
    color: var(--hf-text-normal);
    padding: var(--hf-space-1) var(--hf-space-2);
    border-radius: var(--hf-radius-pill);
}

.topbar-links a:hover {
    color: var(--hf-text-bright);
    background: color-mix(in srgb, var(--hf-accent-3) 12%, transparent 88%);
}

.badge-preview {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hf-accent-4);
    padding: 0.3rem 0.7rem;
    border-radius: var(--hf-radius-pill);
    border: var(--hf-border-width) solid var(--hf-border-hover);
    background: color-mix(in srgb, var(--hf-accent-3) 12%, transparent 88%);
}

/* ------------------------------------------------------------------------
 * Layout
 * --------------------------------------------------------------------- */

main {
    max-width: var(--sync-max-width);
    margin: 0 auto;
    padding: 0 var(--sync-gutter) var(--hf-space-12);
}

.section {
    padding: clamp(3rem, 8vw, 6rem) 0 0;
}

.section-head {
    max-width: 44rem;
    margin-bottom: var(--hf-space-8);
}

.section-head h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
}

.section-lede {
    color: var(--hf-text-dim);
    margin: var(--hf-space-4) 0 0;
}

.hf-card {
    box-shadow: var(--hf-shadow-lg);
    border-radius: var(--hf-radius-lg);
    padding: var(--hf-space-6);
}

.hf-card h3,
.doc h3 {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-lg);
    font-weight: var(--hf-weight-semibold);
    letter-spacing: 0.04em;
    color: var(--hf-text-bright);
    margin: 0 0 var(--hf-space-3);
}

.hf-card h4,
.doc h4 {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    font-weight: var(--hf-weight-medium);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--hf-accent);
    margin: var(--hf-space-6) 0 var(--hf-space-3);
}

.hf-card p,
.doc p {
    margin: 0 0 var(--hf-space-3);
}

.hf-card p:last-child,
.doc p:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------------------
 * Hero
 * --------------------------------------------------------------------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    padding: clamp(3rem, 9vw, 7rem) 0 0;
}

.hero h1 {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    margin: 0 0 var(--hf-space-5);
    text-shadow: 0 0 40px color-mix(in srgb, var(--hf-accent-3) 30%, transparent 70%);
}

.lede {
    font-size: var(--hf-size-lg);
    color: var(--hf-text-normal);
    max-width: 34rem;
    margin: 0 0 var(--hf-space-6);
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hf-space-3);
    margin-bottom: var(--hf-space-5);
}

.hero-meta {
    font-size: var(--hf-size-sm);
    color: var(--hf-text-dim);
    margin: 0;
}

.hero-meta [data-sync-version] {
    color: var(--hf-text-normal);
}

.hero-video {
    margin: 0;
}

.hero-video-frame {
    position: relative;
    border-radius: var(--hf-radius-lg);
    overflow: hidden;
    background: var(--hf-bg-base);
    border: var(--hf-border-width) solid var(--hf-border-hover);
    box-shadow:
        var(--hf-shadow-lg),
        0 0 80px color-mix(in srgb, var(--hf-accent-3) 22%, transparent 78%),
        0 0 160px color-mix(in srgb, var(--sync-indigo) 18%, transparent 82%);
    transform: translateY(-4px);
}

.hero-video video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: inherit;
}

.hero-video figcaption {
    margin-top: var(--hf-space-3);
    font-size: var(--hf-size-sm);
    color: var(--hf-text-dim);
    text-align: center;
}

.video-sound {
    position: absolute;
    inset-inline-end: var(--hf-space-3);
    inset-block-end: var(--hf-space-3);
    display: inline-flex;
    align-items: center;
    gap: var(--hf-space-2);
    padding: 0.4rem 0.8rem;
    border-radius: var(--hf-radius-pill);
    border: var(--hf-border-width) solid var(--hf-border);
    background: color-mix(in srgb, var(--hf-bg-base) 70%, transparent 30%);
    backdrop-filter: var(--hf-glass-blur-sm);
    -webkit-backdrop-filter: var(--hf-glass-blur-sm);
    color: var(--hf-text-bright);
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--hf-transition-bg), var(--hf-transition-border);
}

.video-sound:hover {
    border-color: var(--hf-border-hover);
    background: color-mix(in srgb, var(--hf-bg-base) 85%, transparent 15%);
}

.video-sound:focus-visible {
    outline: var(--hf-focus-ring-width) solid var(--hf-focus-ring-color);
    outline-offset: var(--hf-focus-ring-offset);
}

.video-sound-icon {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--hf-text-dim);
    box-shadow: none;
    transition: var(--hf-transition-bg);
}

.video-sound[aria-pressed="true"] .video-sound-icon {
    background: var(--hf-accent);
    box-shadow: 0 0 10px var(--hf-accent);
}

/* ------------------------------------------------------------------------
 * How it works
 * --------------------------------------------------------------------- */

.flow {
    list-style: none;
    margin: 0 0 var(--hf-space-6);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--hf-space-5);
    position: relative;
}

.flow-step {
    position: relative;
}

.flow-index {
    display: block;
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    letter-spacing: 0.2em;
    color: var(--hf-accent);
    margin-bottom: var(--hf-space-5);
}

.flow-step::after {
    content: '';
    position: absolute;
    top: 50%;
    inset-inline-end: calc(-1 * var(--hf-space-5));
    width: var(--hf-space-5);
    height: 1px;
    background: linear-gradient(90deg, var(--hf-border-hover), transparent);
}

.flow-step:last-child::after {
    display: none;
}

.two-up {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hf-space-5);
    margin-bottom: var(--hf-space-6);
}

.notice {
    border-color: color-mix(in srgb, var(--hf-yellow) 35%, transparent 65%);
    background: color-mix(in srgb, var(--hf-yellow) 6%, color-mix(in srgb, var(--hf-bg-surface) var(--hf-panel-opacity), transparent var(--hf-panel-transparency)) 94%);
}

.notice h3 {
    color: var(--hf-yellow);
}

/* ------------------------------------------------------------------------
 * Tabs (handfish .hf-tabs) and panels
 * --------------------------------------------------------------------- */

.tabbed .hf-tabs {
    flex-wrap: wrap;
    margin-bottom: var(--hf-space-5);
}

.tabbed .hf-tabs-pill {
    display: inline-flex;
    background: color-mix(in srgb, var(--hf-bg-surface) 70%, transparent 30%);
    backdrop-filter: var(--hf-glass-blur-sm);
    -webkit-backdrop-filter: var(--hf-glass-blur-sm);
    border: var(--hf-border-width) solid var(--hf-border);
    border-radius: var(--hf-radius-pill);
    padding: 0.3rem;
}

.tabbed .hf-tab {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.6rem 1rem;
}

.tabbed .hf-tabs-pill .hf-tab {
    border-radius: var(--hf-radius-pill);
}

.tabbed .hf-tabs-pill .hf-tab.active,
.tabbed .hf-tabs-pill .hf-tab[aria-selected="true"] {
    background: linear-gradient(135deg, color-mix(in srgb, var(--sync-cobalt) 35%, transparent 65%), color-mix(in srgb, var(--sync-indigo) 35%, transparent 65%));
    color: var(--hf-text-bright);
}

.tab-panel[hidden] {
    display: none;
}

.panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--hf-space-6);
    align-items: start;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--hf-space-3);
    text-align: center;
}

.spec {
    list-style: none;
    margin: var(--hf-space-4) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--hf-space-2);
}

.spec li {
    font-size: var(--hf-size-sm);
    color: var(--hf-text-normal);
    padding: 0.3rem 0.75rem;
    border-radius: var(--hf-radius-pill);
    border: var(--hf-border-width) solid var(--hf-border);
    background: color-mix(in srgb, var(--hf-bg-base) 50%, transparent 50%);
}

.steps {
    margin: 0;
    padding-inline-start: 1.4rem;
}

.steps li {
    margin-bottom: var(--hf-space-2);
    padding-inline-start: 0.3rem;
}

.steps li::marker {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-xs);
    color: var(--hf-accent);
}

/* Docs panels are laid out as prose in a wide floating card */
.doc {
    max-width: 52rem;
    padding: var(--hf-space-8);
    border-radius: var(--hf-radius-lg);
    background: color-mix(in srgb, var(--hf-bg-surface) var(--hf-panel-opacity), transparent var(--hf-panel-transparency));
    backdrop-filter: var(--hf-glass-blur);
    -webkit-backdrop-filter: var(--hf-glass-blur);
    border: var(--hf-border-width) solid var(--hf-border);
    box-shadow: var(--hf-shadow-lg);
}

.doc ul {
    padding-inline-start: 1.2rem;
    margin: 0 0 var(--hf-space-3);
}

.doc li {
    margin-bottom: var(--hf-space-2);
}

.counters,
.faq {
    margin: var(--hf-space-4) 0;
    display: grid;
    gap: var(--hf-space-3);
}

.counters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.counters > div,
.faq > div {
    padding: var(--hf-space-4);
    border-radius: var(--hf-radius-md);
    border: var(--hf-border-width) solid var(--hf-border);
    background: color-mix(in srgb, var(--hf-bg-base) 45%, transparent 55%);
}

.counters dt,
.faq dt {
    font-family: var(--sync-font-display);
    font-size: var(--hf-size-sm);
    letter-spacing: 0.06em;
    color: var(--hf-text-bright);
    margin-bottom: var(--hf-space-2);
}

.counters dd,
.faq dd {
    margin: 0;
    color: var(--hf-text-normal);
}

/* ------------------------------------------------------------------------
 * Footer
 * --------------------------------------------------------------------- */

.footer {
    padding: var(--hf-space-8) var(--sync-gutter) var(--hf-space-10);
}

.footer-inner {
    max-width: var(--sync-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--hf-space-6);
    align-items: center;
    padding-top: var(--hf-space-6);
    border-top: var(--hf-border-width) solid var(--hf-border);
    font-size: var(--hf-size-sm);
    color: var(--hf-text-dim);
}

.footer-inner p {
    margin: 0;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--hf-space-2);
}

.footer-links {
    display: flex;
    gap: var(--hf-space-4);
}

/* ------------------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------------- */

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-video {
        order: -1;
    }

    .flow {
        grid-template-columns: 1fr;
    }

    .flow-step::after {
        display: none;
    }

    .two-up,
    .counters {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

@media (max-width: 720px) {
    .topbar {
        top: var(--hf-space-2);
    }

    .topbar-pill {
        gap: var(--hf-space-3);
        padding-inline: var(--hf-space-3);
    }

    .topbar-links {
        gap: var(--hf-space-1);
    }

    .badge-preview {
        display: none;
    }

    .brand-word-parent {
        display: none;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .panel-actions {
        align-items: stretch;
    }

    .doc {
        padding: var(--hf-space-5);
    }

    .hero-ctas .hf-btn {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .bg-canvas {
        display: none;
    }
}

/* Compact page: one wide explanation card, no numbered flow */
.panel-wide {
    max-width: 52rem;
}

.panel-wide p {
    font-size: var(--hf-size-lg);
}

.panel-wide .fine {
    font-size: var(--hf-size-sm);
    margin-top: var(--hf-space-4);
}

.section-head .eyebrow {
    margin-bottom: var(--hf-space-2);
}
