/* =========================================================================
   Relationship Replay -- one stylesheet, no framework.
   VHS / late-night-tape vibe: ink black, REC red, acid highlight, cream text.
   ========================================================================= */

:root {
    color-scheme: dark; /* native audio controls, scrollbars, checkboxes */
    --ink: #0e0a0f;
    --ink-2: #17111a;
    --ink-3: #221a26;
    --paper: #f7efe4;
    --muted: #a99ca9;
    --hot: #ff2d55;
    --hot-deep: #d81b42;
    --acid: #d7ff3c;
    --cyan: #3cf0ff;
    --line: rgba(247, 239, 228, 0.12);
    --line-strong: rgba(247, 239, 228, 0.24);

    --display: "Bricolage Grotesque", system-ui, sans-serif;
    --mono: "Space Mono", ui-monospace, monospace;

    --radius: 14px;
    --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--display);
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--acid); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.wrap-narrow { max-width: 780px; }
.dim { color: var(--muted); }

:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }

/* ---------- shared bits ---------- */

.rec-dot {
    display: inline-block;
    width: 0.6em; height: 0.6em;
    border-radius: 50%;
    background: var(--hot);
    box-shadow: 0 0 10px var(--hot);
    animation: blink 1.2s steps(1) infinite;
    vertical-align: 0.05em;
}
.btn .rec-dot { background: var(--paper); box-shadow: none; }

@keyframes blink { 50% { opacity: 0; } }

.eyebrow {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hot);
    margin: 0 0 14px;
}

.btn {
    display: inline-flex; align-items: center; gap: 0.5em;
    font-family: var(--display); font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 0.8em 1.4em;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-sm { font-size: 0.9rem; padding: 0.55em 1.05em; }
.btn-lg { font-size: 1.125rem; padding: 0.95em 1.7em; }

.btn-hot { background: var(--hot); color: var(--paper); box-shadow: 4px 4px 0 var(--acid); }
.btn-hot:hover { background: var(--hot-deep); box-shadow: 6px 6px 0 var(--acid); transform: translate(-1px, -1px); }
.btn-hot:disabled { opacity: 0.6; cursor: wait; transform: none; }

.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--paper); }

.link-btn {
    background: none; border: 0; padding: 0;
    color: var(--hot); font: inherit; font-weight: 600;
    text-decoration: underline; cursor: pointer;
}

/* ---------- nav ---------- */

.nav {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(14, 10, 15, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--paper); text-decoration: none;
    font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em;
}
.logo b { font-weight: 800; color: var(--hot); }
.logo-mark {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--hot); color: var(--ink);
    font-size: 1rem;
}

/* ---------- hero ---------- */

.vhs { position: relative; overflow: hidden; }

/* scanlines + vignette */
.vhs::before, .vhs::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.vhs::before {
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px);
    z-index: 1;
}
.vhs::after {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 45, 85, 0.28), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(60, 240, 255, 0.12), transparent 50%),
        radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6));
}

.vhs-hud {
    position: absolute; z-index: 2;
    top: 22px; left: 20px; right: 20px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.08em;
    color: var(--paper);
    text-shadow: 0 0 8px rgba(247, 239, 228, 0.5);
    opacity: 0.85;
}
.hud-rec { color: var(--hot); text-shadow: 0 0 8px var(--hot); }

.hero-inner {
    position: relative; z-index: 2;
    padding-top: clamp(100px, 16vh, 170px);
    padding-bottom: clamp(70px, 12vh, 130px);
}

.hero-title {
    font-weight: 800;
    font-size: clamp(2.6rem, 8.2vw, 6.4rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
    margin: 0 0 28px;
    max-width: 13ch;
}

/* chromatic aberration on the punchline */
.glitch {
    position: relative;
    display: inline-block;
    color: var(--hot);
    text-shadow: -3px 0 var(--cyan), 3px 0 rgba(255, 45, 85, 0.45);
}
.glitch::after {
    content: attr(data-text);
    position: absolute; left: 0; top: 0;
    color: var(--acid);
    clip-path: inset(0 0 100% 0);
    animation: glitch 4.5s infinite steps(1);
}
@keyframes glitch {
    0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
    88% { clip-path: inset(18% 0 58% 0); transform: translateX(-6px); }
    90% { clip-path: inset(62% 0 12% 0); transform: translateX(5px); }
    92% { clip-path: inset(40% 0 40% 0); transform: translateX(-3px); }
}

.hero-sub {
    max-width: 58ch;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: rgba(247, 239, 228, 0.86);
    margin: 0 0 34px;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-fine { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 22px 0 0; }

/* ---------- ticker ---------- */

.ticker {
    overflow: hidden;
    background: var(--acid); color: var(--ink);
    border-block: 2px solid var(--ink);
    transform: rotate(-1.2deg);
    margin: 0 -10px;
    position: relative; z-index: 3;
}
.ticker-track {
    display: flex; gap: 22px; width: max-content;
    padding: 14px 0;
    font-weight: 800; font-size: 1.15rem; text-transform: uppercase; letter-spacing: -0.01em;
    white-space: nowrap;
    animation: ticker 45s linear infinite;
}
.ticker-x { color: var(--hot); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */

.section { padding: clamp(80px, 12vw, 130px) 0; }
.section-alt { background: var(--ink-2); }

.section-title {
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 0 0 16px;
    max-width: 20ch;
}
.section-sub { color: var(--muted); font-size: 1.15rem; margin: 0 0 44px; }

/* how it works */
.steps {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 48px;
}
.step {
    position: relative;
    padding: 30px 26px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--ink-2), var(--ink));
}
.step h3 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 18px 0 8px; }
.step p { margin: 0; color: rgba(247, 239, 228, 0.78); }
.step-icon {
    display: grid; place-items: center;
    width: 54px; height: 54px; border-radius: 50%;
    border: 2px solid var(--paper);
    font-size: 1.3rem;
}
.step-icon.is-rec { border-color: var(--hot); color: var(--hot); }
.step-num {
    position: absolute; top: 22px; right: 24px;
    font-family: var(--mono); font-size: 0.85rem; color: var(--muted);
}

/* sounds familiar -- cassette cards */
.tapes {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.tape {
    position: relative;
    display: flex; flex-direction: column;
    padding: 18px 18px 22px;
    border-radius: var(--radius);
    background: var(--ink-3);
    border: 1px solid var(--line);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.tape:nth-child(odd)  { transform: rotate(-0.6deg); }
.tape:nth-child(even) { transform: rotate(0.5deg); }
.tape:hover { transform: rotate(0) translateY(-4px); border-color: var(--hot); }

.tape-label {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 8px 12px;
    background: var(--paper); color: var(--ink);
    border-radius: 6px;
    font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.tape-cat { font-weight: 700; color: var(--hot-deep); }
.tape-quote {
    flex: 1;
    font-size: 1.3rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em;
    margin: 20px 4px 22px;
}
.tape-reels { display: flex; justify-content: center; gap: 70px; }
.tape-reels span {
    width: 34px; height: 34px; border-radius: 50%;
    border: 6px dotted var(--muted);
    animation: spin 6s linear infinite paused;
}
.tape:hover .tape-reels span { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ask for help ---------- */

.ask { background:
    radial-gradient(ellipse at 100% 0%, rgba(255, 45, 85, 0.18), transparent 50%),
    var(--ink);
}

.ask-form {
    display: grid; gap: 30px;
    padding: clamp(20px, 4vw, 40px);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: rgba(23, 17, 26, 0.75);
}

.field { display: flex; flex-direction: column; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.label {
    font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--paper); padding: 0;
}
.label .dim { text-transform: none; letter-spacing: 0; }

input[type="text"], input[type="email"], textarea {
    width: 100%;
    font: inherit; color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: rgba(169, 156, 169, 0.7); }
input:focus, textarea:focus { outline: none; border-color: var(--hot); box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.25); }
textarea { resize: vertical; min-height: 220px; flex: 1; }

.counter { align-self: flex-end; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 600; font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.chip span:hover { border-color: var(--paper); }
.chip input:checked + span { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.chip input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 3px; }

.ask-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }

/* the tape deck */
.deck {
    display: flex; flex-direction: column; gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: var(--ink);
    border: 1px solid var(--line-strong);
}
.deck-head { display: flex; justify-content: space-between; align-items: center; }
.deck-time { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); }
.deck[data-state="recording"] .deck-time { color: var(--hot); }

.deck-meter {
    width: 100%; height: 64px;
    border-radius: 10px;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 8px),
        var(--ink-2);
}

.deck-controls { display: flex; align-items: center; gap: 18px; }
.deck-hint { margin: 0; color: var(--muted); font-size: 0.95rem; }
.deck[data-state="recording"] .deck-hint { color: var(--paper); }

.rec-btn {
    flex: none;
    display: grid; place-items: center;
    width: 78px; height: 78px;
    border-radius: 50%;
    border: 3px solid var(--paper);
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.rec-btn:hover { transform: scale(1.05); }
.rec-btn-inner {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--hot);
    box-shadow: 0 0 18px rgba(255, 45, 85, 0.6);
    transition: all 0.2s ease;
}
.deck[data-state="recording"] .rec-btn { border-color: var(--hot); animation: pulse 1.4s ease-out infinite; }
.deck[data-state="recording"] .rec-btn-inner { width: 28px; height: 28px; border-radius: 6px; }
.deck[data-state="unsupported"] .rec-btn { opacity: 0.35; cursor: not-allowed; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.55); }
    100% { box-shadow: 0 0 0 18px rgba(255, 45, 85, 0); }
}

.deck-preview { display: flex; flex-direction: column; gap: 10px; }
.deck-preview audio { width: 100%; }
.deck-preview-meta { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.deck-preview-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.deck-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; }
.deck-or::before, .deck-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.upload { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-btn {
    padding: 10px 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    font-weight: 600;
    transition: border-color 0.15s ease;
}
.upload:hover .upload-btn { border-color: var(--paper); }
.upload input:focus-visible + .upload-btn { outline: 2px solid var(--acid); outline-offset: 3px; }
.upload-fine { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* wants */
.wants { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.want input { position: absolute; opacity: 0; pointer-events: none; }
.want-card {
    display: flex; flex-direction: column; gap: 6px;
    height: 100%;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.want-card strong { font-size: 1.1rem; }
.want-card span { color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.want-card:hover { border-color: var(--paper); }
.want input:checked + .want-card { border-color: var(--hot); background: rgba(255, 45, 85, 0.1); box-shadow: inset 0 0 0 1px var(--hot); }
.want input:focus-visible + .want-card { outline: 2px solid var(--acid); outline-offset: 3px; }

.ask-row { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: rgba(247, 239, 228, 0.82); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--hot); }

.form-error {
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 45, 85, 0.12);
    border: 1px solid var(--hot);
    font-weight: 600;
}

.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.progress {
    position: relative; flex: 1; min-width: 200px;
    height: 34px; border-radius: 999px; overflow: hidden;
    background: var(--ink); border: 1px solid var(--line-strong);
}
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--hot); transition: width 0.2s ease; }
.progress-label { position: relative; display: block; text-align: center; line-height: 32px; font-family: var(--mono); font-size: 0.8rem; }

/* success */
.ask-done {
    text-align: center;
    padding: clamp(40px, 8vw, 80px) 24px;
    border: 1px solid var(--hot);
    border-radius: 22px;
    background: rgba(255, 45, 85, 0.08);
}
.ask-done:focus { outline: none; }
.done-icon { display: block; font-size: 3rem; color: var(--hot); }
.ask-done h3 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; margin: 8px 0; }
.ask-done p { color: rgba(247, 239, 228, 0.82); max-width: 46ch; margin: 0 auto 28px; }

/* ---------- faq ---------- */

.faq { margin-top: 36px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    list-style: none;
    display: flex; justify-content: space-between; gap: 20px;
    padding: 22px 0;
    font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em;
    cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--hot); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 24px; color: rgba(247, 239, 228, 0.8); max-width: 62ch; }

/* ---------- text pages (terms, privacy, 404) ---------- */

.text-page { padding: clamp(70px, 10vw, 110px) 0; }
.text-page h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.04em; line-height: 1; margin: 0 0 24px; }
.text-page h2 { font-size: 1.4rem; margin: 40px 0 10px; }
.text-page p, .text-page li { color: rgba(247, 239, 228, 0.82); }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 50px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--paper); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--hot); }
.footer-fine { flex-basis: 100%; margin: 10px 0 0; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* floating mobile cta */
.float-cta {
    position: fixed; left: 50%; bottom: 18px; z-index: 60;
    display: none; align-items: center; gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    background: var(--hot); color: var(--paper);
    font-weight: 800; text-decoration: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 3px 3px 0 var(--acid);
    transform: translate(-50%, 140%);
    transition: transform 0.25s ease;
}
.float-cta .rec-dot { background: var(--paper); box-shadow: none; }
.float-cta.is-visible { transform: translate(-50%, 0); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .ask-grid, .ask-row { grid-template-columns: 1fr; }
    .wants { grid-template-columns: 1fr; }
    textarea { min-height: 180px; }
}

@media (max-width: 640px) {
    .nav { padding: 12px 16px; }
    .wrap { padding-inline: 16px; }
    .logo-text { font-size: 1rem; }
    .nav .btn { display: none; }
    .float-cta { display: inline-flex; }
    .vhs-hud { top: 14px; left: 16px; right: 16px; font-size: 0.72rem; }
    .hud-mode { display: none; }
    .hero-ctas .btn { width: 100%; justify-content: center; }
    .tapes { grid-template-columns: 1fr; }
    .tape-reels { gap: 50px; }
    .submit-row .btn { width: 100%; justify-content: center; }
    .rec-btn { width: 68px; height: 68px; }
    .rec-btn-inner { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
