/* The dashboard's look (grid/dashboard assets/styles/app.css), as grid/share
   carries it: Inter and Archivo, the Atelier tokens, the aurora wallpaper, the
   thick-glass sheet, ink buttons. Only what whisper uses is copied. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-Gz7AlRl.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext-1Br77OV.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url("../fonts/archivo-var-n-tQTUA.woff2") format("woff2");
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/geist-mono-var-bVnjbCM.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    --font-display: "Archivo", "Inter", ui-sans-serif, system-ui, sans-serif;
    --font-label: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

    --foreground: #0a0a0b;
    --mono: #0a0a0b;
    --muted-foreground: #5f5f67;
    --primary: #7c5cff;
    --primary-ink: #6d4df2;
    --ring: #7c5cff;
    --success: #34c759;
    --warning: #ff9500;
    --border: #e9e9ec;
    --input: #d4d4d9;
    --secondary: #f4f4f5;
    --accent: rgb(10 10 11 / 0.045);
    --field: #ffffff;
    --mat-edge: #e9e9ec;
    --mat-sheen: linear-gradient(180deg, rgb(255 255 255 / 0.45), rgb(255 255 255 / 0) 36%);
    --mat-hl: inset 0 1px 0 rgb(255 255 255 / 0.9);
    --thick: rgb(255 255 255 / 0.86);
    --thick-filter: blur(24px) saturate(150%);
    --sheet-shadow: 0 1px 1px rgb(10 10 11 / 0.03), 0 40px 80px -40px rgb(10 10 11 / 0.25);

    --wall-base: #ffffff;
    --glow-primary: rgb(147 197 253 / 0.2);
    --glow-violet: rgb(165 243 252 / 0.32);
    --glow-sky: rgb(196 181 253 / 0.26);

    --radius-sheet: 1.5rem;
    --radius-field: 0.5rem;
    --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
    --motion-fast: 0.18s;
    --motion: 0.32s;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --foreground: #ededf0;
        --mono: #fafafa;
        --muted-foreground: #9a9aa3;
        --primary: #8b6dff;
        --primary-ink: #b6a6ff;
        --ring: #8b6dff;
        --success: #30d158;
        --warning: #ff9f0a;
        --border: rgb(255 255 255 / 0.08);
        --input: rgb(255 255 255 / 0.14);
        --secondary: rgb(255 255 255 / 0.07);
        --accent: rgb(255 255 255 / 0.06);
        --field: rgb(255 255 255 / 0.03);
        --mat-edge: rgb(255 255 255 / 0.08);
        --mat-sheen: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0) 40%);
        --mat-hl: inset 0 1px 0 rgb(255 255 255 / 0.08);
        --thick: rgb(22 22 26 / 0.88);
        --sheet-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.85);
        --wall-base: #0a0a0b;
        --glow-primary: rgb(59 130 246 / 0.09);
        --glow-violet: rgb(34 211 238 / 0.08);
        --glow-sky: rgb(139 92 246 / 0.13);
    }
}

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

[hidden] {
    display: none !important;
}

html {
    background-color: var(--wall-base);
    -webkit-tap-highlight-color: transparent;
}

/* The aurora on its own fixed layer, so the glass always has light behind it. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(55rem 55rem at 12% -8%, var(--glow-primary), transparent 60%),
        radial-gradient(48rem 48rem at 106% 4%, var(--glow-violet), transparent 55%),
        radial-gradient(42rem 42rem at 50% 116%, var(--glow-sky), transparent 62%);
}

body {
    margin: 0;
    min-height: 100dvh;
    font: 15px/1.5 var(--font-sans);
    font-feature-settings: "cv11", "ss01";
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--mono);
    color: var(--wall-base);
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

a {
    color: inherit;
}

code {
    font: 0.9em var(--font-label);
}

.label {
    margin: 0;
    color: var(--muted-foreground);
    font: 450 0.6875rem/1 var(--font-label);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* --- The app icon and the word */

.mark {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    place-items: center;
    border-radius: 24%;
    color: #ffffff;
    background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 45%, #3b82f6 100%);
    box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.55), inset 0 -2px 6px rgb(0 0 0 / 0.12), 0 1px 2px rgb(10 10 11 / 0.1), 0 8px 18px -8px rgb(91 71 230 / 0.45);
}

.mark svg {
    width: 2.25rem;
    height: 2.25rem;
}

.mark-sm {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 28%;
}

.mark-sm svg {
    width: 1.25rem;
    height: 1.25rem;
}

.wordmark {
    margin: 1.125rem 0 0;
    font: 800 34px/1.1 var(--font-display);
    font-stretch: 125%;
    letter-spacing: -0.045em;
    color: var(--mono);
}

.subtitle {
    margin: 0.375rem 0 1.75rem;
    color: var(--muted-foreground);
}

/* --- Buttons: ink, paper with a hairline, or nothing */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.25rem;
    padding: 0 1rem;
    border: 0;
    border-radius: var(--radius-field);
    font: 600 0.875rem/1 var(--font-sans);
    letter-spacing: -0.01em;
    color: inherit;
    background: none;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    outline: none;
    transition: transform var(--motion-fast) var(--ease-ios), background-color 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

.btn:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 45%, transparent);
}

.btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-lg {
    width: 100%;
    height: 2.875rem;
    font-size: 0.9375rem;
}

.btn-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--wall-base);
    background: var(--mono);
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.22) 50%, transparent 70%);
    transform: translateX(-110%);
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover::after {
    transform: translateX(110%);
}

.btn-secondary {
    background: var(--field);
    box-shadow: inset 0 0 0 1px var(--input);
}

@media (hover: hover) {
    .btn-primary:hover {
        background: color-mix(in oklab, var(--mono) 88%, var(--wall-base));
    }

    .btn-secondary:hover {
        box-shadow: inset 0 0 0 1px var(--mono);
    }

    .btn-ghost:hover {
        background: var(--accent);
    }
}

/* --- Home: the lock-screen sheet */

.sheet {
    display: flex;
    width: 100%;
    max-width: 28rem;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    padding: 2.25rem 1.75rem 1.75rem;
    border: 1px solid var(--mat-edge);
    border-radius: var(--radius-sheet);
    text-align: center;
    background-color: var(--thick);
    background-image: var(--mat-sheen);
    -webkit-backdrop-filter: var(--thick-filter);
    backdrop-filter: var(--thick-filter);
    box-shadow: var(--sheet-shadow), var(--mat-hl);
    animation: pop 0.42s var(--ease-spring) backwards;
}

@keyframes pop {
    from { opacity: 0; transform: scale(0.96) translateY(6px); }
}

body:has(.home) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.5rem;
}

.home h1 + .subtitle {
    max-width: 20rem;
}

.steps {
    display: grid;
    gap: 0.875rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    text-align: left;
}

.steps li {
    position: relative;
    padding-left: 2.25rem;
    color: var(--muted-foreground);
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    top: 0.0625rem;
    left: 0;
    display: grid;
    width: 1.5rem;
    height: 1.5rem;
    place-items: center;
    border-radius: 50%;
    color: var(--foreground);
    font: 500 0.75rem/1 var(--font-label);
    box-shadow: inset 0 0 0 1px var(--input);
}

.steps strong {
    display: block;
    color: var(--foreground);
    font-weight: 600;
}

.notes {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: left;
}

.notes p {
    margin: 0 0 0.625rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.foot {
    color: var(--muted-foreground);
    font: 450 0.6875rem/1 var(--font-label);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.foot a {
    text-decoration: none;
}

/* --- The conversation: almost nothing on screen */

.room {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    cursor: text;
}

.bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: max(0.875rem, env(safe-area-inset-top)) 1rem 0.875rem;
}

.brand {
    display: flex;
    margin-right: auto;
    cursor: pointer;
}

.presence {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.5rem 0 0;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
}

.presence .dot {
    position: relative;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--warning);
}

.presence[data-state="here"] .dot {
    background: var(--success);
}

/* The dashboard's live ping, around the dot while someone is there. */
.presence[data-state="here"] .dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: live-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes live-ping {
    75%, 100% { opacity: 0; transform: scale(2.4); }
}

.invite {
    display: grid;
    gap: 0.625rem;
    width: min(28rem, calc(100% - 2rem));
    margin: 1.5rem auto 0;
    padding: 1.125rem;
    border: 1px solid var(--mat-edge);
    border-radius: var(--radius-sheet);
    background-color: var(--thick);
    background-image: var(--mat-sheen);
    -webkit-backdrop-filter: var(--thick-filter);
    backdrop-filter: var(--thick-filter);
    box-shadow: var(--sheet-shadow), var(--mat-hl);
    cursor: auto;
    animation: pop 0.42s var(--ease-spring) backwards;
}

.invite .link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.25rem 0.75rem;
    border-radius: var(--radius-field);
    box-shadow: inset 0 0 0 1px var(--input);
    background: var(--field);
}

.invite code {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite .note {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
}

.stage {
    position: relative;
    flex: 1;
    display: grid;
    align-content: center;
    min-height: 0;
    overflow: hidden;
    padding: 1rem 1.5rem;
}

.stream,
.replayed {
    width: 100%;
    max-width: 38rem;
    margin: 0 auto;
    font: 500 clamp(1.375rem, 4.2vw, 2rem)/1.4 var(--font-sans);
    letter-spacing: -0.015em;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.stream span {
    transition: opacity 0.6s ease, filter 0.6s ease;
}

.stream span.gone {
    opacity: 0;
    filter: blur(6px);
}

/* Not visible and focused: blurred, and nothing is erased (the controller). */
.stream {
    transition: filter 0.25s ease;
}

.is-veiled .stream {
    filter: blur(14px);
}

.veil-hint {
    position: absolute;
    inset: auto 0 1rem;
    margin: 0;
    color: var(--muted-foreground);
    text-align: center;
    font-size: 0.8125rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.veil-hint::after {
    content: "Click to read";
}

@media (pointer: coarse) {
    .veil-hint::after {
        content: "Tap to read";
    }
}

.is-veiled .stream:not(:empty) ~ .veil-hint {
    opacity: 1;
}

.replayed {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    padding: 1rem 1.5rem;
    max-width: none;
    background: var(--wall-base);
    animation: pop 0.3s var(--ease-ios);
}

.composer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem max(0.875rem, env(safe-area-inset-bottom));
}

.hint {
    flex: 1;
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
}

.peeked {
    position: absolute;
    right: 1rem;
    bottom: calc(100% + 0.25rem);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-field);
    color: var(--wall-base);
    background: var(--mono);
    font: 500 1rem/1.3 var(--font-label);
}

/* Something went out: five bars ripple once. No text, no length. */
.wave {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 1.25rem;
}

.wave i {
    width: 3px;
    height: 4px;
    border-radius: 2px;
    background: var(--muted-foreground);
    opacity: 0.35;
}

.wave.is-on i {
    animation: ripple 0.7s var(--ease-ios);
}

.wave.is-on i:nth-child(2) { animation-delay: 0.06s; }
.wave.is-on i:nth-child(3) { animation-delay: 0.12s; }
.wave.is-on i:nth-child(4) { animation-delay: 0.18s; }
.wave.is-on i:nth-child(5) { animation-delay: 0.24s; }

@keyframes ripple {
    40% { height: 16px; opacity: 1; background: var(--primary); }
}

/* The field that receives the keys: focusable, never seen. */
.capture {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2.5rem;
    border: 0;
    padding: 0;
    resize: none;
    opacity: 0;
    color: transparent;
    caret-color: transparent;
    background: transparent;
    font-size: 16px; /* below 16px iOS zooms in on focus */
    pointer-events: none;
    z-index: -1;
}

.capture::selection {
    background: transparent;
}

.ended {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--wall-base);
    text-align: center;
    cursor: auto;
}

.ended p {
    max-width: 22rem;
    margin: 0.5rem 0;
}

.ended .btn-lg {
    max-width: 18rem;
}

@media (max-width: 30rem) {
    .presence span:last-child {
        font-size: 0.75rem;
    }

    .bar .btn {
        padding: 0 0.625rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sheet, .invite, .replayed { animation: none; }
    .presence[data-state="here"] .dot::after { animation: none; }
}
