/*
  ibyteapps.com — one stylesheet, no build step.

  Modern CSS doing the work a framework used to: light-dark() for the two themes,
  native nesting, color-mix() for every tint, container queries for the cards,
  scroll-driven reveals, and cross-document view transitions (an app's icon flies
  from its card into its page). Everything degrades to a plain, readable page in
  an older browser, and every movement stops for prefers-reduced-motion.

  Fonts are self-hosted variable fonts (Fraunces, Plus Jakarta Sans; OFL licences
  beside them in /fonts) — nothing is fetched from anyone else.
*/

@font-face {
    font-family: "Fraunces";
    src: url("/fonts/fraunces.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Fraunces";
    src: url("/fonts/fraunces-italic.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("/fonts/jakarta.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@view-transition { navigation: auto; }

/* ---- Tokens --------------------------------------------------------------- */

:root {
    color-scheme: light dark;

    --cream: light-dark(#fff8ef, #0e0f1d);
    --cream-deep: light-dark(#fbefe0, #14162a);
    --paper: light-dark(#ffffff, #181a30);
    --ink: light-dark(#1c1a2e, #f5f1ea);
    --ink-soft: light-dark(#4d4e66, #c6c4d6);
    --ink-faint: light-dark(#7c7d93, #8e8fa8);
    --line: light-dark(#eadfce, #2a2d48);

    --coral: #ff7e57;
    --sun: #ffc24b;
    --violet: #a64bf4;
    --teal: #22c3d6;
    --mint: #39d6a4;
    --sky: #4aa8ff;

    --grad-brand: linear-gradient(115deg, var(--coral) 0%, #f0569b 32%, var(--violet) 62%, var(--teal) 100%);
    --night: #0d0b24;

    --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

    --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
    --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
    --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.4rem);
    --step-2: clamp(1.45rem, 1.28rem + 0.85vw, 1.95rem);
    --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 2.9rem);
    --step-4: clamp(2.5rem, 1.85rem + 3.2vw, 4.4rem);
    --step-5: clamp(2.9rem, 2rem + 4.6vw, 5.6rem);

    --gutter: clamp(16px, 4vw, 40px);
    --wide: 1200px;
    --r-s: 12px;
    --r-m: 20px;
    --r-l: 30px;
    --r-xl: 40px;

    --shadow-s: 0 1px 2px rgb(28 26 46 / 0.06), 0 2px 6px rgb(28 26 46 / 0.06);
    --shadow-m: 0 2px 4px rgb(28 26 46 / 0.05), 0 12px 32px -8px rgb(28 26 46 / 0.18);
    --shadow-l: 0 4px 10px rgb(28 26 46 / 0.06), 0 30px 70px -20px rgb(28 26 46 / 0.35);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 96;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0;
    text-wrap: balance;
}
h1 em, h2 em { font-style: italic; font-weight: 500; }
p { margin: 0; text-wrap: pretty; }

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

.skip {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 10px;
    &:focus { top: 12px; }
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 0.5em;
    font-size: var(--step--1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-soft);
}

.lede { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.55; max-width: 38ch; }

.section { padding-block: clamp(64px, 9vw, 128px); }
.section-head {
    display: grid; gap: 16px; margin-bottom: clamp(32px, 5vw, 56px); max-width: 760px;
    & h2 { font-size: var(--step-4); }
    & p { font-size: var(--step-1); color: var(--ink-soft); }
    &.center { margin-inline: auto; text-align: center; justify-items: center; }
}

.grad-text {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    padding-right: 0.06em;
}

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

.btn {
    --bg: var(--ink); --fg: var(--cream);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
    min-height: 52px; padding: 0 1.4em; border-radius: 999px;
    background: var(--bg); color: var(--fg);
    font: 700 var(--step-0)/1 var(--font-body); text-decoration: none;
    border: 0; cursor: pointer;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.2s;
    box-shadow: var(--shadow-s);
    &:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
    &.ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ink) 18%, transparent); }
    &.ghost:hover { --bg: color-mix(in oklab, var(--ink) 6%, transparent); }
    & svg { width: 1.1em; height: 1.1em; }
}

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
    display: inline-flex; align-items: center; gap: 11px;
    min-height: 56px; padding: 8px 20px 8px 16px; border-radius: 14px;
    background: #0b0b12; color: #fff; text-decoration: none;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08) inset, var(--shadow-s);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
    & svg { width: 24px; height: 24px; flex: none; }
    & span { display: grid; line-height: 1.1; }
    & small { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em; opacity: 0.85; }
    & strong { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
    &:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12) inset, var(--shadow-m); }
    &.light { background: #fff; color: #0b0b12; box-shadow: var(--shadow-s); }
}

/* ---- Header ----------------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklab, var(--cream) 78%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
    & .bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
}

.brand {
    display: inline-flex; align-items: center; gap: 10px;
    font: 800 1.2rem/1 var(--font-body); letter-spacing: -0.02em; text-decoration: none;
    & svg { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--shadow-s); }
    & b { font-weight: 800; }
    & span { font-weight: 500; color: var(--ink-soft); }
}

.nav {
    display: flex; align-items: center; gap: 6px;
    & a {
        padding: 10px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.97rem;
        color: var(--ink-soft);
        &:hover, &[aria-current="page"] { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
    }
    & a.btn { min-height: 44px; font-size: 0.95rem; margin-left: 8px; padding: 0 1.2em; color: var(--fg); background: var(--bg); }
    & a.btn:hover { color: var(--fg); background: var(--bg); }
}

.menu-btn {
    display: none; width: 46px; height: 46px; border-radius: 14px; border: 0; cursor: pointer;
    background: color-mix(in oklab, var(--ink) 7%, transparent); color: var(--ink);
    & svg { width: 22px; height: 22px; margin: auto; }
}

.menu {
    margin: 0; inset: 76px 12px auto auto; width: min(340px, calc(100vw - 24px));
    padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m);
    background: var(--paper); color: var(--ink); box-shadow: var(--shadow-l);
    & a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; text-decoration: none; font-weight: 600; }
    & a:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); }
    & img { width: 34px; height: 34px; border-radius: 9px; }
    & hr { border: 0; border-top: 1px solid var(--line); margin: 8px 4px; }
    &::backdrop { background: rgb(13 11 36 / 0.25); }
}

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

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

.hero {
    position: relative; isolation: isolate; overflow: clip;
    padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 112px);
}

.blobs {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    & i {
        position: absolute; border-radius: 50%; filter: blur(60px);
        opacity: 0.55;
        animation: drift 18s ease-in-out infinite alternate;
    }
    & i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: light-dark(#ffc9a6, #7a2f55); }
    & i:nth-child(2) { width: 38vw; height: 38vw; right: -8vw; top: -6vw; background: light-dark(#d9c2ff, #4b2a9e); animation-delay: -6s; }
    & i:nth-child(3) { width: 34vw; height: 34vw; right: 18vw; bottom: -18vw; background: light-dark(#a9ecf2, #0f5f73); animation-delay: -11s; }
    & i:nth-child(4) { width: 22vw; height: 22vw; left: 30vw; bottom: -6vw; background: light-dark(#ffe39b, #6b4a12); animation-delay: -3s; }
}
@media (prefers-color-scheme: dark) { .blobs i { opacity: 0.45; } }
@keyframes drift {
    to { transform: translate3d(4vw, 3vw, 0) scale(1.08); }
}

.hero-grid {
    display: grid; gap: clamp(40px, 6vw, 72px); align-items: center;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-copy {
    display: grid; gap: 24px; justify-items: start;
    & h1 { font-size: var(--step-5); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
    & .lede { max-width: 34ch; }
}

.pill {
    display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px;
    border-radius: 999px; background: color-mix(in oklab, var(--paper) 80%, transparent);
    box-shadow: var(--shadow-s); font-size: var(--step--1); font-weight: 600; color: var(--ink-soft);
    & b { background: var(--grad-brand); color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.trust {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
    font-size: var(--step--1); color: var(--ink-soft);
    & .stars { color: #f5a524; letter-spacing: 2px; font-size: 1rem; }
    & strong { color: var(--ink); }
}

/* The fan of phones, with app icons floating around it. */
.showcase {
    position: relative; aspect-ratio: 1 / 1.02; width: min(100%, 560px); justify-self: center;
}
.showcase .phone {
    position: absolute; width: 42%; top: 9%; left: 29%;
    border-radius: 28px; overflow: hidden;
    box-shadow: var(--shadow-l), 0 0 0 6px #0d0b24, 0 0 0 7px rgb(255 255 255 / 0.25);
    background: #0d0b24;
    transition: transform 0.6s var(--ease-out);
    & img { width: 100%; }
    &:nth-of-type(1) { transform: translate(-58%, 9%) rotate(-11deg); z-index: 1; }
    &:nth-of-type(2) { z-index: 3; }
    &:nth-of-type(3) { transform: translate(58%, 9%) rotate(11deg); z-index: 2; }
}
.showcase:hover .phone:nth-of-type(1) { transform: translate(-64%, 7%) rotate(-14deg); }
.showcase:hover .phone:nth-of-type(3) { transform: translate(64%, 7%) rotate(14deg); }

.float {
    position: absolute; z-index: 4; width: clamp(54px, 11%, 78px); aspect-ratio: 1;
    border-radius: 24%; overflow: hidden; box-shadow: var(--shadow-m);
    animation: bob 6s ease-in-out infinite;
    & img { width: 100%; height: 100%; object-fit: cover; }
    &:nth-of-type(1) { left: 0; top: 4%; animation-delay: -1s; rotate: -10deg; }
    &:nth-of-type(2) { right: 2%; top: 0; animation-delay: -2.5s; rotate: 9deg; }
    &:nth-of-type(3) { left: -3%; bottom: 14%; animation-delay: -4s; rotate: 8deg; }
    &:nth-of-type(4) { right: -2%; bottom: 20%; animation-delay: -3s; rotate: -8deg; }
    &:nth-of-type(5) { left: 40%; bottom: -7%; animation-delay: -5s; rotate: 4deg; }
    &:nth-of-type(6) { left: 46%; top: -4%; animation-delay: -1.8s; rotate: -6deg; width: clamp(44px, 9%, 62px); }
    &:nth-of-type(7) { right: 16%; bottom: -5%; animation-delay: -3.6s; rotate: -5deg; width: clamp(48px, 10%, 70px); }
}
@keyframes bob {
    50% { transform: translateY(-12px); }
}

/* ---- Slogan ribbon ---------------------------------------------------------- */

.ribbon-clip { overflow: hidden; padding-block: 18px; margin-block: -18px; position: relative; z-index: 2; }

.ribbon {
    overflow: hidden; padding-block: 20px;
    background: var(--night); color: #fff;
    rotate: -1.2deg; margin-block: -10px; position: relative; z-index: 2;
    width: 104%; margin-left: -2%;
    & .track { display: flex; width: max-content; gap: 14px; animation: slide 46s linear infinite; }
    & span {
        flex: none; padding: 10px 20px; border-radius: 999px;
        font: 600 1.05rem/1 var(--font-display); font-style: italic; letter-spacing: 0;
        background: color-mix(in oklab, var(--c) 22%, transparent); color: color-mix(in oklab, var(--c) 40%, white);
        box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 45%, transparent);
    }
    &:hover .track { animation-play-state: paused; }
}
@keyframes slide { to { transform: translateX(-50%); } }

/* ---- App cards -------------------------------------------------------------- */

.apps-grid {
    display: grid; gap: clamp(16px, 2vw, 24px);
    grid-template-columns: repeat(6, minmax(0, 1fr));
    & > .large { grid-column: span 3; }
    & > .mid { grid-column: span 2; }
    & > .strip, & > .wide { grid-column: 1 / -1; }
}
@media (max-width: 1020px) {
    .apps-grid > .mid { grid-column: span 3; }
    .apps-grid > .mid:nth-last-child(1 of .mid):nth-child(odd of .mid) { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .apps-grid > .large, .apps-grid > .mid { grid-column: 1 / -1; }
}

.app-card {
    --from: #333; --to: #555; --accent: #fff; --ink-on: #fff;
    --pad: clamp(24px, 3vw, 34px);
    container-type: inline-size;
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; gap: 14px;
    padding: var(--pad);
    border-radius: var(--r-l);
    background:
        radial-gradient(110% 80% at 100% 0%, color-mix(in oklab, var(--accent) 36%, transparent), transparent 55%),
        radial-gradient(80% 60% at 0% 100%, color-mix(in oklab, var(--to) 70%, white 8%), transparent 70%),
        linear-gradient(155deg, var(--from), var(--to));
    color: var(--ink-on); text-decoration: none;
    box-shadow: var(--shadow-m);
    transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
    &:hover { transform: translateY(-6px); box-shadow: var(--shadow-l); }

    & .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    & .icon {
        width: 76px; height: 76px; border-radius: 21px; overflow: hidden; flex: none;
        box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.2);
    }
    & .icon img { width: 100%; height: 100%; }
    & .card-copy { display: grid; gap: 8px; }
    & .kicker { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: color-mix(in oklab, var(--accent) 75%, white); }
    & h3 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.5rem); }
    & p { max-width: 40ch; opacity: 0.92; }
    & .chip { font-size: 0.78rem; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: rgb(255 255 255 / 0.14); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22); white-space: nowrap; }
    & .go {
        display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
        & svg { width: 18px; transition: translate 0.3s var(--ease-out); }
    }
    &:hover .go svg { translate: 4px 0; }

    /* The top of a screenshot or two, rising out of the bottom edge. */
    & .shot {
        margin: auto calc(-1 * var(--pad)) calc(-1 * var(--pad));
        padding-top: 18px; height: clamp(220px, 46cqi, 300px); overflow: hidden;
        display: flex; justify-content: center; align-items: flex-start; gap: 4%;
    }
    & .shot img {
        width: min(58%, 250px); border-radius: 22px 22px 0 0;
        box-shadow: 0 -2px 0 5px rgb(0 0 0 / 0.28), 0 30px 60px -10px rgb(0 0 0 / 0.55);
        transition: transform 0.6s var(--ease-out);
    }
    & .shot img + img { margin-top: 34px; }
    &:hover .shot img { transform: translateY(-10px); }
}
.app-card.large .shot img { width: min(42%, 230px); }
@container (max-width: 440px) {
    .app-card .shot img + img { display: none; }
    .app-card .shot img { width: min(64%, 240px); }
}
.app-card.strip {
    display: grid; align-items: center; gap: 18px 28px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    & .card-top .chip { display: none; }
    & p { max-width: 60ch; }
}
@media (max-width: 700px) {
    .app-card.strip { grid-template-columns: 1fr; }
}
/* One app on a row of its own: words on the left, two screens rising on the right. */
.app-card.wide {
    display: grid; column-gap: clamp(24px, 4vw, 56px);
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    & .card-top { grid-area: 1 / 1; }
    & .card-copy { grid-area: 2 / 1; }
    & .go { grid-area: 3 / 1; align-self: end; }
    & p { max-width: 50ch; }
    & .shot {
        grid-area: 1 / 2 / 4 / 3; align-self: end;
        margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0;
        height: clamp(260px, 30cqi, 340px); padding-top: 0;
    }
    & .shot img { width: min(40%, 220px); }
}
@media (max-width: 700px) {
    .app-card.wide { display: flex; }
    .app-card.wide .shot { margin: auto calc(-1 * var(--pad)) calc(-1 * var(--pad)); padding-top: 18px; }
}

/* ---- What recovery asks of you (pastel tiles) ------------------------------- */

.needs {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    &.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
}
.need {
    --c: #ccc;
    display: grid; align-content: start; gap: 12px; padding: 26px;
    border-radius: var(--r-m); text-decoration: none; color: var(--ink);
    background: light-dark(color-mix(in oklab, var(--c) 18%, white), color-mix(in oklab, var(--c) 18%, #14162a));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 35%, transparent), 6px 6px 0 color-mix(in oklab, var(--c) 55%, var(--ink));
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
    &:hover { transform: translate(-3px, -3px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 35%, transparent), 9px 9px 0 color-mix(in oklab, var(--c) 55%, var(--ink)); }
    & .glyph {
        width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
        background: color-mix(in oklab, var(--c) 85%, white); color: #fff;
        & svg { width: 26px; height: 26px; }
    }
    & h3 { font-size: var(--step-2); }
    & p { color: var(--ink-soft); font-size: 0.97rem; }
    & .via { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.86rem; font-weight: 700; }
    & .via img { width: 26px; height: 26px; border-radius: 7px; }
}

/* ---- Ratings band ----------------------------------------------------------- */

.band {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: var(--r-xl); padding: clamp(36px, 6vw, 72px);
    background:
        radial-gradient(60% 120% at 0% 0%, rgb(255 126 87 / 0.55), transparent 60%),
        radial-gradient(60% 120% at 100% 100%, rgb(34 195 214 / 0.5), transparent 60%),
        linear-gradient(120deg, #4b1fb8, #8a3ff0);
    color: #fff;
    & h2 { font-size: var(--step-4); color: #fff8e1; }
    & .lede { color: rgb(255 255 255 / 0.85); }
}
.band-grid {
    display: grid; gap: 28px; align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}
@media (max-width: 860px) { .band-grid { grid-template-columns: 1fr; } }

.stats {
    display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr));
    & div {
        padding: 22px; border-radius: var(--r-m);
        background: rgb(255 255 255 / 0.12); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
        backdrop-filter: blur(6px);
    }
    & b { display: block; white-space: nowrap; font: 600 clamp(2rem, 1.5rem + 1.6vw, 3rem)/1 var(--font-display); color: #fff8e1; }
    & b .star { display: inline; margin: 0; color: var(--sun); font-size: 0.7em; vertical-align: 0.15em; }
    & span { display: block; margin-top: 8px; font-size: 0.9rem; color: rgb(255 255 255 / 0.85); }
}
.fine { font-size: 0.82rem; opacity: 0.8; margin-top: 18px; }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* ---- Technology bento ------------------------------------------------------- */

.tech {
    background:
        radial-gradient(50% 60% at 85% 0%, rgb(166 75 244 / 0.35), transparent 70%),
        radial-gradient(40% 50% at 0% 100%, rgb(34 195 214 / 0.25), transparent 70%),
        var(--night);
    color: #f3f0ff;
    & .section-head p { color: rgb(243 240 255 / 0.75); }
    & .eyebrow { color: #c8b8ff; }
}
.bento {
    display: grid; gap: 16px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: dense;
}
.tile {
    --c: #7c5cff;
    grid-column: span 2;
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; align-content: start; gap: 12px;
    padding: 28px; border-radius: var(--r-m); min-height: 230px;
    background: color-mix(in oklab, var(--c) 16%, #15132f);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 40%, transparent);
    &.wide { grid-column: span 3; }
    &.full { grid-column: span 4; }
    &.whole { grid-column: 1 / -1; min-height: 0; }
    &.solid { background: var(--c); color: var(--night); box-shadow: none; }
    &.solid p { color: color-mix(in oklab, var(--night) 80%, transparent); }
    & .glyph {
        width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
        background: color-mix(in oklab, var(--c) 30%, transparent); color: color-mix(in oklab, var(--c) 55%, white);
        & svg { width: 24px; height: 24px; }
    }
    &.solid .glyph { background: rgb(13 11 36 / 0.12); color: var(--night); }
    & h3 { font-size: var(--step-2); }
    & p { color: rgb(243 240 255 / 0.78); font-size: 0.98rem; }
    &::after {
        content: ""; position: absolute; z-index: -1; right: -60px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
        background: radial-gradient(circle, color-mix(in oklab, var(--c) 45%, transparent), transparent 70%);
    }
}
@media (max-width: 960px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile, .tile.wide, .tile.full { grid-column: span 1; }
    .tile.full, .tile.whole { grid-column: span 2; }
}
@media (max-width: 600px) {
    .bento { grid-template-columns: 1fr; }
    .tile.full, .tile.whole { grid-column: span 1; }
    .tile { min-height: 0; }
}

.stack {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px;
    & span {
        padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
        background: rgb(255 255 255 / 0.07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16);
    }
}

/* ---- silkworth.net ---------------------------------------------------------- */

.archive {
    display: grid; gap: clamp(24px, 4vw, 56px); align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: clamp(28px, 5vw, 56px); border-radius: var(--r-xl);
    background: light-dark(#eef6ff, #131c33);
    box-shadow: inset 0 0 0 1px light-dark(#d5e6fb, #22314f);
    & img { width: clamp(84px, 10vw, 128px); border-radius: 50%; box-shadow: var(--shadow-m); }
    & h2 { font-size: var(--step-3); }
    & p { color: var(--ink-soft); margin-top: 10px; max-width: 56ch; }
}
@media (max-width: 760px) { .archive { grid-template-columns: 1fr; } }

/* ---- Final call to action --------------------------------------------------- */

.cta {
    position: relative; overflow: hidden; isolation: isolate; text-align: center;
    padding-block: clamp(80px, 12vw, 160px);
    background: var(--night); color: #fff;
    & h2 { font-size: var(--step-5); max-width: 16ch; margin-inline: auto; }
    & p { color: rgb(255 255 255 / 0.78); font-size: var(--step-1); margin: 20px auto 0; max-width: 46ch; }
    & .stores { justify-content: center; margin-top: 36px; }
    & .icons { display: flex; justify-content: center; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
    & .icons img { width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.7); }
}
.swirl {
    position: absolute; inset: -40%; z-index: -1;
    background: conic-gradient(from var(--spin, 0deg) at 50% 50%, #ff7e57, #f0569b, #a64bf4, #22c3d6, #39d6a4, #ffc24b, #ff7e57);
    filter: blur(90px); opacity: 0.45;
    mask: radial-gradient(closest-side, #000 30%, transparent 75%);
    animation: spin 24s linear infinite;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }

/* ---- App page --------------------------------------------------------------- */

.app-hero {
    --from: #333; --to: #555; --accent: #fff;
    position: relative; isolation: isolate; overflow: clip;
    color: #fff;
    background:
        radial-gradient(70% 90% at 100% 0%, color-mix(in oklab, var(--accent) 38%, transparent), transparent 60%),
        radial-gradient(60% 70% at 0% 100%, color-mix(in oklab, var(--to) 60%, transparent), transparent 70%),
        linear-gradient(160deg, var(--from), var(--to));
    padding-block: clamp(40px, 7vw, 96px) clamp(48px, 8vw, 110px);
    & .crumbs { font-size: 0.92rem; font-weight: 600; opacity: 0.85; margin-bottom: 28px; }
    & .crumbs a { text-decoration: none; }
    & .crumbs a:hover { text-decoration: underline; }
}
.app-hero-grid {
    display: grid; gap: clamp(36px, 6vw, 72px); align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (max-width: 900px) { .app-hero-grid { grid-template-columns: 1fr; } }
.app-hero-copy {
    display: grid; gap: 22px; justify-items: start;
    & .big-icon { width: 112px; height: 112px; border-radius: 28px; overflow: hidden; box-shadow: 0 20px 50px -14px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.2); }
    & .big-icon img { width: 100%; height: 100%; }
    & h1 { font-size: var(--step-5); }
    & .tagline { font: 500 italic var(--step-2)/1.25 var(--font-display); color: color-mix(in oklab, var(--accent) 45%, white); max-width: 24ch; }
    & .lede { color: rgb(255 255 255 / 0.86); max-width: 44ch; }
    & .site-link { font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
    & .site-link svg { width: 16px; }
    & .legal-links { font-size: var(--step--1); color: rgb(255 255 255 / 0.72); }
    & .legal-links a { color: inherit; text-underline-offset: 3px; }
    & .legal-links a:hover { color: white; }
}

.screens {
    display: flex; justify-content: center; align-items: flex-end;
    & figure {
        margin: 0; width: 36%; flex: none;
        border-radius: 26px; overflow: hidden;
        box-shadow: 0 30px 70px -24px rgb(0 0 0 / 0.65), 0 0 0 5px rgb(0 0 0 / 0.35);
        transition: transform 0.6s var(--ease-out);
    }
    & figure:nth-child(1) { transform: translateX(14%) rotate(-7deg); }
    & figure:nth-child(2) { z-index: 2; width: 40%; }
    & figure:nth-child(3) { transform: translateX(-14%) rotate(7deg); }
}

.features {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.feature {
    padding: 28px; border-radius: var(--r-m);
    background: var(--paper); box-shadow: var(--shadow-s), inset 0 0 0 1px var(--line);
    display: grid; gap: 10px; align-content: start;
    & .n {
        width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
        font: 700 1rem/1 var(--font-display); color: #fff;
        background: linear-gradient(140deg, var(--from), var(--to));
    }
    & h3 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
    & p { color: var(--ink-soft); font-size: 0.98rem; }
}

.tinted { background: light-dark(var(--soft, #f4f0ff), color-mix(in oklab, var(--from) 22%, #0e0f1d)); }

.mini-apps {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.mini {
    display: flex; align-items: center; gap: 14px; padding: 14px;
    border-radius: var(--r-m); background: var(--paper); text-decoration: none;
    box-shadow: var(--shadow-s), inset 0 0 0 1px var(--line);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
    & img { width: 56px; height: 56px; border-radius: 15px; flex: none; }
    & b { display: block; font-size: 1.02rem; }
    & span { display: block; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.35; }
    &:hover { transform: translateY(-3px); box-shadow: var(--shadow-m), inset 0 0 0 1px var(--line); }
}

.note {
    display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px; border-radius: var(--r-m);
    background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft);
    & svg { width: 24px; flex: none; color: var(--violet); margin-top: 2px; }
}

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

.site-footer {
    background: var(--cream-deep); border-top: 1px solid var(--line);
    padding-block: 64px 40px; font-size: 0.95rem; color: var(--ink-soft);
    & .cols { display: grid; gap: 36px; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); }
    & h4 { margin: 0 0 14px; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
    & ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
    & a { text-decoration: none; }
    & a:hover { color: var(--ink); text-decoration: underline; }
    & .about p { margin-top: 14px; max-width: 34ch; }
    & .legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 0.85rem; }
}
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .about { grid-column: 1 / -1; } }

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

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .reveal {
            animation: rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
        }
    }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(36px) scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .ribbon .track { flex-wrap: wrap; width: auto; justify-content: center; }
    .ribbon .track [aria-hidden] { display: none; }
    ::view-transition-group(*) { animation: none !important; }
}

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }

/* ---- App privacy policies and terms (/apps/{slug}/privacy, /terms) ------- */

.policy-hero {
    & h1 { font-size: var(--step-4); }
    & .lede { max-width: 60ch; font-size: var(--step-0); }
    & .lede a { color: inherit; font-weight: 700; }
}
.policy {
    max-width: 70ch; margin-inline: auto;
    font-size: var(--step-0); line-height: 1.7; color: var(--ink);
    & > * + * { margin-top: 1em; }
    & h2 { font-size: var(--step-2); line-height: 1.2; margin-top: 2.2em; }
    & h2 + * { margin-top: 0.7em; }
    & h3 { font-size: var(--step-1); line-height: 1.3; margin-top: 1.8em; color: var(--ink); }
    & h3 + * { margin-top: 0.5em; }
    & p, & li { color: var(--ink-soft); }
    & strong { color: var(--ink); font-weight: 700; }
    & ul, & ol { margin-block: 0; padding-left: 1.3em; }
    & li + li { margin-top: 0.45em; }
    & li::marker { color: var(--violet); }
    & a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
}

/* ---- Odds and ends ---------------------------------------------------------- */

.screens.solo {
    & img { width: min(62%, 300px); border-radius: 23%; box-shadow: 0 40px 80px -24px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.2); rotate: -6deg; }
}
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; padding: 0.1em 0.4em; border-radius: 6px; background: color-mix(in oklab, var(--ink) 7%, transparent); }
