/* Chwma — the website (chwma.com): its one page. The app's own "Night Line" system: one amber
   accent, Schibsted Grotesk, and the logo (a ring, and a dot arriving in its opening) as the one big gesture. */
:root {
    color-scheme: dark;
    --ground: #16171a;
    --surface: #1e1f23;
    --surface-2: #28292e;
    --line: #2e3035;
    --ink: #ffffff;
    --ink-soft: #b4b4b4;
    --accent: #ffb224;
    --on-accent: #16171a;
    --accent-ink: #ffb224;
    --ring: #ffffff;
    --night: #0e0f11;
    --night-line: #26272b;
    --on-night: #ffffff;
    --on-night-soft: #b4b4b4;
    --phone: #0a0a0b;
    --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    /* headlines only: Unbounded, wide and round, so they're set a size smaller; running text stays in
       Schibsted, like the app */
    --font-display: 'Unbounded', 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
    /* five text sizes do all the work: small, body, lead, heading, display */
    --t-small: 15px;
    --t-body: 17px;
    --t-lead: 22px;
    --t-h2: clamp(26px, 3.4vw, 40px);
    --t-display: clamp(34px, 4.2vw, 58px);
    --radius: 20px;
    --radius-pill: 999px;
    --measure: 62ch;
    --wrap: 1120px;
    --gutter: 24px;
}

:root[data-theme='light'] {
    color-scheme: light;
    --ground: #f3f3f3;
    --surface: #fdfcfa;
    --surface-2: #e9e9e9;
    --line: #dedede;
    --ink: #111111;
    --ink-soft: #555555;
    --accent-ink: #9a5b00;
    --ring: #111111;
}

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

html,
body {
    overflow-x: clip;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--t-body);
    line-height: 1.6;
    background: var(--ground);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-wrap: balance;
    overflow-wrap: break-word;
    min-width: 0;
}

h1 {
    font-size: var(--t-display);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1;
}

h1,
h2,
.steps li::before {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.08;
}

h2 {
    font-size: var(--t-h2);
}

h3 {
    font-size: var(--t-lead);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p,
li,
dd {
    color: var(--ink-soft);
    max-width: var(--measure);
}

p {
    margin: 0;
}

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

a {
    color: var(--ink);
    text-underline-offset: 3px;
}

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip {
    position: absolute;
    left: 16px;
    top: -64px;
    padding: 8px 16px;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: var(--radius-pill);
    z-index: 5;
}

.skip:focus-visible {
    top: 16px;
}

.wrap,
.site-bar-in,
main,
.site-foot {
    width: min(var(--wrap), 100% - 2 * var(--gutter));
    margin-inline: auto;
}

/* ---- bar ---- */
.site-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    background: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-bar-in {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 14px 0;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--t-lead);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.site-brand:hover {
    color: var(--ink);
}

.site-dot {
    fill: var(--accent);
}

.site-nav {
    display: flex;
    gap: 28px;
    margin-left: auto;
    font-size: var(--t-body);
}

.site-nav a {
    color: var(--ink-soft);
    text-decoration: none;
}

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

/* ---- buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: var(--t-body);
    text-decoration: none;
    transition: transform 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    color: var(--on-accent);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-small {
    min-height: 42px;
    padding: 8px 22px;
    font-size: var(--t-small);
}

.btn-night {
    background: var(--night);
    color: var(--on-night);
}

.btn-night:hover {
    color: var(--on-night);
    transform: translateY(-2px);
}

/* ---- hero ---- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding: 24px 0 48px;
}

.hero-lead {
    font-size: var(--t-lead);
    line-height: 1.45;
    color: var(--ink);
    margin: 24px 0 36px;
    max-width: 30ch;
}

.hero-small {
    font-size: var(--t-small);
    margin-top: 20px;
}

.modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 540px;
}

.mode {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 20px 20px;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.15s ease;
}

.mode:hover {
    color: var(--ink);
    transform: translateY(-3px);
}

.mode-first,
.mode-first:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.mode svg {
    width: 28px;
    height: 28px;
    margin-bottom: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mode-name {
    font-size: var(--t-lead);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mode-note {
    font-size: var(--t-small);
    opacity: 0.78;
}

/* the logo, large: a ring, a real chat inside it, and the dot arriving in its opening */
.stage {
    position: relative;
    width: min(100%, 600px);
    aspect-ratio: 1;
    margin: 0 0 0 auto;
}

.stage-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage-ring path {
    stroke: var(--ring);
}

.stage-dot {
    fill: var(--accent);
    transform-origin: 24px 16px;
    animation: dot-arrives 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both;
}

@keyframes dot-arrives {
    from {
        transform: translateX(9px) scale(0.6);
        opacity: 0;
    }
}

.phone {
    position: absolute;
    left: 46.25%;
    top: 50%;
    width: 50%;
    translate: -50% -50%;
    margin: 0;
    border-radius: 12% / 6%;
    background: var(--phone);
    padding: 1.4%;
    box-shadow: 0 0 0 6px var(--ground); /* taste-skill-ignore: a cut-out between the phone and the ring, not a shadow */
    animation: phone-rises 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes phone-rises {
    from {
        transform: translateY(28px);
        opacity: 0;
    }
}

.phone img {
    width: 100%;
    border-radius: 10.5% / 5.25%;
}

/* ---- sections ---- */
.section {
    padding: 96px 0;
}

.section-head {
    display: grid;
    gap: 16px;
    margin-bottom: 56px;
}

.section-head p {
    font-size: var(--t-body);
}

/* three ways to talk */
.ways {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.way {
    display: flex;
    flex-direction: column;
    max-width: none;
}

.way-shot {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 28px;
    background: var(--phone);
    margin-bottom: 24px;
}

.way-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.way-video img {
    object-position: 50% 30%;
}

.way-voice img {
    object-position: 50% 42%;
}

.way-text img {
    object-position: 50% 100%;
}

.way h3 {
    margin-bottom: 8px;
}

.way p {
    margin-bottom: 16px;
}

.way a {
    margin-top: auto;
    font-weight: 600;
}

/* how it works: a real sequence, so it is numbered */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    padding-top: 24px;
    border-top: 2px solid var(--ink);
    max-width: none;
}

.steps li::before {
    content: counter(step);
    display: block;
    font-size: var(--t-h2);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--accent-ink);
    margin-bottom: 20px;
}

.steps h3 {
    margin-bottom: 8px;
}

/* something in common */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.split h2 {
    margin-bottom: 20px;
}

.split p + p {
    margin-top: 16px;
}

.common {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.common li {
    padding: 14px 26px;
    border-radius: var(--radius-pill);
    background: var(--night);
    color: var(--accent);
    font-size: var(--t-lead);
    font-weight: 600;
    letter-spacing: -0.01em;
    max-width: none;
}

.common li:nth-child(2) {
    margin-left: 12%;
}

.common li:nth-child(3) {
    margin-left: 4%;
}

.common li:nth-child(4) {
    margin-left: 20%;
}

/* safety: the night band, edge to edge */
.night {
    background: var(--night);
    color: var(--on-night);
    box-shadow: 0 0 0 100vmax var(--night); /* taste-skill-ignore: stretches the band edge to edge, not a shadow */
    clip-path: inset(0 -100vmax);
}

.night h2,
.night dt {
    color: var(--on-night);
}

.night p,
.night dd {
    color: var(--on-night-soft);
}

.night a {
    color: var(--on-night);
}

.night a:hover {
    color: var(--accent);
}

.rules {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 64px;
}

.rules > div {
    padding: 28px 0;
}

.rules dt {
    font-weight: 700;
    font-size: var(--t-lead);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.rules dd {
    margin: 0;
}

.more {
    margin-top: 32px;
}

/* comparison */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-body);
}

th,
td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

thead th {
    font-weight: 700;
}

tbody th {
    font-weight: 500;
    color: var(--ink-soft);
}

tbody td:first-of-type {
    font-weight: 700;
}

/* questions */
.faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 64px;
}

/* taste-skill-ignore: the questions are a list people scan, the lines keep each one apart */
details {
    border-bottom: 1px solid var(--line); /* taste-skill-ignore */
}

details:first-child {
    border-top: 1px solid var(--line); /* taste-skill-ignore */
}

summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 20px 0;
    font-weight: 600;
    font-size: var(--t-body);
    list-style: none;
}

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

summary::after {
    content: '+';
    flex: none;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    color: var(--accent-ink);
}

details[open] summary::after {
    content: '–';
}

details p {
    margin: 0 0 20px;
}

/* closing: the accent, edge to edge */
.close {
    display: grid;
    justify-items: start;
    gap: 32px;
    padding: 96px 0;
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 0 100vmax var(--accent); /* taste-skill-ignore: stretches the band edge to edge, not a shadow */
    clip-path: inset(0 -100vmax);
}

.close h2 {
    font-size: var(--t-display);
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--on-accent);
}

/* ---- footer ---- */
.site-foot {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
    gap: 48px;
    padding: 64px 0 72px;
}

.foot-brand p {
    margin-top: 16px;
    font-size: var(--t-small);
    max-width: 32ch;
}

.site-foot h2 {
    font-family: var(--font);
    font-size: var(--t-small);
    letter-spacing: 0;
    margin-bottom: 16px;
}

.site-foot ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-foot li {
    margin-bottom: 10px;
    font-size: var(--t-small);
}

.site-foot li a {
    color: var(--ink-soft);
    text-decoration: none;
}

.site-foot li a:hover {
    color: var(--ink);
}

/* ---- narrower ---- */
@media (max-width: 900px) {
    :root {
        --gutter: 16px;
    }

    .site-nav {
        display: none;
    }

    .site-bar-in {
        justify-content: space-between;
    }

    .hero,
    .split,
    .faq-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }

    .hero {
        padding: 24px 0 72px;
    }

    .stage {
        margin: 0 auto;
        width: min(100%, 460px);
    }

    .hero-lead {
        font-size: 19px;
    }

    .section {
        padding: 72px 0;
    }

    .section-head {
        margin-bottom: 40px;
    }

    .ways,
    .steps,
    .rules {
        grid-template-columns: minmax(0, 1fr);
    }

    .ways {
        gap: 48px;
    }

    .way-shot {
        aspect-ratio: 1;
    }

    .steps {
        gap: 32px;
    }

    .steps li::before {
        margin-bottom: 12px;
    }

    .close {
        padding: 72px 0;
    }

    .site-foot {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 40px 24px;
        padding: 48px 0 56px;
    }

    .foot-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .modes {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .mode {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 16px 20px;
    }

    .mode svg {
        margin-bottom: 0;
    }

    .mode-note {
        margin-left: auto;
    }

    .common li:nth-child(n) {
        margin-left: 0;
    }

    th,
    td {
        padding: 14px 6px;
        font-size: var(--t-small);
    }
}

/* the parts of each section rise in as it scrolls into view (public/js/site.js adds .reveal-on and .is-in);
   without the script, or with reduced motion, everything is simply there */
.reveal-on [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s ease,
        transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: calc(var(--reveal-i, 0) * 80ms);
}

.reveal-on [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

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

    .btn,
    .mode {
        transition: none;
    }

    .btn:hover,
    .mode:hover {
        transform: none;
    }

    .stage-dot,
    .phone {
        animation: none;
    }

    .reveal-on [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* another language: the page waits, unseen, until its text has been swapped (/js/ui/locale-boot.js) */
html.i18n-pending body {
    visibility: hidden;
}

/* the Language box in the footer */
.site-locale {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    font-size: var(--t-small);
    color: var(--ink-soft);
}

.site-locale select {
    min-height: 40px;
    padding: 0 12px;
    font: inherit;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
}
