/* Tidebook site styles. Colours, type and radii mirror docs/design-tokens.json; dark mode is a
   token swap, like the app. Figtree is served from this site (no font CDN, no third parties). */

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree-Regular.woff") format("woff");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree-SemiBold.woff") format("woff");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree-Bold.woff") format("woff");
    font-weight: 700;
    font-display: swap;
}

:root {
    --ground: #F6F7F4;
    --surface: #FFFFFF;
    --ink: #1F2A2E;
    --muted: #5A6669;
    --line: #E3E7E1;
    --primary: #2F6F6A;
    --primary-pressed: #24524E;
    --primary-tint: #E4EFEC;
    --on-primary: #FFFFFF;
    --flare: #6B3A5B;

    --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-card: 20px;
    --radius-control: 14px;
    --page: 1040px;
    --text: 680px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #141A1C;
        --surface: #1F2729;
        --ink: #EEF1EE;
        --muted: #A9B4B2;
        --line: #2E383A;
        --primary: #6FB3AB;
        --primary-pressed: #8CC6BF;
        --primary-tint: #1E3533;
        --on-primary: #0F1A19;
        --flare: #D59BC0;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    background-color: var(--ground);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--primary-pressed);
}

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

/* The app's `label` style: 12 pt bold, uppercase, 6% tracking. */
.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.875rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.625rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.0625rem;
}

/* Header and footer */

header {
    max-width: var(--page);
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

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

.wordmark img {
    width: 36px;
    height: 36px;
    border-radius: 22.5%;
    display: block;
}

nav {
    display: flex;
    gap: 0.25rem;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-control);
}

nav a:hover,
nav a[aria-current="page"] {
    color: var(--ink);
}

footer {
    border-top: 1px solid var(--line);
    margin-top: 4rem;
}

.footer-content {
    max-width: var(--page);
    margin: 0 auto;
    padding: 2rem 20px 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--ink);
}

/* Home */

.hero {
    max-width: var(--page);
    margin: 0 auto;
    padding: 3.5rem 20px 4rem;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: center;
}

.hero p {
    color: var(--muted);
    margin-top: 1.25rem;
    max-width: 34rem;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.625rem 1rem;
    border-radius: 999px;
    background: var(--primary-tint);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.9375rem;
}

.status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.platform {
    font-size: 0.875rem;
    margin-top: 0.875rem !important;
}

/* The check-in card from Today (F3), drawn with the app's tokens. Decorative. */
.checkin {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 24px 20px 20px;
}

.checkin-title {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.checkin-subtitle {
    color: var(--muted);
    font-size: 0.9375rem;
    margin-top: 0.25rem;
}

.levels {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 1.25rem;
}

.level {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 76px;
    border: 2px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--ground);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.level.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.meter {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.meter i {
    width: 4px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.22;
}

.meter i:nth-child(1) { height: 6px; }
.meter i:nth-child(2) { height: 8.5px; }
.meter i:nth-child(3) { height: 11px; }
.meter i:nth-child(4) { height: 13.5px; }
.meter i:nth-child(5) { height: 16px; }

.meter[data-level="0"] i:nth-child(-n+1),
.meter[data-level="1"] i:nth-child(-n+2),
.meter[data-level="2"] i:nth-child(-n+3),
.meter[data-level="3"] i:nth-child(-n+4),
.meter[data-level="4"] i:nth-child(-n+5) {
    opacity: 1;
}

.checkin-saved {
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.band {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 20px;
}

.band-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

.band-inner p {
    color: var(--muted);
    margin-top: 0.5rem;
    font-size: 0.9375rem;
}

/* Text pages: privacy policy, support, 404 */

.page {
    max-width: var(--text);
    margin: 0 auto;
    padding: 2.5rem 20px 0;
}

.page h1 {
    margin-bottom: 0.5rem;
}

.page .updated {
    color: var(--muted);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.page h2 {
    font-size: 1.25rem;
    margin: 2.5rem 0 0.75rem;
}

.page p,
.page ul {
    margin-bottom: 1rem;
}

.page ul {
    padding-left: 1.25rem;
}

.page li {
    margin-bottom: 0.375rem;
}

.page li::marker {
    color: var(--muted);
}

.contact {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.topics {
    display: grid;
    gap: 12px;
    margin-top: 1rem;
}

.topic {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.5rem;
}

.topic h3 {
    margin-bottom: 0.375rem;
}

.topic p {
    color: var(--muted);
    font-size: 0.9375rem;
    margin-bottom: 0;
}

.topic p + p {
    margin-top: 0.625rem;
}

.not-found {
    text-align: center;
    padding-top: 5rem;
}

.not-found p {
    color: var(--muted);
    margin-top: 1rem;
}

@media (max-width: 820px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
        padding-top: 2rem;
    }

    .band-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 420px) {
    .level {
        font-size: 0.75rem;
        min-height: 68px;
    }

    .checkin {
        padding: 20px 14px 16px;
    }

    .levels {
        gap: 6px;
    }
}
