/*
 * Todos website
 *
 * Colors, type and shapes follow the app's design language (Todos-App repo,
 * docs/design/DESIGN.md and tokens.css): the White theme, light only, with the
 * accent red as the brand color. Secondary text is darker than the app's
 * #828282, so running text keeps a contrast of at least 4.5:1 on white and on
 * the grey surface.
 *
 * Motion is progressive: scroll-driven animations run where the browser
 * supports them and "reduce motion" is off. Everywhere else the page shows its
 * final state.
 */

@font-face {
    font-family: "Barlow Semi Condensed";
    src: url("/assets/fonts/barlow-semi-condensed-medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow Semi Condensed";
    src: url("/assets/fonts/barlow-semi-condensed-semibold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;

    --color-bg: #FFFFFF;
    --color-surface: #F5F5F5;
    --color-text: #000000;
    --color-text-secondary: #6B6B6B;
    --color-hairline: #E4E4E4;
    --color-control-line: #CFCFCF;
    --color-accent: #FF3B30;
    --color-success: #34C759;
    --color-success-fill: rgb(52 199 89 / 0.12);
    --color-success-line: rgb(52 199 89 / 0.3);
    --color-black-text: #DEDFE0;
    --color-black-secondary: #9B9B9F;

    --font: "Barlow Semi Condensed", "Barlow", "Arial Narrow", system-ui, sans-serif;

    --radius-swatch: 6px;
    --radius-small: 10px;
    --radius-card: 14px;
    --radius-button: 16px;
    --radius-box: 28px;
    --radius-tile: 40px;
    --radius-capsule: 999px;

    --shadow-float: 0 2px 16px rgb(0 0 0 / 0.08);
    --shadow-icon: drop-shadow(0 6px 14px rgb(0 0 0 / 0.16)) drop-shadow(0 1px 3px rgb(0 0 0 / 0.12));
    --shadow-icon-small: drop-shadow(0 2px 5px rgb(0 0 0 / 0.2)) drop-shadow(0 0 1px rgb(0 0 0 / 0.15));
    --shadow-device: 0 40px 80px -30px rgb(0 0 0 / 0.35), 0 12px 24px -12px rgb(0 0 0 / 0.18);

    --page-max: 1120px;
    --text-max: 680px;
    --gutter: clamp(16px, 4vw, 40px);

    --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

/* ---------- Base ---------- */

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

html {
    background: var(--color-bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font);
    font-weight: 500;
    font-size: clamp(17px, 0.35vw + 15.5px, 19px);
    line-height: 1.45;
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

img {
    height: auto;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    line-height: 1.08;
    text-wrap: balance;
}

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

ul,
ol {
    margin: 0;
}

em {
    font-style: normal;
}

strong {
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.18em;
}

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

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

::selection {
    background: rgb(255 59 48 / 0.18);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Hidden like .visually-hidden until it has keyboard focus. Not pushed above
   the page: Safari's overscroll at the top would show it. */
.skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius-small);
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    background: var(--color-text);
    color: var(--color-bg);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover {
    background: #2A2A2A;
}

.button:active {
    opacity: 0.6;
}

.button--secondary {
    border-color: var(--color-control-line);
    background: var(--color-bg);
    color: var(--color-text);
}

.button--secondary:hover {
    background: var(--color-surface);
}

.button svg {
    width: 20px;
    height: 20px;
    flex: none;
}

/* Apple's "Download on the App Store" badge, unchanged artwork. Apple's
   guidelines: at least 40 px high on screen, clear space of a quarter of its
   height around it, not the dominant element. */
.store-badge {
    --badge-height: 56px;
    display: inline-flex;
    flex: none;
    border-radius: calc(var(--badge-height) * 0.24);
    -webkit-user-select: none;
    user-select: none;
}

/* Clicks go to the link, never to the picture: Safari's Live Text would
   otherwise select the badge's lettering */
.store-badge img {
    display: block;
    width: auto;
    height: var(--badge-height);
    pointer-events: none;
}

/* No account · One-time purchase · No subscription */
.points {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 0;
    list-style: none;
    font-size: 17px;
}

.points li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.points svg {
    width: 18px;
    height: 18px;
    color: var(--color-success);
    flex: none;
}

/* ---------- Language switch ---------- */

.lang {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--radius-capsule);
    background: var(--color-surface);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.lang a,
.lang span {
    display: block;
    min-width: 40px;
    padding: 8px 10px;
    border-radius: var(--radius-capsule);
    color: var(--color-text-secondary);
    text-align: center;
    text-decoration: none;
}

.lang a:hover {
    color: var(--color-text);
}

.lang [aria-current] {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}

/* ---------- Header of the subpages ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 18px var(--gutter);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 600;
    text-decoration: none;
}

.brand img {
    width: 34px;
    height: 34px;
    filter: var(--shadow-icon-small);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 3vw, 28px);
}

.header-nav .nav-link {
    font-size: 17px;
    text-decoration: none;
}

.header-nav .nav-link:hover,
.header-nav .nav-link[aria-current] {
    text-decoration-line: underline;
}

/* ---------- Text pages (support, privacy, legal notice) ---------- */

.doc {
    max-width: calc(var(--text-max) + 2 * var(--gutter));
    margin: 0 auto;
    padding: clamp(28px, 6vw, 72px) var(--gutter) clamp(72px, 10vw, 120px);
}

.doc h1 {
    font-size: clamp(40px, 3.4vw + 26px, 60px);
    letter-spacing: -0.01em;
}

.doc .lead {
    margin-top: 18px;
    color: var(--color-text-secondary);
    font-size: clamp(19px, 0.6vw + 16px, 22px);
    line-height: 1.4;
}

.doc h2 {
    margin: clamp(48px, 6vw, 64px) 0 14px;
    font-size: clamp(25px, 1vw + 21px, 32px);
}

.doc h3 {
    margin: 30px 0 8px;
    font-size: 21px;
}

.doc p + p,
.doc p + ul,
.doc ul + p {
    margin-top: 12px;
}

.doc ul {
    padding-left: 1.15em;
}

.doc li + li {
    margin-top: 6px;
}

.doc li::marker {
    color: var(--color-text-secondary);
}

.doc .updated {
    margin-top: clamp(48px, 6vw, 64px);
    padding-top: 18px;
    border-top: 1px solid var(--color-hairline);
    color: var(--color-text-secondary);
    font-size: 16px;
}

/* Not found: German, then English */
.not-found-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.not-found-other {
    margin-top: clamp(56px, 8vw, 88px);
    padding-top: clamp(40px, 6vw, 56px);
    border-top: 1px solid var(--color-hairline);
}

.not-found h1,
.doc .not-found-other h2 {
    margin: 0;
    font-size: clamp(34px, 2.4vw + 24px, 52px);
}

/* Privacy note: where the data stays (the app's onboarding component) */
.note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding: 16px 18px;
    border: 1px solid var(--color-success-line);
    border-radius: var(--radius-box);
    background: var(--color-success-fill);
    font-size: 19px;
    line-height: 1.4;
}

.note svg {
    width: 26px;
    height: 26px;
    flex: none;
    color: var(--color-success);
}

/* Facts as label and value (legal notice, controller) */
.facts {
    display: grid;
    grid-template-columns: minmax(150px, 0.4fr) 1fr;
    margin: 18px 0 0;
    border-top: 1px solid var(--color-hairline);
}

.facts dt,
.facts dd {
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-hairline);
}

.facts dt {
    padding-right: 16px;
    color: var(--color-text-secondary);
}

.doc .facts + p {
    margin-top: 18px;
}

@media (max-width: 560px) {
    .facts {
        grid-template-columns: 1fr;
    }

    .facts dt {
        padding-bottom: 0;
        border-bottom: 0;
        font-size: 16px;
    }

    .facts dd {
        padding-top: 2px;
    }
}

/* Contact card on the support page */
.contact {
    display: grid;
    gap: 14px;
    margin-top: 36px;
    padding: clamp(20px, 3vw, 28px);
    border-radius: var(--radius-box);
    background: var(--color-surface);
}

.doc .contact-label {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    text-transform: uppercase;
}

.contact-mail {
    font-size: clamp(22px, 1vw + 18px, 27px);
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.contact .button {
    justify-self: start;
    margin-top: 4px;
}

.contact address {
    padding-top: 14px;
    border-top: 1px solid #E2E2E2;
    color: var(--color-text-secondary);
    font-size: 16px;
    font-style: normal;
}

/* Questions */
.faq {
    border-top: 1px solid var(--color-hairline);
}

.faq details {
    border-bottom: 1px solid var(--color-hairline);
}

.faq summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 0;
    font-size: clamp(19px, 0.4vw + 17px, 21px);
    font-weight: 600;
    line-height: 1.25;
    list-style: none;
    cursor: pointer;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    margin-right: 2px;
    background:
        linear-gradient(var(--color-accent), var(--color-accent)) center / 14px 2px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) center / 2px 14px no-repeat;
    transition: transform 0.25s var(--ease-out);
}

.faq details[open] > summary::after {
    transform: rotate(45deg);
}

.faq summary:hover {
    color: #2A2A2A;
}

.faq .answer {
    padding: 0 0 20px;
}

.faq .answer p + p,
.faq .answer p + ul,
.faq .answer ul + p {
    margin-top: 10px;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--color-hairline);
    background: var(--color-bg);
}

.site-footer .inner {
    display: grid;
    gap: 18px;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 28px var(--gutter) 40px;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    padding: 0;
    list-style: none;
    font-size: 16px;
}

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

.footer-links a:hover,
.footer-links a[aria-current] {
    text-decoration-line: underline;
}

.footer-legal {
    display: grid;
    gap: 4px;
}

/* ---------- Home ---------- */

/* Bar that appears once the hero has scrolled away */
.bar {
    display: none;
}

.hero {
    position: relative;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: clamp(84px, 9vw, 120px) var(--gutter) clamp(40px, 6vw, 72px);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: stretch;
    gap: clamp(32px, 5vw, 72px);
}

.hero-lang {
    position: absolute;
    top: 18px;
    right: var(--gutter);
}

/* Icon and name in one row at the height of the phone's top edge, the copy
   centered in the space below */
.hero-text {
    display: flex;
    flex-direction: column;
}

.hero-app {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-icon {
    width: clamp(76px, 3vw + 52px, 92px);
    height: auto;
    filter: var(--shadow-icon);
}

.hero-name {
    font-size: clamp(26px, 0.8vw + 21px, 32px);
    font-weight: 600;
    line-height: 1.1;
}

.hero-copy {
    margin-block: auto;
    padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 40px);
}

.hero h1 {
    font-size: clamp(44px, 4.2vw + 24px, 86px);
    line-height: 1;
    letter-spacing: -0.015em;
}

.hero h1 .accent {
    color: var(--color-accent);
}

.hero-sub {
    margin-top: 22px;
    color: var(--color-text-secondary);
    font-size: clamp(20px, 0.8vw + 17px, 27px);
    line-height: 1.3;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    margin-top: 36px;
}

.hero-media {
    justify-self: center;
    align-self: start;
    width: min(100%, 360px);
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        text-align: center;
    }

    .hero-app {
        flex-direction: column;
        gap: 14px;
    }

    .hero-copy {
        padding-block: 28px 8px;
    }

    .hero-actions,
    .hero .points {
        justify-content: center;
    }

    .hero-media {
        width: min(78%, 330px);
    }
}

/* iPhone frame around a screenshot: Apple's silver iPhone 18 Pro bezel (app repo,
   Design/AppStore/Bezels/PNG/iPhone 18 Pro), scaled uniformly, never altered.
   The artwork is 1350 × 2760 with a transparent 1206 × 2622 screen at (72, 69),
   so the screen sits 5.333 % from the sides and 5.111 % from the top and bottom
   of the frame's width, and has a screen width of 89.333 %. The screen's
   corners (about 15.5 %) are cut so nothing pokes out below the bezel's rim.
   The screenshots are the website's own set from an iPhone 17 Pro, 1206 × 2622
   (docs/SCREENSHOTS.md). The bezel is drawn over the screen from its top edge,
   so a phone cut off by a tile shows the screen's content, then the frame ends. */
.device {
    container-type: inline-size;
    width: 100%;
}

.device-frame {
    position: relative;
    padding: 5.1111cqw 5.3333cqw;
    filter: drop-shadow(0 9.375cqw 9.375cqw rgb(0 0 0 / 0.2)) drop-shadow(0 1.875cqw 2.34cqw rgb(0 0 0 / 0.1));
}

.device-frame img {
    display: block;
    width: 100%;
    aspect-ratio: 1206 / 2622;
    border-radius: 15.5cqw;
    background: var(--color-bg);
}

.device-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: url("/assets/img/iphone-silver.webp") top / 100% auto no-repeat;
    pointer-events: none;
}

/* Section heads */
.section-head {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    text-align: center;
}

.eyebrow {
    color: var(--color-text-secondary);
    font-size: 17px;
    text-transform: uppercase;
}

.section-head h2 {
    margin-top: 8px;
    font-size: clamp(38px, 3.4vw + 22px, 68px);
    letter-spacing: -0.012em;
}

.section-head p {
    margin-top: 18px;
    color: var(--color-text-secondary);
    font-size: clamp(19px, 0.6vw + 16px, 23px);
    line-height: 1.4;
}

/* The idea: Today, Tomorrow, Later */
.idea {
    padding: clamp(64px, 8vw, 112px) 0 clamp(88px, 10vw, 140px);
}

.trio {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 3vw, 40px);
    max-width: 1000px;
    margin: clamp(48px, 6vw, 72px) auto 0;
    padding: 0 var(--gutter);
    list-style: none;
}

.trio li {
    display: grid;
    align-content: start;
    gap: 22px;
}

.trio .device {
    width: min(100%, 290px);
    justify-self: center;
}

.trio h3 {
    font-size: clamp(24px, 1vw + 19px, 30px);
}

.trio p {
    margin-top: 6px;
    color: var(--color-text-secondary);
}

.idea-text {
    max-width: 290px;
    justify-self: center;
    text-align: center;
}

/* On phones the three pages sit side by side and swipe, like in the app */
@media (max-width: 760px) {
    .trio {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 var(--gutter);
        padding-bottom: 12px;
        scrollbar-width: none;
    }

    .trio::-webkit-scrollbar {
        display: none;
    }

    .trio li {
        flex: 0 0 min(76%, 300px);
        scroll-snap-align: center;
    }

    .trio .device {
        width: 100%;
    }
}

/* Features as tiles */
.features {
    padding: clamp(88px, 10vw, 140px) 0;
    background: var(--color-surface);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 24px);
    max-width: var(--page-max);
    margin: clamp(48px, 6vw, 72px) auto 0;
    padding: 0 var(--gutter);
}

.tile {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(28px, 4vw, 56px);
    padding: clamp(32px, 5vw, 64px);
    overflow: hidden;
    border-radius: var(--radius-tile);
    background: var(--color-bg);
}

.tile h3 {
    font-size: clamp(32px, 2.4vw + 20px, 52px);
    letter-spacing: -0.01em;
}

.tile h3 em {
    color: var(--color-accent);
}

.tile-text p {
    margin-top: 16px;
    max-width: 460px;
    color: var(--color-text-secondary);
    font-size: clamp(19px, 0.4vw + 17px, 21px);
    line-height: 1.42;
}

.tile-text .link {
    display: inline-block;
    margin-top: 18px;
    font-weight: 600;
}

/* A phone standing on the tile's bottom edge, cut off by it. Only where the cut
   runs through the screen's content; a screen whose own bottom shows (like a
   sheet with rounded corners) gets the whole phone, .tile-phone--whole. */
.tile-phone {
    align-self: end;
    justify-self: center;
    width: min(100%, 330px);
    margin-bottom: calc(-1 * clamp(32px, 5vw, 64px));
}

.tile-phone--whole {
    align-self: center;
    width: min(100%, 300px);
    margin-bottom: 0;
}

.tile-phone:not(.tile-phone--whole) .device-frame {
    padding-bottom: 0;
}

.tile-phone:not(.tile-phone--whole) .device-frame img {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tile-phone.crop .device-frame img {
    aspect-ratio: 1206 / 1900;
    object-fit: cover;
    object-position: top;
}

.tile--flip .tile-text {
    order: 2;
}

.tile--center {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
}

.tile--center .tile-text p {
    margin-left: auto;
    margin-right: auto;
}

/* Half tiles: text on top, the picture standing on the bottom edge */
.tile--half {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.tile--half .tile-phone,
.tile--half .themes {
    align-self: center;
    margin-top: auto;
}

.tile--black {
    background: #000;
    color: var(--color-black-text);
}

.tile--black .tile-text p {
    color: var(--color-black-secondary);
}

@media (max-width: 860px) {
    .tiles {
        grid-template-columns: minmax(0, 1fr);
    }

    .tile,
    .tile--half {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    .tile--flip .tile-text {
        order: 0;
    }

    .tile-phone {
        width: min(82%, 320px);
    }
}

/* Tile: pull down, hold, done (built from the app's card) */
.demo {
    display: grid;
    justify-items: center;
    width: 100%;
}

.demo-list {
    display: grid;
    gap: 10px;
    width: min(100%, 380px);
    justify-self: center;
    padding: 0;
    list-style: none;
}

.demo-pull {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-bottom: 6px;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.demo-pull svg {
    width: 22px;
    height: 22px;
}

.demo-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 10px 14px;
    overflow: hidden;
    border-radius: var(--radius-button);
    background: var(--color-surface);
    font-size: 17px;
    line-height: 1.25;
}

.demo-card small {
    display: block;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* The app's 2 × 2 grip (DragHandleIcon.swift): 3.5 pt dots, 4 pt apart */
.demo-card .grip {
    width: 11px;
    height: 11px;
    flex: none;
    background: radial-gradient(circle, #C4C4C4 1.75px, transparent 2px) -2px -2px / 7.5px 7.5px;
}

.demo-card--hold {
    background: var(--color-surface);
}

/* The completion ring: a green outline that closes around the card */
.demo-ring {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-button);
    border: 2px solid var(--color-success);
    opacity: 1;
    -webkit-mask: conic-gradient(#000 0deg, #000 360deg) border-box;
    mask: conic-gradient(#000 0deg, #000 360deg) border-box;
    pointer-events: none;
}

.demo-card--hold .demo-fill {
    position: absolute;
    inset: 0;
    background: var(--color-success-fill);
    pointer-events: none;
}

.demo-check {
    width: 22px;
    height: 22px;
    flex: none;
    color: var(--color-success);
}

/*
 * Tile: the timeline while a task is dragged, rebuilt from the app
 * (TimelineDragOverlay.swift). Every measure is in iOS points of the 402 pt
 * wide iPhone 17 Pro screen: --pt is one point at the phone's current size.
 * --type is the text size of the screenshots, one Dynamic Type step above the
 * default (XL: body text 17 → 19 pt). Text that follows Dynamic Type in iOS
 * takes it; the status bar doesn't.
 */
.screen {
    --pt: calc(89.3333cqw / 402);
    --type: calc(19 / 17);
    position: relative;
    width: 100%;
    aspect-ratio: 1206 / 2622;
    overflow: hidden;
    border-radius: 15.5cqw;
    background: #FFFFFF;
    color: #000000;
    font-size: calc(var(--pt) * 16 * var(--type));
    line-height: 1.2;
}

.tile-phone.crop .screen {
    aspect-ratio: 1206 / 1900;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.screen > *,
.tl-hours > li {
    position: absolute;
    margin: 0;
}

.statusbar {
    top: calc(var(--pt) * 18);
    left: calc(var(--pt) * 38);
    right: calc(var(--pt) * 26);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: calc(var(--pt) * 17);
    font-weight: 600;
}

.statusbar svg {
    width: calc(var(--pt) * 78);
}

.tl-zone {
    top: calc(var(--pt) * 70);
    left: calc(var(--pt) * 16);
    right: calc(var(--pt) * 16);
    height: calc(var(--pt) * 36);
    display: flex;
    align-items: center;
    padding-left: calc(var(--pt) * 12);
    border: 1px dashed rgb(130 130 130 / 0.5);
    border-radius: calc(var(--pt) * 10);
    color: #828282;
    font-size: calc(var(--pt) * 14 * var(--type));
}

.tl-hours {
    inset: 0;
    padding: 0;
    list-style: none;
}

.tl-hour {
    left: calc(var(--pt) * 8);
    width: calc(var(--pt) * 56);
    color: #828282;
    font-size: calc(var(--pt) * 14 * var(--type));
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transform: translateY(-50%);
}

.tl-r0 { top: calc(var(--pt) * 150); }
.tl-r1 { top: calc(var(--pt) * 194); }
.tl-r2 { top: calc(var(--pt) * 238); }
.tl-r3 { top: calc(var(--pt) * 282); }
.tl-r5 { top: calc(var(--pt) * 370); }
.tl-r6 { top: calc(var(--pt) * 414); }
.tl-r7 { top: calc(var(--pt) * 458); }
.tl-r8 { top: calc(var(--pt) * 502); }
.tl-r9 { top: calc(var(--pt) * 546); }
.tl-r10 { top: calc(var(--pt) * 590); }

/* Now: 9:41 */
.tl-now {
    top: calc(var(--pt) * 135.5);
    left: calc(var(--pt) * 73);
    right: calc(var(--pt) * 16);
    height: 1px;
    background: rgb(255 59 48 / 0.35);
}

.tl-now::before {
    content: "";
    position: absolute;
    top: calc(var(--pt) * -3 + 0.5px);
    left: 0;
    width: calc(var(--pt) * 6);
    height: calc(var(--pt) * 6);
    border-radius: 50%;
    background: #FF3B30;
}

/* Events as bars from start to end, in the calendar's color: the sample data's
   Personal (pastel green), the first one Work (pastel blue) */
.tl-event {
    left: calc(var(--pt) * 74.5);
    width: calc(var(--pt) * 3);
    border-radius: calc(var(--pt) * 1.5);
    background: #75D3A1;
}

.tl-event-1 {
    background: #74A2FF;
}

.tl-event-1 { top: calc(var(--pt) * 150); height: calc(var(--pt) * 44); }
.tl-event-2 { top: calc(var(--pt) * 260); height: calc(var(--pt) * 44); }
.tl-event-3 { top: calc(var(--pt) * 392); height: calc(var(--pt) * 33); }
.tl-event-4 { top: calc(var(--pt) * 524); height: calc(var(--pt) * 44); }

/* The page's other tasks as small boxes at their time */
.tl-box {
    left: calc(var(--pt) * 88);
    width: calc(var(--pt) * 12);
    height: calc(var(--pt) * 12);
    border: 1.5px solid #828282;
    border-radius: calc(var(--pt) * 3.5);
}

.tl-box-1 { top: calc(var(--pt) * 210); }
.tl-box-2 { top: calc(var(--pt) * 452); }

.tl-box-zone {
    position: absolute;
    top: 50%;
    left: auto;
    right: calc(var(--pt) * 8);
    transform: translateY(-50%);
}

.tl-box-own {
    top: calc(var(--pt) * 320);
    border-color: #FF3B30;
    background: #FF3B30;
}

/* The chosen time: capsule, line, card. The 56 pt column of the hours and the
   capsule stays centered, and both take a longer time on one line */
.tl-pick {
    top: calc(var(--pt) * 315);
    left: calc(var(--pt) * 36);
    min-width: calc(var(--pt) * 56);
    height: calc(var(--pt) * 22);
    padding: 0 calc(var(--pt) * 6);
    translate: -50% 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-capsule);
    background: #FF3B30;
    color: #FFFFFF;
    font-size: calc(var(--pt) * 15 * var(--type));
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tl-line {
    top: calc(var(--pt) * 325);
    left: calc(var(--pt) * 64);
    width: calc(var(--pt) * 58);
    height: calc(var(--pt) * 2);
    background: rgb(255 59 48 / 0.5);
}

.tl-card {
    top: calc(var(--pt) * 300);
    left: calc(var(--pt) * 122);
    right: calc(var(--pt) * 16);
    height: calc(var(--pt) * 52);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: calc(var(--pt) * 2);
    padding: 0 calc(var(--pt) * 14);
    border: calc(var(--pt) * 1.5) solid #FF3B30;
    border-radius: calc(var(--pt) * 14);
    background: #F5F5F5;
    box-shadow: 0 calc(var(--pt) * 4) calc(var(--pt) * 16) rgb(0 0 0 / 0.12);
    white-space: nowrap;
}

.tl-card b {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
}

.tl-card > span {
    color: #828282;
    font-size: calc(var(--pt) * 14 * var(--type));
    font-variant-numeric: tabular-nums;
}

.tl-card em {
    color: #FF3B30;
    font-weight: 600;
}

/* Tile: available everywhere. Shortcuts, Spotlight and the controls, drawn as
   three small cards (the store image's version, in the site's design) */
.ev-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 24px);
    width: 100%;
    margin-top: clamp(12px, 2vw, 24px);
    text-align: left;
}

.ev-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(18px, 2vw, 24px);
    border-radius: var(--radius-box);
    background: var(--color-surface);
}

.ev-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.15;
}

.ev-glyph {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--color-accent);
}

.ev-actions,
.ev-controls {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ev-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ev-actions li {
    display: flex;
    align-items: flex-end;
    min-height: 68px;
    padding: 10px 14px;
    border-radius: var(--radius-button);
    background: var(--color-bg);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.1;
}

.ev-search,
.ev-result {
    margin: 0;
}

.ev-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-capsule);
    background: var(--color-bg);
    font-size: 20px;
}

.ev-search-icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
}

.ev-result {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 19px;
    line-height: 1.2;
}

.ev-result img {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 11px;
}

.ev-result b,
.ev-result small {
    display: block;
}

.ev-result b {
    font-weight: 600;
}

.ev-result small {
    color: var(--color-text-secondary);
    font-size: 17px;
}

.ev-controls {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 3vw, 36px);
}

.ev-controls li {
    display: grid;
    justify-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
}

.ev-button {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.ev-icon {
    width: 36px;
    height: 36px;
}

@media (max-width: 860px) {
    .ev-cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Tile: your look. The four themes, the automatic mode, the accent colors.
   The app's own icons, set in the site's chips instead of its Settings tiles */
.look {
    max-width: 420px;
}

.look-label {
    margin: 28px 0 10px;
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
}

.look-themes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    list-style: none;
}

/* Each theme in its own colors (DESIGN.md): White and Light by their page
   background, Dark by its sheet, so it stands apart from Black */
.look-themes li,
.look-auto {
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-card);
    background: var(--color-bg);
    font-size: 16px;
    line-height: 1.2;
}

.look-themes li {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    padding: 14px 4px 12px;
    text-align: center;
}

/* "Schwarz" no longer fits a quarter of the smallest phones */
@media (max-width: 359px) {
    .look-themes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.look-themes .look-light {
    background: var(--color-surface);
}

.look-themes .look-dark {
    border-color: #2A2F36;
    background: #1C1F24;
    color: var(--color-black-text);
}

.look-themes .look-black {
    border-color: #000;
    background: #000;
    color: var(--color-black-text);
}

.look-auto {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 12px 16px;
}

.look-themes img,
.look-auto img {
    width: 28px;
    height: 28px;
    flex: none;
}

.look-auto span {
    color: var(--color-text-secondary);
}

.look-auto b {
    color: var(--color-text);
    font-weight: 600;
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    list-style: none;
}

.swatches li {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-swatch);
}

.swatch-red {
    background: #FF3B30;
}

.swatch-orange {
    background: #FF692E;
}

.swatch-yellow {
    background: #FDBA17;
}

.swatch-green {
    background: #2BBB6E;
}

.swatch-blue {
    background: #2970FF;
}

.swatch-violet {
    background: #875BF7;
}

/* Three phones in different themes, standing on the tile's bottom edge */
.themes {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    align-self: end;
    width: 100%;
    margin-top: 32px;
    margin-bottom: calc(-1 * clamp(32px, 5vw, 64px));
}

.themes .device {
    width: 46%;
    margin: 0 -9%;
}

.themes .device:nth-child(2) {
    position: relative;
    z-index: 1;
    width: 56%;
}

.themes .device-frame {
    padding-bottom: 0;
    filter: drop-shadow(0 12px 14px rgb(0 0 0 / 0.25));
}

.themes .device-frame img {
    aspect-ratio: 1206 / 2150;
    object-fit: cover;
    object-position: top;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Tile: your data. Three chips of equal width, side by side or stacked */
.promises {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 12px;
    width: fit-content;
    margin: 32px auto 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 860px) {
    .promises {
        grid-auto-flow: row;
    }
}

.promises li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid var(--color-success-line);
    border-radius: var(--radius-button);
    background: var(--color-success-fill);
    font-size: 18px;
}

.promises svg {
    width: 22px;
    height: 22px;
    color: var(--color-success);
}

/* Questions */
.questions {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: clamp(80px, 9vw, 120px) var(--gutter);
    text-align: center;
}

.questions h2 {
    font-size: clamp(38px, 3.4vw + 22px, 64px);
}

.questions p {
    max-width: 560px;
    margin: 16px auto 0;
    color: var(--color-text-secondary);
    font-size: clamp(19px, 0.6vw + 16px, 22px);
}

.questions .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

/*
 * Closing: the App Store product page header (Design/AppStore/Kopfbild-21x9 in
 * the app repo), scaled. --u is one pixel of the 3840 px wide header; the row
 * of cards is 2480 px wide there, plus room for the tilted Later card.
 */
.closing {
    padding: clamp(72px, 9vw, 120px) var(--gutter) clamp(80px, 10vw, 140px);
    background: var(--color-surface);
}

.banner {
    --u: calc(100cqw / 2640);
    container-type: inline-size;
    max-width: 1040px;
    margin: 0 auto;
    text-align: center;
}

.banner-mark {
    font-size: max(52px, calc(var(--u) * 260));
    font-weight: 600;
    line-height: 1;
    letter-spacing: calc(var(--u) * -4);
}

.banner-line {
    margin-top: calc(var(--u) * 30);
    color: var(--color-accent);
    font-size: max(21px, calc(var(--u) * 110));
    font-weight: 500;
    line-height: 1.15;
}

.banner-cards {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: calc(var(--u) * 100);
    margin: calc(var(--u) * 140) 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.banner-cards li {
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 30);
    width: calc(var(--u) * 760);
    padding: calc(var(--u) * 64);
    border-radius: calc(var(--u) * 80);
    background: #FFFFFF;
    box-shadow: 0 calc(var(--u) * 50) calc(var(--u) * 100) rgb(0 0 0 / 0.1), 0 calc(var(--u) * 10) calc(var(--u) * 30) rgb(0 0 0 / 0.05);
}

.banner-cards .tilt {
    transform: translate(calc(var(--u) * 40), calc(var(--u) * 36)) rotate(4deg);
}

.banner-cards b {
    font-size: calc(var(--u) * 88);
    font-weight: 600;
    line-height: 1.15;
    text-transform: uppercase;
}

.banner-cards .dim {
    color: #828282;
}

.banner-cards span {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: calc(var(--u) * 16);
    height: calc(var(--u) * 120);
    padding: 0 calc(var(--u) * 44);
    border-radius: calc(var(--u) * 40);
    background: var(--color-surface);
}

.banner-cards i {
    display: block;
    height: calc(var(--u) * 22);
    border-radius: calc(var(--u) * 11);
    background: #C7C7CC;
}

.banner-cards i.meta {
    width: 22%;
    height: calc(var(--u) * 18);
    border-radius: calc(var(--u) * 9);
    background: #AEAEB2;
}

.banner-cards i.accent {
    background: var(--color-accent);
}

.banner-cards .w55 { width: 55%; }
.banner-cards .w58 { width: 58%; }
.banner-cards .w64 { width: 64%; }
.banner-cards .w70 { width: 70%; }
.banner-cards .w72 { width: 72%; }
.banner-cards .w80 { width: 80%; }

.banner-actions {
    display: flex;
    justify-content: center;
    margin-top: max(36px, calc(var(--u) * 150));
}

/* ---------- Continuous corners ---------- */

/* The app's corners are continuous (squircles). Browsers that support
   corner-shape draw them too; a squircle looks smaller than a circular corner
   of the same radius, so the radii grow with it. Others keep round corners. */
@supports (corner-shape: squircle) {
    :root {
        --radius-card: 20px;
        --radius-button: 22px;
        --radius-box: 40px;
        --radius-tile: 56px;
    }

    .button,
    .contact,
    .note,
    .promises li,
    .tile,
    .demo-card,
    .demo-ring,
    .look-themes li,
    .look-auto {
        corner-shape: squircle;
    }
}

/* ---------- Motion ---------- */

/* How far the completion ring has closed; animated below */
@property --ring {
    syntax: "<angle>";
    inherits: false;
    initial-value: 360deg;
}

@media (prefers-reduced-motion: no-preference) {
    .hero > * {
        animation: hero-in 0.9s var(--ease-out) both;
    }

    .hero-media {
        animation-delay: 0.12s;
    }

    @keyframes hero-in {
        from {
            opacity: 0;
            transform: translateY(18px);
        }
    }

    @supports (animation-timeline: view()) {
        .reveal {
            animation: reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 60%;
        }

        @keyframes reveal {
            from {
                opacity: 0;
                transform: translateY(36px);
            }
        }

        /* Today and Later fan out from behind Tomorrow (side by side only) */
        @media (min-width: 761px) {
            .trio li:nth-child(2) {
                position: relative;
                z-index: 1;
            }

            .trio li:first-child .device {
                animation: fan-left linear both;
                animation-timeline: view();
                animation-range: entry 10% cover 40%;
            }

            .trio li:last-child .device {
                animation: fan-right linear both;
                animation-timeline: view();
                animation-range: entry 10% cover 40%;
            }
        }

        @media (max-width: 760px) {
            .trio {
                animation: reveal linear both;
                animation-timeline: view();
                animation-range: entry 0% entry 40%;
            }
        }

        @keyframes fan-left {
            from {
                transform: translateX(60%) scale(0.9);
                opacity: 0.4;
            }
        }

        @keyframes fan-right {
            from {
                transform: translateX(-60%) scale(0.9);
                opacity: 0.4;
            }
        }

        /* Hold to complete: the ring closes, the card turns green, the check appears */
        .demo-card--hold .demo-ring {
            animation: ring-close linear both;
            animation-timeline: view();
            animation-range: cover 20% cover 50%;
        }

        .demo-card--hold .demo-fill,
        .demo-card--hold .demo-check {
            animation: done-in linear both;
            animation-timeline: view();
            animation-range: cover 50% cover 56%;
        }

        .demo-card--hold .demo-ring {
            -webkit-mask: conic-gradient(#000 var(--ring), transparent 0) border-box;
            mask: conic-gradient(#000 var(--ring), transparent 0) border-box;
        }

        @keyframes ring-close {
            from {
                --ring: 0deg;
            }
            to {
                --ring: 360deg;
            }
        }

        @keyframes done-in {
            from {
                opacity: 0;
            }
        }

        /* Timeline: the task travels from No Time to 2:00 PM */
        .tl-card {
            animation: tl-drag linear both;
            animation-timeline: view();
            animation-range: cover 10% cover 42%;
        }

        .tl-pick,
        .tl-line,
        .tl-box-own {
            animation: done-in linear both;
            animation-timeline: view();
            animation-range: cover 34% cover 42%;
        }

        @keyframes tl-drag {
            from {
                transform: translateY(calc(var(--pt) * -232));
            }
        }

        /* Closing: the three cards rise in, Later last */
        .banner-cards li {
            animation: page-in linear both;
            animation-timeline: view();
        }

        .banner-cards li:nth-child(1) {
            animation-range: entry 10% cover 30%;
        }

        .banner-cards li:nth-child(2) {
            animation-range: entry 20% cover 36%;
        }

        .banner-cards li:nth-child(3) {
            animation-range: entry 30% cover 42%;
        }

        @keyframes page-in {
            from {
                opacity: 0;
                translate: 0 40px;
            }
        }
    }
}

/* The bar needs a scroll timeline of the hero; without one it stays hidden */
@supports (animation-timeline: view()) and (timeline-scope: --hero) {
    body.home {
        timeline-scope: --hero;
    }

    .hero {
        view-timeline: --hero block;
    }

    .bar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 50;
        display: block;
        border-bottom: 1px solid rgb(0 0 0 / 0.08);
        background: rgb(255 255 255 / 0.82);
        -webkit-backdrop-filter: saturate(1.8) blur(20px);
        backdrop-filter: saturate(1.8) blur(20px);
        visibility: hidden;
        animation: bar-in linear both;
        animation-timeline: --hero;
        animation-range: exit 55% exit 75%;
    }

    @keyframes bar-in {
        from {
            opacity: 0;
            transform: translateY(-100%);
            visibility: hidden;
        }
        to {
            opacity: 1;
            transform: none;
            visibility: visible;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        @keyframes bar-in {
            from {
                opacity: 0;
                visibility: hidden;
            }
            to {
                opacity: 1;
                visibility: visible;
            }
        }
    }
}

.bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 10px var(--gutter);
}

.bar .brand {
    font-size: 19px;
}

.bar .brand img {
    width: 30px;
    height: 30px;
}

.bar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bar .store-badge {
    --badge-height: 40px;
}

@media (max-width: 420px) {
    .bar .lang {
        display: none;
    }
}
