/* Better Voice — Dusk web. Tokens first, then primitives, then page sections. */

:root {
    color-scheme: light dark;

    --ground: #f1f2f6;
    --ground-deep: #e8eaf0;
    --ink: #14161b;
    --ink-secondary: #565b69;
    --ink-tertiary: #646a79;
    --surface: rgba(255, 255, 255, 0.58);
    --surface-solid: #f7f8fb;
    --stroke: rgba(20, 22, 27, 0.1);
    --stroke-strong: rgba(20, 22, 27, 0.16);
    --track: rgba(20, 22, 27, 0.07);
    --inverse-surface: #16181e;
    --inverse-ink: #f5f6f9;
    --dot-dim: rgba(20, 22, 27, 0.19);

    --ramp-top: #b8a1e3;
    --ramp-mid: #fd9371;
    --ramp-bottom: #f5c06a;
    --accent: #c8552e;
    --positive: #3f8f6b;

    --sunset: linear-gradient(180deg, var(--ramp-top) 0%, var(--ramp-mid) 52%, var(--ramp-bottom) 100%);
    --sunset-across: linear-gradient(96deg, var(--ramp-top) 0%, var(--ramp-mid) 54%, var(--ramp-bottom) 100%);
    /* Ramp restated at text-safe luminance: the amber end is unreadable as type. */
    --sunset-text: linear-gradient(96deg, #7a5fbe 0%, #c8552e 100%);

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 34px;

    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;

    --shell: 1140px;
    --measure: 62ch;
    --section-y: clamp(80px, 10vw, 152px);
    --edge: clamp(20px, 6vw, 104px);
    --panel-w: clamp(300px, 34vw, 500px);
    --bezel: #101218;

    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #0d0f14;
        --ground-deep: #090a0e;
        --ink: #f2f3f7;
        --ink-secondary: #a2a8b8;
        --ink-tertiary: #7b8294;
        --surface: rgba(255, 255, 255, 0.045);
        --surface-solid: #15171d;
        --stroke: rgba(255, 255, 255, 0.1);
        --stroke-strong: rgba(255, 255, 255, 0.17);
        --track: rgba(255, 255, 255, 0.08);
        --inverse-surface: #f2f3f7;
        --inverse-ink: #0d0f14;
        --dot-dim: rgba(255, 255, 255, 0.22);
        --accent: #ff9a75;
        --sunset-text: linear-gradient(96deg, #c9b2f0 0%, #ff9a75 100%);
        --positive: #6cc39b;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

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

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Faint full-screen grain: the Dusk material. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0.055;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
    body::after {
        opacity: 0.085;
    }
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

::selection {
    background: rgba(253, 147, 113, 0.28);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: var(--s-3) var(--s-5);
    background: var(--inverse-surface);
    color: var(--inverse-ink);
    border-radius: 0 0 var(--r-md) 0;
    font-weight: 600;
}

.skip:focus {
    left: 0;
}

/* ---------- Type scale ---------- */

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.028em;
    line-height: 1.08;
    text-wrap: balance;
}

.display {
    font-size: clamp(3.5rem, 7.6vw, 7.75rem);
    font-weight: 300;
    letter-spacing: -0.042em;
    line-height: 0.96;
}

.h2 {
    font-size: clamp(2.125rem, 3.8vw, 3.5rem);
    font-weight: 340;
    letter-spacing: -0.034em;
    line-height: 1.03;
}

.h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    letter-spacing: -0.024em;
    line-height: 1.2;
}

.h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.016em;
    line-height: 1.35;
}

/* The one structural device: wide-tracked micro labels. */
.eyebrow {
    display: block;
    margin: 0 0 var(--s-4);
    font-size: 0.6875rem;
    font-weight: 620;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-tertiary);
}

.eyebrow--ramp {
    background: var(--sunset-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    font-size: clamp(1.125rem, 1.7vw, 1.375rem);
    line-height: 1.5;
    color: var(--ink-secondary);
    letter-spacing: -0.016em;
    max-width: var(--measure);
    text-wrap: pretty;
}

p {
    margin: 0 0 var(--s-4);
    text-wrap: pretty;
}

p:last-child {
    margin-bottom: 0;
}

.muted {
    color: var(--ink-secondary);
}

.fine {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--ink-tertiary);
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

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

/* The whole site keeps one left edge; wide screens breathe on the right. */
.shell {
    width: 100%;
    max-width: calc(var(--shell) + 2 * var(--edge));
    margin-inline: 0;
    padding-inline: var(--edge);
}

.section {
    padding-block: var(--section-y);
}

/* The landing page is a single editorial column beside the fixed panel. */
.editorial {
    padding-inline: var(--edge);
    container-type: inline-size;
    container-name: editorial;
}

@media (min-width: 1080px) {
    .editorial {
        padding-right: calc(var(--panel-w) + 12px + clamp(40px, 4vw, 88px));
    }

    body:has(.panel) .masthead .shell {
        padding-right: calc(var(--panel-w) + 12px + 28px);
    }
}

/* The masthead is sticky, so anchored targets need to clear it. */
:target,
section[id] {
    scroll-margin-top: 92px;
}

.section--tight {
    padding-block: clamp(56px, 6vw, 88px);
}

.rule {
    height: 1px;
    border: 0;
    margin: 0;
    background: var(--stroke);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.18s ease, background-color 0.18s ease;
}

.btn:active {
    transform: scale(0.975);
}

.btn--primary {
    background: var(--inverse-surface);
    color: var(--inverse-ink);
}

.btn--primary:hover {
    opacity: 0.86;
}

.btn--ghost {
    border-color: var(--stroke-strong);
    background: var(--surface);
    color: var(--ink);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.btn--ghost:hover {
    border-color: var(--ink-tertiary);
}

/* Quiet text links: the editorial answer to a second button. */
.quiet-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--stroke-strong);
    text-underline-offset: 5px;
    transition: text-decoration-color 0.15s ease;
}

.quiet-link:hover {
    text-decoration-color: var(--accent);
}

/* App Store badge, drawn inline so the page loads no external assets. */
.appstore {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 11px 20px 11px 18px;
    border-radius: 14px;
    background: var(--inverse-surface);
    color: var(--inverse-ink);
    text-decoration: none;
    transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.18s ease;
}

.appstore:hover {
    opacity: 0.87;
}

.appstore:active {
    transform: scale(0.98);
}

.appstore svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    flex: none;
}

.appstore span {
    display: block;
    line-height: 1.15;
}

.appstore .small {
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    opacity: 0.78;
}

.appstore .big {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ---------- Header ---------- */

.masthead {
    position: sticky;
    top: 0;
    z-index: 80;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.masthead[data-stuck="true"] {
    background: color-mix(in srgb, var(--ground) 82%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom-color: var(--stroke);
}

.masthead .shell {
    display: flex;
    align-items: center;
    gap: var(--s-5);
    height: 72px;
    max-width: none;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 1.0625rem;
    font-weight: 640;
    letter-spacing: -0.026em;
    text-decoration: none;
    margin-right: auto;
}

.wordmark svg {
    width: 22px;
    height: 22px;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--s-5);
}

.nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav a:hover {
    color: var(--ink);
}

@media (max-width: 720px) {
    .nav {
        display: none;
    }
}

/* ---------- Panel: the fixed dusk pane that carries all the large color ---------- */

.panel {
    position: relative;
    margin: 12px 12px 0;
    height: clamp(300px, 58vw, 460px);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--ramp-top) 24%, var(--ground-deep)) 0%,
        color-mix(in srgb, var(--ramp-mid) 26%, var(--ground-deep)) 55%,
        color-mix(in srgb, var(--ramp-bottom) 32%, var(--ground-deep)) 100%
    );
}

.panel-bloom {
    position: absolute;
    inset: auto -20% -38%;
    aspect-ratio: 1.6;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 78%, rgba(253, 147, 113, 0.5), rgba(245, 192, 106, 0.3) 45%, transparent 72%);
    filter: blur(30px);
}

@media (prefers-color-scheme: dark) {
    .panel-bloom {
        background: radial-gradient(ellipse at 50% 78%, rgba(253, 147, 113, 0.22), rgba(245, 192, 106, 0.12) 45%, transparent 72%);
    }
}

.panel .orb {
    position: relative;
    width: min(58%, 340px);
}

@media (min-width: 1080px) {
    .panel {
        position: fixed;
        top: 12px;
        right: 12px;
        bottom: 12px;
        margin: 0;
        height: auto;
        width: var(--panel-w);
        z-index: 85;
    }
}

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

.hero {
    padding-block: clamp(44px, 6vw, 96px) clamp(72px, 9vw, 140px);
}

@media (min-width: 1080px) {
    .hero {
        min-height: calc(100svh - 240px);
        display: grid;
        align-content: center;
    }
}

.hero .display {
    margin-block: var(--s-5) var(--s-6);
}

.hero .lede {
    max-width: 42ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4);
    margin-top: var(--s-6);
}

.hero-note {
    margin-top: var(--s-4);
    font-size: 0.875rem;
    color: var(--ink-tertiary);
}

.orb {
    width: min(430px, 78vw);
    height: auto;
    overflow: visible;
    animation: breathe 4.8s ease-in-out infinite alternate;
}

.orb-dim {
    fill: var(--dot-dim);
}

.orb-level {
    transform: translateY(224px);
    animation: fill 2.2s cubic-bezier(0.32, 0.72, 0, 1) 0.25s forwards;
}

@keyframes breathe {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.02);
    }
}

@keyframes fill {
    to {
        transform: translateY(84px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .orb {
        animation: none;
    }

    .orb-level {
        animation: none;
        transform: translateY(84px);
    }
}

/* ---------- Steps: a real sequence, so it is numbered ---------- */

.steps-list {
    border-top: 1px solid var(--stroke);
}

.steps-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    column-gap: var(--s-5);
    row-gap: var(--s-2);
    align-items: baseline;
    padding-block: clamp(28px, 4vw, 48px);
    border-bottom: 1px solid var(--stroke);
}

.steps-row .h3 {
    font-size: clamp(1.25rem, 1.8vw, 1.5rem);
    font-weight: 500;
    letter-spacing: -0.022em;
}

.steps-num {
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    color: var(--ink-tertiary);
}

.steps-row p {
    grid-column: 2;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--ink-secondary);
    max-width: 52ch;
}

@container editorial (min-width: 660px) {
    .steps-row {
        grid-template-columns: 4.5rem 11rem minmax(0, 1fr);
    }

    .steps-row p {
        grid-column: auto;
    }
}

/* ---------- Feature chapters ---------- */

.chapter {
    display: grid;
    gap: clamp(40px, 7vw, 64px);
    padding-block: clamp(80px, 10vw, 160px);
}

.chapter + .chapter {
    border-top: 1px solid var(--stroke);
}

.chapter-copy p {
    font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
    line-height: 1.55;
    color: var(--ink-secondary);
    max-width: 44ch;
}

.chapter-copy p + p {
    margin-top: var(--s-4);
}

.chapter .h2 {
    margin-bottom: var(--s-5);
    max-width: 15ch;
}

@container editorial (min-width: 660px) {
    .chapter {
        grid-template-columns: minmax(0, 1fr) clamp(270px, 38cqw, 380px);
        align-items: center;
        column-gap: clamp(48px, 9cqw, 120px);
    }
}

/* ---------- Device: real screenshots inside the real bezel ---------- */
/* Geometry from bettervoice-ios/marketing/artboards: bezel box 1470x3000, the
   screen capture sits at left 5.102% / top 2.2% / width 89.796%, clipped
   by the screen-mask alpha. */

.device {
    position: relative;
    margin: 0;
    width: 100%;
    max-width: 380px;
    justify-self: start;
}

.device-frame {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
}

.device-screen {
    position: absolute;
    inset: 0;
    z-index: 1;
    -webkit-mask-image: url("/img/iphone-screen-mask.webp");
    mask-image: url("/img/iphone-screen-mask.webp");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.device-screen img {
    position: absolute;
    left: 5.102%;
    top: 2.2%;
    width: 89.796%;
    height: auto;
    max-width: none;
}

/* ---------- Privacy statement ---------- */

.privacy-statement {
    border-top: 1px solid var(--stroke);
    padding-block: var(--section-y);
}

.pull {
    margin: 0 0 var(--s-5);
    font-size: clamp(2.5rem, 5.2vw, 4.5rem);
    font-weight: 300;
    letter-spacing: -0.038em;
    line-height: 1;
    max-width: 14ch;
    text-wrap: balance;
}

.privacy-statement .lede {
    max-width: 40ch;
}

.privacy-points {
    margin-top: var(--s-7);
    max-width: 62ch;
}

.privacy-points p {
    margin: 0;
    padding-block: var(--s-5);
    border-top: 1px solid var(--stroke);
    color: var(--ink-secondary);
}

.privacy-points p:last-child {
    border-bottom: 1px solid var(--stroke);
}

.privacy-points strong {
    color: var(--ink);
    font-weight: 600;
}

.privacy-more {
    margin-top: var(--s-6);
}

/* ---------- Closing CTA ---------- */

.closer {
    border-top: 1px solid var(--stroke);
}

.closer .h2 {
    max-width: 14ch;
}

.closer .lede {
    max-width: 34ch;
}

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

.footer {
    border-top: 1px solid var(--stroke);
    background: var(--ground-deep);
    padding-block: var(--s-8) var(--s-7);
}

@media (min-width: 1080px) {
    body:has(.panel) .footer .shell {
        padding-right: calc(var(--panel-w) + 12px + 28px);
    }
}

.footer-line {
    margin-top: var(--s-3);
    max-width: 34ch;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
    margin-top: var(--s-6);
}

.footer a {
    font-size: 0.9375rem;
    color: var(--ink-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--ink);
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    margin-top: var(--s-8);
    padding-top: var(--s-5);
    border-top: 1px solid var(--stroke);
    font-size: 0.8125rem;
    color: var(--ink-tertiary);
}

/* ---------- Document pages (terms, privacy, support) ---------- */

.doc-head {
    padding-block: clamp(48px, 6vw, 84px) var(--s-7);
    border-bottom: 1px solid var(--stroke);
}

.doc-head h1 {
    font-size: clamp(2.25rem, 4.6vw, 3.25rem);
    letter-spacing: -0.036em;
    margin-bottom: var(--s-4);
}

.doc {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    padding-block: var(--s-8) var(--s-9);
    align-items: start;
}

.toc {
    position: sticky;
    top: 88px;
}

.toc ol {
    list-style: none;
    margin: var(--s-3) 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
    counter-reset: toc;
}

.toc a {
    font-size: 0.875rem;
    color: var(--ink-secondary);
    text-decoration: none;
    display: block;
}

.toc a:hover {
    color: var(--ink);
}

.prose {
    max-width: 70ch;
}

.prose section + section {
    margin-top: var(--s-8);
}

.prose h2 {
    font-size: 1.375rem;
    letter-spacing: -0.026em;
    margin-bottom: var(--s-4);
    scroll-margin-top: 88px;
}

.prose h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    margin: var(--s-6) 0 var(--s-3);
}

.prose p,
.prose li {
    color: var(--ink-secondary);
}

.prose ul {
    margin: 0 0 var(--s-4);
    padding-left: 1.15em;
    display: grid;
    gap: var(--s-2);
}

.prose li::marker {
    color: var(--ink-tertiary);
}

.prose a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--stroke-strong);
    text-underline-offset: 3px;
}

.prose a:hover {
    text-decoration-color: var(--accent);
}

.prose strong {
    color: var(--ink);
    font-weight: 600;
}

.callout {
    padding: var(--s-5);
    border: 1px solid var(--stroke);
    border-radius: var(--r-md);
    background: var(--surface);
    margin-bottom: var(--s-5);
}

.callout p {
    margin: 0;
    font-size: 0.9375rem;
}

@media (max-width: 860px) {
    .doc {
        grid-template-columns: 1fr;
        padding-block: var(--s-7) var(--s-8);
    }

    .toc {
        position: static;
    }
}

/* ---------- Support ---------- */

.contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    padding: clamp(24px, 3.4vw, 36px);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    background: var(--surface);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.contact-mail {
    font-size: clamp(1.25rem, 2.6vw, 1.75rem);
    font-weight: 620;
    letter-spacing: -0.03em;
    text-decoration: none;
    background: var(--sunset-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.faq {
    display: grid;
    gap: 0;
    margin-top: var(--s-7);
    border-top: 1px solid var(--stroke);
}

.faq details {
    border-bottom: 1px solid var(--stroke);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-5) 0;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    flex: none;
    width: 11px;
    height: 11px;
    border-right: 1.6px solid var(--ink-tertiary);
    border-bottom: 1.6px solid var(--ink-tertiary);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.faq details[open] summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
}

.faq .answer {
    padding-bottom: var(--s-5);
    max-width: 66ch;
}

.faq .answer p {
    color: var(--ink-secondary);
    font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Redirect page ---------- */

.stage {
    min-height: 100svh;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    gap: var(--s-5);
    padding: var(--s-7) var(--s-5);
}

.stage .orb {
    width: min(190px, 46vw);
}

.stage h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.032em;
}
