/* DayWheel site. Plain CSS, no build step, nothing loaded from other sites.
   Colour is kept for the charts: everything else is ink on an off-white plate, like the app icon. */

:root {
    color-scheme: light dark;
    --ground: #f3f4f6;
    --surface: #ffffff;
    --ink: #1a1c20;
    --muted: #5f656e;
    --line: rgba(20, 24, 32, 0.12);
    --bar: rgba(243, 244, 246, 0.78);
    --blue: #257de0;
    --aqua: #00b894;
    --orange: #f47230;
    --shadow: 0 18px 50px rgba(20, 24, 32, 0.22), 0 2px 8px rgba(20, 24, 32, 0.12);

    /* No font is shipped with this site. These are generic names that ask the visitor's own
       system for its standard interface font, whatever that is on their device. */
    --display: ui-rounded, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
    --text: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;

    --page: 1080px;
    --gutter: clamp(20px, 5vw, 48px);
    --bar-height: 38px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #15161a;
        --surface: #1e2025;
        --ink: #edeef0;
        --muted: #9da3ad;
        --line: rgba(255, 255, 255, 0.14);
        --bar: rgba(21, 22, 26, 0.78);
        --blue: #338ced;
        --aqua: #00a888;
        --orange: #e76624;
        --shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-height) + 24px); }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 17px/1.55 var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

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

h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
p { margin: 0; }

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

/* ---------- The menu bar: the page's navigation, drawn as the place DayWheel lives ---------- */

.menubar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--bar-height);
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    line-height: 1;
}

.menubar .wrap { height: 100%; display: flex; align-items: center; gap: 4px; }

.menubar a {
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.menubar a:hover { background: var(--line); }
.menubar .app-name { font-weight: 700; margin-left: -10px; }
.menubar .spacer { flex: 1; }

/* The ring in the menu bar. Clicking it opens and closes the popover, as in the app. */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: -8px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    cursor: pointer;
}
.status svg { width: 17px; height: 17px; display: block; }
.status:hover, .status[aria-expanded="true"] { background: var(--line); }

/* ---------- Hero ---------- */

.hero { position: relative; }

.hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: clamp(32px, 6vw, 96px);
    align-items: start;
    padding-bottom: clamp(56px, 9vw, 112px);
}

.pitch { padding-top: clamp(64px, 11vw, 148px); }

.pitch h1 {
    font-size: clamp(46px, 8.4vw, 100px);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.035em;
}

.pitch .lede {
    margin-top: clamp(20px, 3vw, 32px);
    max-width: 31em;
    font-size: clamp(18px, 2vw, 21px);
    line-height: 1.45;
    color: var(--muted);
}

.actions { margin-top: clamp(26px, 3.4vw, 40px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 25px;
    background: var(--ink);
    color: var(--ground);
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: transform 0.12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.quiet { background: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

.fineprint { font-size: 14px; line-height: 1.4; color: var(--muted); }

/* The popover screenshot hangs from the ring, six points under the menu bar. */
.popover {
    margin: 6px -8px 0 0;
    width: 300px;
    justify-self: end;
    transform-origin: 88% 0;
    filter: drop-shadow(0 18px 28px rgba(20, 24, 32, 0.24)) drop-shadow(0 1px 3px rgba(20, 24, 32, 0.16));
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}
.popover.closed { opacity: 0; transform: scale(0.97); visibility: hidden; transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s 0.12s; }

@media (prefers-reduced-motion: no-preference) {
    .popover { animation: drop 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.15) 0.35s both; }
    @keyframes drop {
        from { opacity: 0; transform: scale(0.94) translateY(-6px); }
        to { opacity: 1; transform: none; }
    }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .popover, .popover.closed, .button { transition: none; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }

.section h2 {
    font-size: clamp(30px, 4.4vw, 48px);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.028em;
    max-width: 17em;
}

.section .intro { margin-top: 16px; max-width: 36em; color: var(--muted); font-size: 19px; line-height: 1.5; }

/* Rows: a name on the left, what it means on the right, like a settings pane. */
.rows { margin: clamp(32px, 4.4vw, 52px) 0 0; padding: 0; }
.rows > div {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
    column-gap: clamp(24px, 5vw, 72px);
    padding: 22px 0;
    border-top: 1px solid var(--line);
}
.rows > div:last-child { border-bottom: 1px solid var(--line); }
.rows dt { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.rows dd { margin: 0; max-width: 34em; color: var(--muted); }

/* History: the window, large, with its explanation beside it. */
.history .wrap {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    column-gap: clamp(32px, 5vw, 72px);
    align-items: center;
}
.history .intro { font-size: 17px; }
.history .intro + .intro { margin-top: 12px; }
.window { border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; background: var(--surface); }

/* Privacy: the one claim worth saying loudly. */
.privacy { background: var(--surface); }
.privacy h2 { font-size: clamp(36px, 6.4vw, 76px); line-height: 0.98; letter-spacing: -0.035em; max-width: 12em; }

.ledger {
    margin-top: clamp(36px, 5vw, 60px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px clamp(32px, 6vw, 88px);
}
.ledger h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ledger ul { margin: 0; padding: 0; list-style: none; }
.ledger li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.ledger li strong { color: var(--ink); font-weight: 600; }
.privacy .more { margin-top: 28px; }

/* Free and full */
.plans { width: 100%; margin-top: clamp(32px, 4.4vw, 52px); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.plans th, .plans td { padding: 14px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.plans thead th { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.015em; padding-bottom: 12px; }
.plans tbody th { font-weight: 400; padding-right: 16px; }
.plans th:nth-child(n + 2), .plans td { width: 22%; padding-left: 12px; }
.plans td { font-weight: 600; }
.plans td.no { color: var(--muted); font-weight: 400; }

.buy { margin-top: clamp(32px, 4vw, 44px); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.buy .price { font-family: var(--display); font-size: clamp(26px, 3.2vw, 34px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.buy .price .later { color: var(--muted); }
.buy .fineprint { flex-basis: 100%; max-width: 44em; }

/* Footer */
.foot { padding: 36px 0 56px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot .spacer { flex: 1; }

/* ---------- The privacy page: one readable column ---------- */

.doc { max-width: 720px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(56px, 8vw, 96px); }
.doc h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -0.035em; }
.doc h2 { margin-top: 48px; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.doc p, .doc ul { margin-top: 14px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
.doc .lede { margin-top: 20px; font-size: 20px; line-height: 1.45; color: var(--muted); }
.doc code { font: 0.88em ui-monospace, monospace; background: var(--line); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.doc .updated { margin-top: 48px; font-size: 14px; color: var(--muted); }

/* ---------- The page that shows a buyer their key ---------- */

button.button { border: 0; cursor: pointer; }
.doc ol { margin-top: 14px; padding-left: 1.3em; }
.keybox {
    margin-top: 28px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    font: 15px/1.5 ui-monospace, monospace;
    overflow-wrap: anywhere;
    user-select: all;
    -webkit-user-select: all;
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
    .hero .wrap { grid-template-columns: minmax(0, 1fr); }
    .pitch { padding-top: clamp(40px, 9vw, 72px); }
    .popover { justify-self: center; margin: 40px 0 0; transform-origin: 50% 0; }
    .history .wrap { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
    .rows > div { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
    .ledger { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .menubar .link { display: none; }
    .plans th:nth-child(n + 2), .plans td { width: 24%; }
    .plans thead th { font-size: 18px; }
}
