/* ============================================================
   Synapse Semiconductor — pre-order page
   (shares design tokens with synapsesemi.org)
   ============================================================ */

:root {
    --bg: #050608;
    --text: #e9ebee;
    --muted: #8b9099;
    --faint: #565b63;
    --line: rgba(255, 255, 255, 0.08);
    --serif: "Instrument Serif", Georgia, serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    min-height: 100vh;
    animation: fade 1.2s ease both;
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

::selection {
    background: var(--text);
    color: var(--bg);
}

/* ---------- Moving background ---------- */
.bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-veil {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% 30%, transparent 40%, rgba(5, 6, 8, 0.55) 100%),
        linear-gradient(to bottom, rgba(5, 6, 8, 0.35), transparent 25%, transparent 70%, rgba(5, 6, 8, 0.6));
}

/* ---------- Header ---------- */
.topbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.6rem clamp(1.4rem, 5vw, 3rem);
    max-width: 980px;
    margin: 0 auto;
}

.brand {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--text);
}

.brand-mail {
    font-size: 0.8rem;
    color: var(--faint);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.brand-mail:hover {
    color: var(--text);
}

/* ---------- Layout ---------- */
.buy {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 clamp(1.4rem, 5vw, 3rem) 4rem;
}

.buy-hero {
    text-align: center;
    padding: clamp(2.5rem, 9vh, 5.5rem) 0 clamp(2rem, 6vh, 3.5rem);
}

.kicker {
    font-size: 0.72rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 1.1rem;
}

.buy-hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 6.4vw, 4.1rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.buy-hero h1 em {
    font-style: italic;
}

.buy-hero .sub {
    max-width: 34rem;
    margin: 1.3rem auto 0;
    color: var(--muted);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}

/* ---------- Product card ---------- */
.buy-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(1.6rem, 4vw, 3.4rem);
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(1.6rem, 4vw, 3rem);
    background: rgba(9, 11, 15, 0.55);
    backdrop-filter: blur(6px);
}

/* ---------- The wafer ---------- */
.s-wafer {
    width: min(400px, 100%);
    margin: 0 auto;
    aspect-ratio: 1;
    filter: drop-shadow(0 22px 50px rgba(0, 0, 0, 0.55));
}

.s-wafer svg {
    width: 100%;
    height: 100%;
    display: block;
}

.s-wafer .die {
    transition: fill 0.7s ease;
}

.s-wafer .die.mac {
    fill: #5aa7ff;
    transition: fill 0.06s ease;
}

.s-wafer .die.pulse {
    fill: #8ec2ff;
    transition: fill 0.12s ease;
}

.s-wafer .sheen {
    animation: sheenSpin 16s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0.4;
}

@keyframes sheenSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.s-wafer .irid {
    animation: iridDrift 12s ease-in-out infinite alternate;
}

.s-wafer .irid.i2 {
    animation-duration: 9s;
    animation-delay: -4s;
}

@keyframes iridDrift {
    from { transform: translate(0, 0); }
    to { transform: translate(-26px, 18px); }
}

/* ---------- Product info ---------- */
.buy-info h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: -0.01em;
}

.price {
    margin-top: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price .amount {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
}

.price .per {
    color: var(--faint);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.specs {
    list-style: none;
    margin: 1.4rem 0 1.8rem;
    display: grid;
    gap: 0.55rem;
}

.specs li {
    color: var(--muted);
    font-weight: 300;
    font-size: 0.92rem;
    padding-left: 1.15rem;
    position: relative;
}

.specs li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: #5aa7ff;
    opacity: 0.85;
}

.buy-btn {
    display: inline-block;
    padding: 0.85rem 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.buy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.fine {
    margin-top: 1rem;
    color: var(--faint);
    font-size: 0.74rem;
    font-weight: 300;
    max-width: 26rem;
}

/* ---------- Footer ---------- */
.buy-foot {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 3.2rem;
    color: var(--faint);
    font-size: 0.78rem;
}

.buy-foot a {
    color: var(--faint);
    text-decoration: none;
    transition: color 0.3s ease;
}

.buy-foot a:hover {
    color: var(--text);
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
    .buy-card {
        grid-template-columns: 1fr;
    }

    .s-wafer {
        width: min(300px, 78vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .s-wafer .sheen,
    .s-wafer .irid {
        animation: none !important;
    }
}
