/*
 * WTW on the web — the app's Love & Chaos system (ios/WTW/Design), flat.
 *
 * Same surface, same three brand colours at full strength, same type:
 * H.H. Samuel for headings (always uppercase), Manrope for everything you
 * read and tap, Newsreader italic for the sentence you made.
 *
 * Phones get the app's own layout. An iPad gets a rail of the same round
 * icons down the side; a desktop gets the rail with its words and Begin.
 */

@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "HH Samuel"; src: url("/fonts/HH-Samuel-font.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/Newsreader-MediumItalic.ttf") format("truetype"); font-style: italic; font-weight: 500; font-display: swap; }

:root {
    color-scheme: light;

    /* LCColor */
    --surface: #F0F0F5;
    --pink: #FD399A;
    --blue: #00BAF1;
    --yellow: #FFF000;
    --ink: #2B2B31;
    --text-2: #6B6B74;
    --hairline: #CBCCD4;
    --divider: #A0A2B2;
    --connected: #34C759;

    /* The edges flat surfaces are told apart by (Surfaces.swift). */
    --card-edge: rgba(160, 162, 178, .38);
    --field-edge: rgba(160, 162, 178, .45);
    --button-edge: rgba(160, 162, 178, .5);
    --field-fill: rgba(43, 43, 49, .04);
    --press: rgba(43, 43, 49, .05);

    /* History's bands: the valley thinned toward the surface, a fifth at a time. */
    --wallow-1: #cfe6f5; --wallow-2: #addcf5; --wallow-3: #88d1f4; --wallow-4: #5cc6f3; --wallow-5: #00baf1;
    --worry-1: #f2f1d7;  --worry-2: #f5f2b7;  --worry-3: #f8f293;  --worry-4: #fbf167;  --worry-5: #fff000;

    /* LCRadius */
    --r-card: 18px;
    --r-field: 15px;
    --r-chip: 12px;

    --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "HH Samuel", "Manrope", system-ui, sans-serif;
    --font-sentence: "Newsreader", Georgia, "Times New Roman", serif;

    --gutter: 24px;
    --rail: 0px;
    --ease: cubic-bezier(.25, .1, .25, 1);
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
[hidden] { display: none !important; }

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

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Copy that depends on the hand: a finger on a phone, a held click on a desktop. */
.for-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
    .for-touch { display: none; }
    .for-mouse { display: inline; }
}

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

.heading {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.12;
    color: var(--ink);
}

.label-caps {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-2);
}
.label-caps--11 { font-size: 11px; }
.label-caps--10 { font-size: 10px; }

.sentence {
    font-family: var(--font-sentence);
    font-style: italic;
    font-weight: 500;
}

.muted { color: var(--text-2); }
.problem { color: var(--pink); font-size: 13px; line-height: 1.5; }
.small { font-size: 12px; line-height: 1.5; }
.lead { font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* ---------- Surfaces ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--card-edge);
    border-radius: var(--r-card);
}

.divider {
    height: 1.5px;
    width: 66%;
    margin: 0 auto;
    background: linear-gradient(90deg, rgba(160, 162, 178, 0), rgba(160, 162, 178, .4), rgba(160, 162, 178, 0));
    border: 0;
}
.divider--wide { width: 82%; }
.divider--full { width: 100%; }

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

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 54px;
    padding: 15px 24px;
    border-radius: 999px;
    border: 1px solid var(--button-edge);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: .2px;
    cursor: pointer;
    transition: opacity .12s ease-out, transform .12s ease-out;
    -webkit-user-select: none;
    user-select: none;
    text-align: center;
}
.btn:active { opacity: .72; transform: scale(.985); }
.btn--yellow { background: var(--yellow); border-color: transparent; color: var(--ink); }
.btn--quiet { font-weight: 700; font-size: 15px; }
.btn--inline { width: auto; display: inline-flex; }
.btn[disabled], .btn.is-disabled { opacity: .4; cursor: default; transform: none; }
.btn.is-ghost { visibility: hidden; }

.link-btn {
    background: none;
    border: 0;
    padding: 6px 0;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
}
.link-btn--pink { color: var(--pink); }
.link-btn--quiet { color: var(--text-2); font-weight: 400; font-size: 13px; }
.link-btn[disabled] { color: var(--text-2); cursor: default; }

.circle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--button-edge);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
}

/* ---------- Fields ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__input {
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;
    border-radius: var(--r-field);
    border: 1px solid var(--field-edge);
    background: var(--field-fill);
    color: var(--ink);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 17px;
    line-height: 1.4;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
}
.field__input::placeholder { color: var(--text-2); opacity: 1; }
.field__input:focus { border-color: rgba(43, 43, 49, .45); }
.field__input.is-wrong, .field.has-error .field__input { border-color: var(--pink); border-width: 1.5px; }
textarea.field__input { resize: vertical; min-height: 96px; }
.field__error { color: var(--pink); font-size: 13px; }

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}
.checkbox input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border-radius: 6px;
    border: 2px solid var(--text-2);
    background: var(--surface);
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    place-content: center;
    cursor: pointer;
}
.checkbox input:checked { background: var(--pink); border-color: var(--pink); }
.checkbox input:checked::after {
    content: "";
    width: 11px;
    height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: translateY(-2px) rotate(-45deg);
}

/* A switch, the shape iOS uses — "on" spelled out next to it, never colour alone. */
.switch {
    position: relative;
    flex: none;
    width: 51px;
    height: 31px;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    border-radius: 999px;
    background: rgba(120, 120, 128, .2);
    cursor: pointer;
    transition: background .2s var(--ease);
}
.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16);
    transition: transform .2s var(--ease);
}
.switch:checked { background: var(--connected); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: default; }

/* ---------- Rows ---------- */

.row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--card-edge);
    border-radius: var(--r-card);
    cursor: pointer;
    transition: background .12s;
}
a.row:active, button.row:active { background: var(--press); }
@media (hover: hover) { a.row:hover, button.row:hover { background: rgba(43, 43, 49, .025); } }
.row__lead {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--card-edge);
    color: var(--text-2);
}
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-weight: 700; font-size: 16px; color: var(--ink); }
.row__sub {
    font-size: 12px;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chev { flex: none; color: rgba(107, 107, 116, .6); }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Circle lights (CircleDot.swift) ---------- */

.dot { flex: none; overflow: visible; }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 11px;
    color: var(--text-2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Banners (Home) ---------- */

.banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--r-card);
    border: 1px solid var(--card-edge);
    background: var(--surface);
    font-weight: 700;
    font-size: 14px;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
.banner__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.banner__text { flex: 1; }

/* ---------- Choice cards ---------- */

.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--r-chip);
    border: 1px solid var(--card-edge);
    cursor: pointer;
}
.choice input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border-radius: 50%;
    border: 1.5px solid var(--text-2);
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    place-content: center;
    cursor: pointer;
}
.choice input:checked { border-color: var(--pink); }
.choice input:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }
.choice__title { font-weight: 700; font-size: 15px; }
.choice__detail { font-size: 12px; color: var(--text-2); }
.choice.is-disabled { opacity: .45; cursor: default; }

/* ---------- Dialogs: the app's alerts and action sheets ---------- */

.dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(43, 43, 49, .22);
}
.dialog::backdrop { background: rgba(43, 43, 49, .32); }
.dialog__body { padding: 24px 22px 10px; text-align: center; }
.dialog__title { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.dialog__message { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.dialog__actions { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; }
.dialog__actions form { display: contents; }
.dialog__actions .btn { min-height: 48px; font-size: 15px; padding: 12px 18px; }
.btn--danger { color: var(--pink); }
@media (max-width: 767px) {
    /* Phones: from the bottom, like an action sheet. */
    .dialog { margin: auto auto 12px; width: calc(100vw - 16px); max-width: none; }
}

/* ---------- The mark ---------- */

.mark { width: 100%; height: auto; overflow: visible; }
.mark-wrap { position: relative; }
/* The halo that says "here" — it stops once the finger lands. */
.mark-halo { transform-box: fill-box; transform-origin: center; animation: halo 1.5s ease-out infinite; }
@keyframes halo { from { transform: scale(1); opacity: 1; } to { transform: scale(1.34); opacity: 0; } }

/* ---------- Shell ---------- */

.shell { min-height: 100vh; min-height: 100dvh; }

.rail { display: none; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    align-items: center;
    height: 52px;
    padding: 0 8px;
    padding-top: env(safe-area-inset-top);
    background: rgba(240, 240, 245, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.topbar__back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px; font-weight: 600; font-size: 15px; }
.topbar__title { text-align: center; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__action { justify-self: end; padding-right: 8px; }
.topbar__action a, .topbar__action button { font-weight: 700; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 8px 4px; }

.content {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 8px var(--gutter) 48px;
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
}
.content--wide { max-width: 1080px; }

.page-head { display: none; }

.flash {
    margin: 4px 0 16px;
    padding: 12px 14px;
    border-radius: var(--r-chip);
    border: 1px solid rgba(253, 57, 154, .45);
    color: var(--pink);
    font-size: 13px;
}

/* iPad and up: the rail. */
@media (min-width: 768px) {
    :root { --rail: 104px; --gutter: 40px; }

    .topbar { display: none; }

    .rail {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 6;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: var(--rail);
        padding: 28px 10px 24px;
        border-right: 1px solid var(--card-edge);
        background: var(--surface);
        overflow-y: auto;
    }
    .rail__brand { width: 64px; padding: 6px 0 22px; }
    .rail__nav { display: flex; flex-direction: column; gap: 6px; width: 100%; }
    .rail__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 10px 2px;
        border-radius: 14px;
        color: var(--text-2);
    }
    .rail__icon {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: 1px solid var(--card-edge);
        transition: background .15s, border-color .15s;
    }
    .rail__label { font-weight: 700; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; text-align: center; }
    .rail__item.is-active { color: var(--ink); }
    .rail__item.is-active .rail__icon { border-color: var(--ink); }
    @media (hover: hover) { .rail__item:hover .rail__icon { background: var(--press); } }
    .rail__spacer { flex: 1; min-height: 20px; }
    .rail__begin {
        width: 76px;
        min-height: 44px;
        padding: 10px 0;
        font-size: 14px;
    }
    .rail__who { display: none; }

    .shell { padding-left: var(--rail); }
    .content { padding-top: 40px; }

    .page-head {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 28px;
    }
    .page-head__back {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        margin-bottom: 10px;
        font-weight: 700;
        font-size: 13px;
        color: var(--text-2);
    }
    .page-head__title { font-size: 34px; }
    .page-head__action a, .page-head__action button {
        font-weight: 700; font-size: 14px; background: none; cursor: pointer;
        padding: 9px 18px; border-radius: 999px; border: 1px solid var(--button-edge);
    }
    .dialog { margin: auto; }
}

/* Desktop: the rail grows its words and Begin. */
@media (min-width: 1200px) {
    :root { --rail: 256px; --gutter: 56px; }

    .rail { align-items: stretch; padding: 36px 22px 28px; }
    .rail__brand { width: 132px; padding: 0 8px 36px; }
    .rail__item { flex-direction: row; gap: 14px; padding: 8px 10px; }
    .rail__label { font-size: 15px; letter-spacing: 0; text-transform: none; text-align: left; }
    .rail__begin { width: 100%; min-height: 54px; font-size: 16px; }
    .rail__who {
        display: block;
        margin-top: 16px;
        padding: 0 4px;
        font-size: 12px;
        color: var(--text-2);
        overflow-wrap: anywhere;
    }
    .content { padding-top: 56px; }
    .page-head__title { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
