:root {
    --paper: #f5f2ec;
    --surface-1: #fbfaf7;
    --ink: #121212;
    --ink-2: #52514e;
    --ink-3: #8a8883;
    --grid: #e4e1da;
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --seq-100: #cde2fb;
    --seq-700: #0d366b;
    --serif: 'Instrument Serif', Georgia, serif;
    --sans: 'Geist', system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 18px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--ink);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 50;
}

.top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px clamp(20px, 4vw, 48px);
    z-index: 40;
    font-size: 14px;
    mix-blend-mode: multiply;
}

.brand {
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    gap: 8px;
    align-items: center;
}

.brand i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--series-2);
}

.top nav {
    display: flex;
    gap: 22px;
    color: var(--ink-2);
}

.top nav a {
    color: inherit;
    text-decoration: none;
}

.top nav a:hover {
    color: var(--ink);
}

.hero {
    position: relative;
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    display: grid;
    place-items: end start;
    padding: 0 clamp(20px, 4vw, 48px) clamp(40px, 8vh, 90px);
}

#streaks {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-copy {
    position: relative;
    max-width: 980px;
}

.hero-copy::before {
    content: '';
    position: absolute;
    inset: -12% -20% -18% -12%;
    background: radial-gradient(
        closest-side,
        rgba(245, 242, 236, 0.92),
        rgba(245, 242, 236, 0.6) 60%,
        rgba(245, 242, 236, 0)
    );
    z-index: -1;
}

.kicker {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: 18px;
}

.hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(56px, 10vw, 150px);
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.hero h1 em {
    color: var(--series-2);
}

.hero-num {
    margin-top: 28px;
    display: flex;
    gap: 18px;
    align-items: baseline;
    flex-wrap: wrap;
}

.hero-num b {
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 600;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
}

.hero-num span {
    color: var(--ink-2);
    max-width: 300px;
    font-size: 16px;
    line-height: 1.4;
}

.scroll-cue {
    position: absolute;
    right: clamp(20px, 4vw, 48px);
    bottom: clamp(40px, 8vh, 90px);
    font-size: 13px;
    color: var(--ink-2);
    display: flex;
    gap: 10px;
    align-items: center;
}

.scroll-cue::after {
    content: '';
    width: 1px;
    height: 46px;
    background: var(--ink);
    animation: cue 1.8s ease-in-out infinite;
    transform-origin: top;
}

@keyframes cue {
    0% {
        transform: scaleY(0);
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 48px);
}

.chapter-head {
    padding: 18vh 0 6vh;
    max-width: 820px;
}

.chapter-head .num {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.chapter-head h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(40px, 6vw, 84px);
    line-height: 0.98;
    letter-spacing: -0.015em;
    margin-top: 14px;
}

.chapter-head p {
    color: var(--ink-2);
    margin-top: 22px;
    max-width: 600px;
    font-size: 20px;
}

.figure {
    background: var(--surface-1);
    border-radius: 20px;
    padding: 28px;
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.04),
        0 20px 50px -30px rgba(40, 30, 10, 0.25);
}

.fig-title {
    font-weight: 600;
    font-size: 16px;
}

.fig-sub {
    color: var(--ink-2);
    font-size: 14px;
    margin-top: 2px;
}

.legend {
    display: flex;
    gap: 18px;
    font-size: 13px;
    color: var(--ink-2);
    margin-top: 12px;
    min-height: 20px;
    transition: opacity 0.4s;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend i {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    display: inline-block;
}

.legend i.sq {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

svg text {
    font-family: var(--sans);
}

.axis text {
    fill: var(--ink-3);
    font-size: 11px;
}

.axis line {
    stroke: var(--grid);
    stroke-width: 1;
}

.lbl {
    fill: var(--ink);
    font-size: 12px;
    font-weight: 600;
}

.lbl-2 {
    fill: var(--ink-2);
    font-size: 12px;
}

details.table {
    margin-top: 14px;
    font-size: 13px;
    color: var(--ink-2);
}

details.table summary {
    cursor: pointer;
    width: max-content;
}

details.table table {
    border-collapse: collapse;
    margin-top: 10px;
    font-variant-numeric: tabular-nums;
}

details.table td,
details.table th {
    padding: 4px 14px 4px 0;
    text-align: left;
    border-bottom: 1px solid var(--grid);
    font-weight: 400;
}

details.table th {
    color: var(--ink-3);
}

.scrolly {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
}

.steps {
    padding: 10vh 0 30vh;
}

.step {
    min-height: 78vh;
    display: flex;
    align-items: center;
}

.step > div {
    padding: 26px 0;
    border-top: 1px solid var(--ink);
    opacity: 0.28;
    transition: opacity 0.5s;
}

.step.on > div {
    opacity: 1;
}

.step h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.05;
}

.step p {
    color: var(--ink-2);
    margin-top: 12px;
}

.sticky {
    position: sticky;
    top: 12vh;
    height: 76vh;
    display: flex;
    align-items: center;
}

.sticky .figure {
    width: 100%;
}

.rhythm-note {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 28px;
}

.rhythm-note div {
    border-top: 1px solid var(--ink);
    padding-top: 12px;
    color: var(--ink-2);
    font-size: 15px;
}

.rhythm-note b {
    display: block;
    color: var(--ink);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.you {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.you-panel {
    position: sticky;
    top: 90px;
}

.you-panel .sentence {
    font-family: var(--serif);
    font-size: 34px;
    line-height: 1.1;
}

.you-panel .sentence b {
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.days {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 22px 0 18px;
}

.days button {
    font: 500 14px var(--sans);
    border: 1px solid var(--grid);
    background: var(--surface-1);
    color: var(--ink);
    padding: 7px 12px;
    border-radius: 99px;
    cursor: pointer;
    transition: 0.2s;
}

.days button[aria-pressed='true'] {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.slider label {
    font-size: 13px;
    color: var(--ink-2);
    display: flex;
    justify-content: space-between;
}

.slider input {
    width: 100%;
    accent-color: var(--series-1);
    margin-top: 6px;
}

.riders {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 4px;
    margin-top: 22px;
}

.riders i {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--grid);
    transition: background 0.3s;
}

.riders i.on {
    background: var(--series-1);
}

.riders-key {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 8px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tile {
    background: var(--surface-1);
    border-radius: 18px;
    padding: 22px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tile .label {
    font-size: 14px;
    color: var(--ink-2);
}

.tile .value {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1;
    margin-top: 18px;
}

.tile .note {
    font-size: 13px;
    color: var(--ink-3);
    margin-top: 10px;
}

.outro {
    padding: 22vh 0 10vh;
    text-align: center;
}

.outro h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(48px, 8vw, 120px);
    line-height: 0.95;
    letter-spacing: -0.02em;
}

.outro h2 em {
    color: var(--series-1);
}

.outro p {
    color: var(--ink-2);
    margin: 26px auto 0;
    max-width: 520px;
}

footer {
    border-top: 1px solid var(--grid);
    padding: 24px clamp(20px, 4vw, 48px) 40px;
    font-size: 13px;
    color: var(--ink-3);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.tip {
    position: fixed;
    pointer-events: none;
    z-index: 60;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    padding: 8px 11px;
    border-radius: 10px;
    line-height: 1.35;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 12px));
    transition: opacity 0.15s;
    white-space: nowrap;
}

.tip b {
    font-weight: 600;
}

.tip .k {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

@media (max-width: 860px) {
    .top nav {
        display: none;
    }

    .scrolly {
        grid-template-columns: 1fr;
    }

    .sticky {
        top: 64px;
        height: auto;
        order: -1;
        z-index: 2;
    }

    .sticky .figure {
        padding: 16px;
    }

    .steps {
        padding-top: 0;
    }

    .step {
        min-height: 70vh;
    }

    .step > div {
        background: rgba(245, 242, 236, 0.94);
        padding: 18px;
        border-radius: 12px;
    }

    .you {
        grid-template-columns: 1fr;
    }

    .you-panel {
        position: static;
    }

    .tiles {
        grid-template-columns: 1fr 1fr;
    }

    .rhythm-note {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none;
        opacity: 1;
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}
