/* ReplyAI site: "Watch Wall".
   Tokens from projects/replyai/DESIGN.md (WallTokens.kt): ground, surface, surface2, line, outline,
   text/text2/text3, coral (fill only, ink #121317), focusEdge, ok. Tone tile colours are the app's
   poster duotones (ui/theme/PosterTile.kt posterColorsForHue, hues from ui/Labels.kt Tone.hue()).
   Type: Onest 400/600/800 (SIL OFL), self-hosted subsets. Dark leads; light is first-class. */

@font-face {
    font-family: "Onest";
    src: url("/replyai/fonts/onest-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Onest";
    src: url("/replyai/fonts/onest-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Onest";
    src: url("/replyai/fonts/onest-800.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --ground: #F5F5F7;
    --surface: #ECEDF1;
    --surface2: #FFFFFF;
    --line: #DADBE0;
    --outline: #767A84;
    --text: #17181C;
    --text2: #454852;
    --text3: #5D616B;
    --coral: #FF6B4A;
    --on-coral: #121317;
    --focus: #D9482A;
    --ok: #17703F;
    --tonal: #E4E5EA;
    --shadow: 0 6px 18px rgba(23, 24, 28, 0.10);
    /* The wall band is dark in both schemes (dark leads). */
    --wall: #121317;
    --wall-2: #23252C;
    --wall-line: #30323A;
    --wall-text: #F2F2F4;
    --wall-text2: #B9BCC5;
    --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wrap: 70rem;
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #121317;
        --surface: #1A1C21;
        --surface2: #23252C;
        --line: #30323A;
        --outline: #6E7380;
        --text: #F2F2F4;
        --text2: #B9BCC5;
        --text3: #9196A1;
        --focus: #FF6B4A;
        --ok: #62D08F;
        --tonal: #2C2F38;
        --shadow: none;
        --wall: #0B0C0F;
        --wall-2: #1A1C21;
    }
}

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

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

body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.6em;
    text-wrap: balance;
    hyphens: none;
}

h1 {
    font-size: clamp(2.1rem, 6vw, 3.5rem);
    letter-spacing: -0.025em;
    line-height: 1.08;
}

h2 {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
}

h3 {
    font-size: 1.15rem;
}

p {
    margin: 0 0 1em;
}

code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: var(--tonal);
    border-radius: 4px;
    padding: 0.05em 0.3em;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    background: var(--coral);
    color: var(--on-coral);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-s);
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
    outline-color: var(--text);
}

/* Header */
.topbar {
    background: var(--ground);
    border-bottom: 1px solid var(--line);
}

.topbar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.brand img {
    border-radius: 10px;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.75rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-s);
}

.site-nav a:hover {
    background: var(--tonal);
}

.site-nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35em;
}

/* Wall band: hero and closing call to action, dark in both schemes */
.wall {
    background: var(--wall);
    color: var(--wall-text);
}

.wall :focus-visible {
    outline-color: #FF6B4A;
}

.hero {
    padding: 3rem 0 3.5rem;
}

.hero-grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.hero h1 {
    max-width: 14ch;
}

.hero .sub {
    font-size: 1.2rem;
    color: var(--wall-text2);
    max-width: 34rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 1.5rem;
}

.cta-row p {
    margin: 0;
    color: var(--wall-text2);
    font-size: 0.97rem;
    max-width: 26rem;
}

.play-badge {
    display: inline-block;
    border-radius: var(--radius-s);
    flex: none;
}

.play-badge img {
    width: 188px;
    height: 56px;
}

.hero-shot {
    justify-self: center;
    width: min(100%, 22rem);
}

/* Framed store shots: 1 px border so every frame reads against either ground. */
.shot img,
.hero-shot img {
    border: 1px solid var(--outline);
    border-radius: var(--radius-l);
}

.wall .hero-shot img {
    border-color: #6E7380;
}

/* Sections */
.section {
    padding: 3.5rem 0;
    border-top: 1px solid var(--line);
}

.section.lead {
    border-top: 0;
    padding-bottom: 1rem;
}

.answer {
    font-size: 1.15rem;
    max-width: 44rem;
}

.lead .answer {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.5;
    max-width: 50rem;
}

.detail {
    color: var(--text2);
    max-width: 44rem;
}

.split {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

.shot {
    margin: 0;
}

.shot-narrow {
    width: min(100%, 18rem);
    justify-self: center;
}

.shot figcaption {
    color: var(--text2);
    font-size: 0.92rem;
    margin-top: 0.6rem;
}

/* The reply wall: redrawn tiles from the Welcome screen example */
.wall-demo {
    margin: 0;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    min-width: 0;
}

.incoming {
    display: inline-block;
    background: var(--tonal);
    border-radius: var(--radius-m) var(--radius-m) var(--radius-m) 4px;
    padding: 0.6rem 0.9rem;
    margin: 0 0 1rem;
}

.incoming small {
    display: block;
    color: var(--text2);
    font-size: 0.8rem;
    font-weight: 600;
}

.rail {
    display: grid;
    grid-template-columns: 1.75fr 1fr 1fr;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.tile {
    position: relative;
    overflow: hidden;
    min-width: 0;
    color: #FFFFFF;
    border-radius: var(--radius-m);
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    background: linear-gradient(150deg, #207973, #102E3C);
}

.tile.focused {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.tile .use {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.9;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.chips li {
    border: 1px solid var(--outline);
    border-radius: var(--radius-s);
    padding: 0.2rem 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.chips li.on {
    background: var(--tonal);
}

.chips li.on::before {
    content: "\2713\00a0";
}

.wall-demo figcaption {
    color: var(--text2);
    font-size: 0.88rem;
}

.tone-chill { background: linear-gradient(150deg, #207973, #102E3C); }
.tone-funny { background: linear-gradient(150deg, #A1622B, #514915); }
.tone-polite { background: linear-gradient(150deg, #2D63A9, #161955); }
.tone-flirty { background: linear-gradient(150deg, #A92D84, #551629); }
.tone-pro { background: linear-gradient(150deg, #2D31A9, #2D1655); }

/* Tone list: poster swatches carrying the word */
.tones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
}

.tones li {
    color: #FFFFFF;
    font-weight: 600;
    border-radius: var(--radius-s);
    padding: 0.35rem 0.85rem;
}

/* Send modes and fact lists */
.modes,
.facts {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0 0;
    max-width: 44rem;
}

.modes > div,
.facts > div {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 0.9rem 1rem;
}

.modes dt,
.facts dt {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.modes dd,
.facts dd {
    margin: 0.2rem 0 0;
    color: var(--text2);
}

/* Keyword examples: words carry the state */
.examples {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    max-width: 44rem;
}

.examples li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
    align-items: center;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 0.7rem 1rem;
}

.examples q {
    font-style: normal;
    min-width: 0;
}

.verdict {
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
}

.verdict.pauses {
    color: var(--ok);
}

.verdict.misses {
    color: var(--text);
    text-decoration: underline wavy var(--focus) 1px;
    text-underline-offset: 0.25em;
}

/* "What it doesn't do" and limit lists */
.nots,
.limits {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
    max-width: 48rem;
}

.nots li,
.limits li {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.nots svg,
.limits svg {
    width: 1.4rem;
    height: 1.4rem;
    margin-top: 0.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Gallery */
.gallery {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1.25rem;
}

/* Question links */
.qlinks {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    max-width: 44rem;
}

.qlinks a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 48px;
    padding: 0.6rem 1rem;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    font-weight: 600;
    text-decoration: none;
}

.qlinks,
.examples,
.nots,
.limits {
    grid-template-columns: minmax(0, 1fr);
}

.qlinks span,
.nots span,
.limits span,
.examples q {
    min-width: 0;
    overflow-wrap: anywhere;
}

.qlinks a:hover {
    border-color: var(--outline);
}

.qlinks svg {
    flex: none;
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Closing band */
.wall-end {
    padding: 3.5rem 0;
    text-align: center;
}

.wall-end h2 {
    margin-bottom: 1.25rem;
}

.wall-end .play-badge {
    margin: 0 auto;
}

/* Inner pages */
.page-head {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--line);
}

.lede {
    font-size: 1.15rem;
    color: var(--text2);
    max-width: 44rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 0.92rem;
    color: var(--text2);
}

.crumbs li + li::before {
    content: "\203A";
    padding: 0 0.5rem;
}

.crumbs a {
    display: inline-block;
    padding: 0.7rem 0;
}

.crumbs li[aria-current] {
    padding: 0.7rem 0;
}

.toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.toc a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.25rem 0.85rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-s);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.toc a:hover {
    background: var(--tonal);
}

.steps > section,
.ledger > section {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--line);
}

.steps > section:last-child,
.ledger > section:last-child {
    border-bottom: 0;
}

.steps h2,
.ledger h2 {
    scroll-margin-top: 1rem;
}

.ledger h2 {
    font-size: clamp(1.25rem, 2.6vw, 1.6rem);
}

.page-end {
    padding: 2.5rem 0 3.5rem;
    border-top: 1px solid var(--line);
}

.page-end .play-badge {
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background: var(--surface);
    color: var(--text);
    border-top: 1px solid var(--line);
    padding: 2.5rem 0 3rem;
    font-size: 0.95rem;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-top p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    overflow-wrap: anywhere;
}

.fine {
    color: var(--text2);
    font-size: 0.88rem;
}

.fine p {
    margin: 0 0 0.4rem;
    max-width: 52rem;
}

@media (min-width: 40rem) {
    .modes,
    .facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 60rem) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    }
    .split {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }
    .split.flip > :first-child {
        order: 2;
    }
}

@media (max-width: 30rem) {
    .rail {
        grid-template-columns: 1fr;
    }
    .examples li {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
