/*
 * Compactic — website styles.
 * Colours, type, spacing and radii mirror the iOS app's design system
 * (Theme.swift + DesignSystem.swift + ClockFaceView.swift). Change the palette
 * in ONE place: the :root / dark-mode custom properties below.
 *
 * NOTE: these are the app's CURRENT (warm) palette. If the bright-brand palette
 * (Focus #FE601B, Relax #3D4D9E) is later applied to the app, swap the two
 * --focus / --relax values here and the whole site follows.
 */

/* Comfortaa — the brand wordmark font, self-hosted (no Google CDN → GDPR-clean) */
@font-face {
    font-family: "Comfortaa";
    src: url("assets/fonts/Comfortaa-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "Comfortaa";
    src: url("assets/fonts/Comfortaa-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    /* Warm light palette — from Theme.swift (light variant) */
    --bg:      #E8DDCC;   /* screen background */
    --face:    #FBF7F0;   /* dial face / card fill */
    --ink-rgb: 42, 33, 26;   /* #2A211A — text/ticks */
    --focus:   #D87058;   /* Focus accent (warm) */
    --relax:   #8581B6;   /* Relax accent (cool) */

    /* Ink opacity ramp (mirrors DesignSystem.swift) */
    --ink-strong: rgba(var(--ink-rgb), 0.90);
    --ink-medium: rgba(var(--ink-rgb), 0.60);
    --ink-soft:   rgba(var(--ink-rgb), 0.40);
    --ink-faint:  rgba(var(--ink-rgb), 0.22);

    /* Rounded type: SF Rounded on Apple, system rounded/sans elsewhere.
       No web-font body face → zero external requests. */
    --font-body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-brand: "Comfortaa", var(--font-body);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Warm dark palette — from Theme.swift (dark variant) */
        --bg:      #16110D;
        --face:    #2C231D;
        --ink-rgb: 240, 230, 216;   /* #F0E6D8 */
        /* accents identical in both modes, as in the app */
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--ink-strong);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding: 32px 24px;
}

/* Document pages (legal) flow from the top instead of vertically centring. */
body.doc { justify-content: flex-start; }

/* ---- Hero (landing) ---- */

.hero {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1 0 auto;
    justify-content: center;
}

.dial-wrap { width: 190px; height: 190px; margin-bottom: 28px; }
#dial { width: 100%; height: 100%; display: block; }

/* SVG dial parts — styled here so they follow light/dark automatically.
   Matches ClockFaceView: one ink for all ticks + numerals; sector at 0.82. */
.dial-face   { fill: var(--face); }
.dial-tick   { stroke: var(--ink-strong); }
.dial-sector { fill: var(--focus); fill-opacity: 0.82; }
.dial-hand   { stroke: var(--focus); stroke-linecap: round; }
.dial-tip    { fill: var(--focus); }
.dial-hub    { fill: var(--ink-strong); }
.dial-num    {
    fill: var(--ink-strong);
    font-family: var(--font-body);
    font-weight: 500;
}

.eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--focus);
    margin-bottom: 14px;
}

.wordmark {
    font-family: var(--font-brand);
    font-weight: 600;
    font-size: clamp(40px, 12vw, 60px);
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: 20px;
}
.wm-ink    { color: var(--ink-strong); }
.wm-accent { color: var(--focus); }

.headline {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(22px, 6vw, 28px);
    color: var(--ink-strong);
    margin-bottom: 14px;
}

.subhead {
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-medium);
    max-width: 30rem;
    margin-bottom: 36px;
}

/* ---- Sign-up ---- */

.signup { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.signup-label { font-size: 15px; font-weight: 600; color: var(--ink-strong); }
.form-slot {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Custom email form — styled to the app (rounded input + capsule accent button,
   like DesignSystem's CompactPrimaryButtonStyle). Submits to a beehiiv magic
   link, so no iframe and no API key. */
.beehiiv-form {
    display: flex;
    gap: 10px;
    width: 100%;
}
.beehiiv-form input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    font: inherit;
    font-size: 16px;
    color: var(--ink-strong);
    background: var(--face);
    border: 1px solid var(--ink-faint);
    border-radius: 999px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.beehiiv-form input::placeholder { color: var(--ink-soft); }
/* Stop browser autofill from repainting the field white/yellow: force our own
   face background (via a huge inset shadow) and ink text in both themes. */
.beehiiv-form input:-webkit-autofill,
.beehiiv-form input:-webkit-autofill:hover,
.beehiiv-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink-strong);
    -webkit-box-shadow: 0 0 0 1000px var(--face) inset;
    box-shadow: 0 0 0 1000px var(--face) inset;
    caret-color: var(--ink-strong);
    transition: background-color 9999s ease-in-out 0s;
}
.beehiiv-form input:focus {
    outline: none;
    border-color: var(--focus);
    /* accent focus ring — update the rgba if --focus changes */
    box-shadow: 0 0 0 3px rgba(216, 112, 88, 0.22);
}
.beehiiv-form button {
    padding: 14px 24px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--focus);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.1s ease;
}
.beehiiv-form button:hover { opacity: 0.9; }
.beehiiv-form button:active { transform: scale(0.98); }

.form-success {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-strong);
}

@media (max-width: 420px) {
    .beehiiv-form { flex-direction: column; }
    .beehiiv-form button { width: 100%; }
}

/* ---- Document / legal pages ---- */

.page { width: 100%; max-width: 720px; margin: 0 auto; }

.topbar { padding: 8px 0 24px; }
.topbar .wordmark {
    font-size: 26px;
    margin: 0;
    text-decoration: none;
    display: inline-block;
}

.legal { line-height: 1.6; padding-bottom: 24px; }
.legal h1 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 28px;
    color: var(--ink-strong);
    margin-bottom: 6px;
}
.legal .stand { color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }
.legal h2 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 19px;
    color: var(--ink-strong);
    margin: 28px 0 8px;
}
.legal p, .legal li { color: var(--ink-medium); font-size: 16px; margin-bottom: 10px; }
.legal ul { padding-left: 20px; }
.legal address { font-style: normal; color: var(--ink-medium); margin-bottom: 10px; }
.legal a { color: var(--focus); }
.legal strong { color: var(--ink-strong); font-weight: 600; }

/* ---- Footer (shared) ---- */

.footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-soft);
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--ink-medium); text-decoration: none; }
.footer-links a:hover { color: var(--focus); }
.footer .copy a { color: var(--ink-soft); text-decoration: none; }
.footer .copy a:hover { color: var(--focus); text-decoration: underline; }

.socials { display: flex; gap: 20px; align-items: center; justify-content: center; }
.socials a { color: var(--ink-soft); display: inline-flex; transition: color 0.15s ease; }
.socials a:hover { color: var(--focus); }
.socials svg { width: 20px; height: 20px; fill: currentColor; display: block; }

/* On document pages, keep the footer left-aligned with the content column. */
body.doc .footer { align-items: center; }
