@font-face {
    font-family: "Fraunces";
    src: url("/fonts/fraunces.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Hanken Grotesk";
    src: url("/fonts/hanken-grotesk.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

/* dawn in light mode, dusk in dark mode */
:root {
    color-scheme: light dark;

    --ground: light-dark(#f8ebe6, #1c1320);
    --glow: light-dark(#fbd6c0, #45203b);
    --paper: light-dark(#fff8f4, #281b2b);
    --field: light-dark(#fffdfb, #1f1523);
    --ink: light-dark(#3a2236, #f6e6df);
    --ink-soft: light-dark(#6a4f64, #cfb6c2);
    --accent-text: light-dark(#8a4a08, #f6c47a);
    --sun: light-dark(#eda43f, #f2b153);
    --sun-core: #ffdc95;
    --rose: light-dark(#eeb2a8, #b8707f);
    --line: light-dark(rgb(58 34 54 / 0.14), rgb(246 230 223 / 0.16));
    --on-sun: #3a2236;
    --shadow: 0 1.75rem 3.5rem -2rem light-dark(rgb(120 50 70 / 0.45), rgb(0 0 0 / 0.7));

    --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
    --sans: "Hanken Grotesk", Seravek, "Gill Sans Nova", Ubuntu, Calibri, sans-serif;
    --measure: 36rem;
    --gutter: clamp(1.25rem, 5vw, 2rem);
}

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

* {
    margin: 0;
}

html {
    background-color: var(--ground);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 106.25%;
    font-weight: 360;
    font-variation-settings: "SOFT" 100, "WONK" 0;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    min-height: 100vh;
    background: radial-gradient(150% 34rem at 50% -8rem, var(--glow), transparent 75%) no-repeat;
    padding: 0 var(--gutter) max(3rem, env(safe-area-inset-bottom));
}

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

h1,
h2 {
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.6rem, 11vw, 4.4rem);
}

h2 {
    font-size: clamp(1.75rem, 6vw, 2.2rem);
    margin-block-end: 1.25rem;
}

p,
li {
    text-wrap: pretty;
}

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

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--accent-text);
    outline-offset: 3px;
    border-radius: 0.4rem;
}

/* chrome, not content: a long press or a drag never selects the sun, a button, a chip or a card link */
.breath,
.topbar a,
.button,
.chips label,
.price,
.links a,
.door,
.footer a {
    -webkit-user-select: none;
    user-select: none;
}

.page {
    max-width: var(--measure);
    margin-inline: auto;
}

.page > section {
    margin-block-start: 4.5rem;
}

.page > section p + p {
    margin-block-start: 1rem;
}

.soft {
    color: var(--ink-soft);
}

.topbar {
    padding-block: 1.25rem 0;
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.topbar a {
    color: var(--ink);
    text-decoration: none;
}

/* the hero: a sun that breathes, 4 s in and 6 s out */
.hero {
    display: grid;
    justify-items: center;
    gap: 1rem;
    padding-block: 2rem 0;
    text-align: center;
}

.hero__lead {
    max-width: 26rem;
    font-size: 1.25rem;
    color: var(--ink-soft);
}

.breath {
    display: grid;
    place-items: center;
    width: min(62vw, 16rem);
    aspect-ratio: 1;
    margin-block-end: 0.5rem;
}

.breath > * {
    grid-area: 1 / 1;
}

.breath__sun {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(
        circle at 50% 42%,
        var(--sun-core) 0 16%,
        var(--sun) 45%,
        color-mix(in oklab, var(--rose) 75%, transparent) 62%,
        transparent 70.5%
    );
    scale: 0.92;
}

.breath__cue {
    position: relative;
    display: grid;
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--on-sun);
}

.breath__cue span {
    grid-area: 1 / 1;
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .breath__sun {
        animation: breathe 10s infinite;
    }

    .breath__cue span:first-child {
        animation: cue-in 10s infinite;
    }

    .breath__cue span:last-child {
        animation: cue-out 10s infinite;
    }
}

@keyframes breathe {
    0% {
        scale: 0.78;
        animation-timing-function: cubic-bezier(0.45, 0, 0.4, 1);
    }
    40% {
        scale: 1;
        animation-timing-function: cubic-bezier(0.45, 0, 0.4, 1);
    }
    100% {
        scale: 0.78;
    }
}

@keyframes cue-in {
    0%,
    37%,
    100% {
        opacity: 0;
    }
    6%,
    31% {
        opacity: 0.85;
    }
}

@keyframes cue-out {
    0%,
    40%,
    97%,
    100% {
        opacity: 0;
    }
    47%,
    88% {
        opacity: 0.85;
    }
}

.status {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    max-width: 28rem;
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink-soft);
    text-align: start;
}

.status::before {
    content: "";
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--rose);
    translate: 0 0.05rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.75rem 1.6rem;
    border: 0;
    border-radius: 999px;
    background: var(--sun);
    color: var(--on-sun);
    font: 600 1rem / 1.2 var(--sans);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0.75rem 1.5rem -1rem rgb(160 80 20 / 0.7);
    transition: background-color 0.2s, translate 0.2s;
}

.button:hover {
    background: color-mix(in oklab, var(--sun) 80%, var(--sun-core));
    translate: 0 -1px;
}

.button:disabled {
    opacity: 0.7;
    cursor: progress;
    translate: none;
}

.hero .button {
    margin-block-start: 0.75rem;
}

/* the one panel on the page: the signup letter */
.letter {
    padding: clamp(1.5rem, 6vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: 1.75rem;
    background: var(--paper);
    box-shadow: var(--shadow);
    scroll-margin-block-start: 1.5rem;
}

.signup {
    display: grid;
    gap: 1.25rem;
    margin-block-start: 1.5rem;
}

/* without JavaScript the form would put the email in the page address */
html:not(.js) .signup {
    display: none;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label,
.topics legend {
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 600;
}

.field input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--field);
    color: var(--ink);
    font: 400 1.0625rem / 1.3 var(--sans);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
    outline: none;
    border-color: var(--sun);
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--sun) 35%, transparent);
}

.topics {
    border: 0;
    padding: 0;
    min-width: 0;
}

.topics legend {
    padding: 0;
    margin-block-end: 0.6rem;
}

.topics legend span {
    font-weight: 400;
    color: var(--ink-soft);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    list-style: none;
}

.chips input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chips label {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field);
    font: 500 0.95rem / 1.2 var(--sans);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.chips input:checked + label {
    border-color: var(--sun);
    background: color-mix(in oklab, var(--sun) 30%, var(--field));
}

.chips input:checked + label::before {
    content: "";
    width: 0.45rem;
    height: 0.75rem;
    margin-inline-end: 0.55rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    rotate: 45deg;
    translate: 0 -0.1rem;
}

.chips input:focus-visible + label {
    outline: 3px solid var(--accent-text);
    outline-offset: 2px;
}

.signup .button {
    justify-self: start;
}

.signup__status {
    font-family: var(--sans);
    font-size: 0.95rem;
    min-height: 1.5em;
}

.signup__status:empty {
    display: none;
}

.signup__status[data-tone="error"] {
    color: light-dark(#a3302a, #ff9d8f);
}

.fineprint {
    font-family: var(--sans);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

.signup__done {
    margin-block-start: 1.5rem;
    font-size: 1.15rem;
}

.signup__done:focus {
    outline: none;
}

.signup__done strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 420;
    margin-block-end: 0.4rem;
}

.honeypot {
    position: absolute;
    left: -5000px;
}

/* the prices */
.prices {
    display: grid;
    margin-block-start: 1.25rem;
    padding: 0;
    list-style: none;
    border-block-start: 1px solid var(--line);
}

.price {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.15rem 1rem;
    padding-block: 1rem;
    border-block-end: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

.price__name {
    font-size: 1.3rem;
    font-weight: 420;
    line-height: 1.25;
}

.price__amount {
    font-size: 1.3rem;
    font-weight: 420;
    text-align: end;
    font-variant-numeric: lining-nums;
}

.price__amount small {
    display: block;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--ink-soft);
}

.price__desc {
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.price__cta {
    grid-column: 2;
    justify-self: end;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 600;
}

a.price:not(.is-paused) .price__cta {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: var(--sun);
    color: var(--on-sun);
}

a.price:not(.is-paused):hover .price__cta {
    background: color-mix(in oklab, var(--sun) 80%, var(--sun-core));
}

.price.is-paused {
    pointer-events: none;
}

.price.is-paused .price__cta {
    font-weight: 500;
    color: var(--ink-soft);
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0;
    list-style: none;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.9rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font: 500 1rem / 1.2 var(--sans);
    text-decoration: none;
}

.links a:hover {
    border-color: var(--sun);
}

.links svg {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
}

.footer {
    max-width: var(--measure);
    margin: 5rem auto 0;
    padding-block-start: 1.5rem;
    border-block-start: 1px solid var(--line);
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--ink-soft);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.footer a {
    color: inherit;
}

/* the home page */
.home {
    font-size: 1.2rem;
}

.home > section {
    margin-block-start: 2.5rem;
}

.home > .photo,
.home > .photo + section {
    margin-block-start: 3.5rem;
}

.photo figure {
    display: grid;
    gap: 0.75rem;
}

.photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 1.25rem;
    background-color: color-mix(in oklab, currentColor 10%, transparent);
    box-shadow: var(--shadow);
}

.photo figcaption {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--ink-soft);
}

.door {
    display: grid;
    gap: 0.2rem;
    margin-block-start: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow);
}

.door:hover {
    border-color: var(--sun);
}

.door__title {
    font-size: 1.4rem;
    font-weight: 420;
}

.door__note {
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink-soft);
}
