/* Stint website. The accent colours are Stint's own project palette (ProjectPalette.swift). */

:root {
    --paper: #f5f6fa;
    --surface: #ffffff;
    --ink: #161925;
    --muted: #5a6072;
    --rule: #dde1ea;
    --brand: #3d63ee;
    --brand-deep: #4b3fc4;
    --brand-ink: #ffffff;
    --code-bg: #eceef5;

    --blue: #0090ff;
    --blue-light: #5cb5ff;
    --blue-dark: #0067b8;
    --orange: #e85d04;
    --green: #30a46c;
    --purple: #8e4ec6;
    --amber: #ba7a00;

    --stage: #171a26;
    --stage-line: #2a2f41;
    --stage-text: #e8eaf2;
    --stage-muted: #8d93a8;

    --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
    --body: "Instrument Sans", -apple-system, system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, monospace;

    --measure: 66ch;
    --page: 1160px;
    --gutter: clamp(16px, 4vw, 40px);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #11131b;
        --surface: #181b26;
        --ink: #e9ebf3;
        --muted: #9aa0b4;
        --rule: #2a2e3d;
        --brand: #6f8cff;
        --brand-deep: #7a6cf0;
        --brand-ink: #0d1020;
        --code-bg: #1f2331;
        --stage: #1a1d2c;
        --stage-line: #2c3145;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --paper: #11131b;
    --surface: #181b26;
    --ink: #e9ebf3;
    --muted: #9aa0b4;
    --rule: #2a2e3d;
    --brand: #6f8cff;
    --brand-deep: #7a6cf0;
    --brand-ink: #0d1020;
    --code-bg: #1f2331;
    --stage: #1a1d2c;
    --stage-line: #2c3145;
    color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.6 var(--body);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

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

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

h1, h2, h3 {
    font-family: var(--display);
    font-optical-sizing: auto;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0;
    text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

code, kbd {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--code-bg);
    border-radius: 5px;
    padding: 0.1em 0.35em;
}

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--rule); }

.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }

.wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 700 21px/1 var(--display);
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}
.wordmark img { width: 32px; height: 32px; }

.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav .button { color: var(--brand-ink); }

@media (max-width: 640px) {
    .site-nav a:not(.button) { display: none; }
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand), var(--brand-deep));
    color: var(--brand-ink);
    font: 600 16px/1.2 var(--body);
    text-decoration: none;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 6px 18px -8px var(--brand-deep);
}
.button:hover { filter: brightness(1.06); }
.button.small { padding: 8px 14px; font-size: 14px; }
.button svg { width: 18px; height: 18px; }

/* Hero */

.hero { padding: clamp(40px, 8vw, 88px) 0 0; }

.hero h1 {
    font-size: clamp(44px, 7.4vw, 92px);
    font-weight: 700;
    max-width: 13ch;
    letter-spacing: -0.025em;
    line-height: 1.02;
}

.hero .lede {
    font-size: clamp(18px, 2vw, 21px);
    color: var(--muted);
    max-width: 52ch;
    margin: 24px 0 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hero-actions .fine { color: var(--muted); font-size: 15px; line-height: 1.4; }
.hero-actions .fine strong { color: var(--ink); font-weight: 600; }

/* The banner: a day being recorded */

.day {
    --lane-label: 150px;
    margin: clamp(40px, 6vw, 72px) 0 0;
    background: var(--stage);
    color: var(--stage-text);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--stage-line), 0 30px 60px -30px rgb(20 24 50 / 0.55);
    font-size: 14px;
    position: relative;
}

.day-menubar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 18px;
    height: 30px;
    padding: 0 14px;
    background: rgb(255 255 255 / 0.06);
    border-bottom: 1px solid var(--stage-line);
    font-size: 13px;
    color: var(--stage-muted);
}

.day-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--stage-text);
    background: rgb(255 255 255 / 0.08);
}
.day-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stage-muted); transition: background 0.4s; }

.day-now {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    min-height: 66px;
    padding: 16px 20px 8px calc(var(--lane-label) + 20px);
}
.day-now .app { font-weight: 600; }
.day-now .context { color: var(--stage-muted); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.day-now .match {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--stage-text);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s, transform 0.3s;
}
.day-now .match.on { opacity: 1; transform: none; }
.day-now .context.plain { font-family: var(--body); font-size: 14px; }
.day.still * { transition: none !important; }
.day-now .match .swatch { width: 10px; height: 10px; border-radius: 3px; }

.day-grid { position: relative; padding: 0 20px 22px; }

.day-axis, .day-lane { display: grid; grid-template-columns: var(--lane-label) 1fr 64px; align-items: center; }

.day-axis { height: 26px; color: var(--stage-muted); font-size: 12px; }
.day-axis .ticks { position: relative; height: 100%; }
.day-axis .ticks span { position: absolute; top: 4px; transform: translateX(-50%); }

.day-lane { height: 34px; border-top: 1px solid var(--stage-line); }
.day-lane .label { display: flex; align-items: center; gap: 8px; color: var(--stage-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.day-lane .label i { flex: none; width: 9px; height: 9px; border-radius: 3px; }
.day-lane .track { position: relative; height: 100%; }
.day-lane .total { text-align: right; color: var(--stage-text); font-size: 13px; }
.day-lane.activity .label { color: var(--stage-text); }

.block {
    position: absolute;
    top: 7px;
    bottom: 7px;
    border-radius: 4px;
    background: #4a5068;
    transform-origin: left center;
}
.block.recorded { background: #343a50; }
.block.sorted { animation: drop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }

@keyframes drop {
    from { opacity: 0; transform: translateY(var(--from, -34px)) scaleY(0.6); }
    to { opacity: 1; transform: none; }
}

.playhead {
    position: absolute;
    top: 26px;
    bottom: 22px;
    width: 2px;
    margin-left: -1px;
    background: #ff5d5d;
    border-radius: 2px;
    pointer-events: none;
}
.playhead::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5d5d;
}

@media (max-width: 720px) {
    .day { --lane-label: 0px; border-radius: 14px; }
    .day-lane .label, .day-axis > span:first-child { display: none; }
    .day-axis, .day-lane { grid-template-columns: 1fr 56px; }
    .day-lane .label { display: none; }
    .day-now { padding-left: 16px; }
    .day-grid { padding: 0 14px 18px; }
    .day-axis .ticks span:nth-child(even) { display: none; }
    .day-menubar .hide-narrow { display: none; }
}

/* Sections */

.section { padding: clamp(64px, 10vw, 128px) 0 0; }

.section-head { max-width: 40rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; }
.section-head p { color: var(--muted); font-size: 19px; margin-top: 16px; }

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 28px 32px;
    counter-reset: step;
}
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 16px; }
.steps li::before {
    content: counter(step);
    display: block;
    font: 700 15px/1 var(--display);
    color: var(--muted);
    margin-bottom: 14px;
}
.steps h3 { font-size: 21px; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 16px; margin: 0; }

.feature {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}
.feature.flip { grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); }
.feature.flip .feature-text { order: 2; }
.feature h2 { font-size: clamp(30px, 3.8vw, 44px); font-weight: 700; margin-bottom: 18px; }
.feature-text > p { color: var(--muted); }
.feature-text ul { margin: 0; padding: 0; list-style: none; }
.feature-text li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 16px; }
.feature-text li strong { font-weight: 600; }

@media (max-width: 880px) {
    .feature, .feature.flip { grid-template-columns: 1fr; }
    .feature.flip .feature-text { order: 0; }
}

.shot { margin: 0; }
.shot img {
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 24px 48px -24px rgb(20 24 50 / 0.45);
}
.shot figcaption { color: var(--muted); font-size: 14px; margin-top: 12px; }

.rule-sentence {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 16px;
}
.rule-sentence i { flex: none; width: 10px; height: 10px; border-radius: 3px; margin-top: 0.5em; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.pair h3 { font-size: 24px; margin: 22px 0 8px; }
.pair p { color: var(--muted); max-width: 46ch; }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } }

/* Privacy */

.privacy {
    margin-top: clamp(64px, 10vw, 128px);
    padding: clamp(48px, 7vw, 88px) 0;
    background: var(--surface);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0 40px;
}
.facts div { border-top: 1px solid var(--rule); padding: 18px 0 22px; }
.facts h3 { font-size: 19px; margin-bottom: 6px; }
.facts p { color: var(--muted); font-size: 16px; margin: 0; }

/* Free before 1.0 */

.free {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: end;
    padding-bottom: clamp(64px, 10vw, 120px);
}
.free h2 { font-size: clamp(36px, 5.6vw, 68px); font-weight: 700; letter-spacing: -0.025em; max-width: 13ch; }
.free p { color: var(--muted); max-width: 52ch; margin-top: 18px; }
@media (max-width: 760px) { .free { grid-template-columns: 1fr; } }

/* Footer */

.site-footer { border-top: 1px solid var(--rule); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Docs */

.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding-top: 40px; padding-bottom: 96px; }

.docs-nav { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: 15px; }
.docs-nav ol { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 5px 0 5px 12px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--rule); }
.docs-nav a:hover { color: var(--ink); }
.docs-nav a.current { color: var(--ink); border-left-color: var(--brand); }

@media (max-width: 860px) {
    .docs { grid-template-columns: 1fr; }
    .docs-nav { position: static; max-height: none; }
    .docs-nav ol { display: flex; flex-wrap: wrap; gap: 6px; }
    .docs-nav a { border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
}

.prose { max-width: var(--measure); }
.prose > h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 18px; }
.prose > .lede { font-size: 20px; color: var(--muted); }
.prose h2 { font-size: clamp(28px, 3.4vw, 36px); font-weight: 700; margin: 72px 0 16px; padding-top: 8px; }
.prose h3 { font-size: 21px; margin: 36px 0 10px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 0.3em 0; }
.prose .shot { margin: 28px 0 32px; }
.prose .shot.narrow { max-width: 460px; }
.prose .shot.tiny { max-width: 300px; }

.note {
    border-left: 3px solid var(--brand);
    background: var(--surface);
    padding: 14px 18px;
    border-radius: 0 10px 10px 0;
    margin: 0 0 1.2em;
}
.note p:last-child { margin: 0; }

table { width: 100%; border-collapse: collapse; margin: 8px 0 1.4em; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--muted); }
.table-scroll { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
