/* Mosaic's landing page. Mobile first: the base rules are for a phone, and the
   media queries at the end widen the layout for tablets and desktops. Colors come
   from the app icon (Design/AppIcon): a violet-navy night and a dusk gradient. */

:root {
    --night-top: #2c2150;
    --night-bottom: #11142f;
    --dusk: linear-gradient(120deg, #fdae72 0%, #e05e98 48%, #5a6cff 100%);
    --dusk-text: linear-gradient(100deg, #ffb877 0%, #f06ba4 45%, #8d8cff 100%);
    --accent: #5a5ff0;

    --bg: #ffffff;
    --bg-soft: #f4f3f8;
    --card: #ffffff;
    --text: #15142a;
    --text-2: #4c4b63;
    --text-3: #6f6e86;
    --line: rgba(21, 20, 42, 0.1);
    --shadow: 0 1px 2px rgba(17, 20, 47, 0.06), 0 8px 24px rgba(17, 20, 47, 0.08);

    --radius: 22px;
    --wrap: 1120px;
    --gutter: 20px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #9b9cff;
        --bg: #0e1029;
        --bg-soft: #15173a;
        --card: #1b1d45;
        --text: #f3f2fb;
        --text-2: #c4c3dc;
        --text-3: #9d9cb8;
        --line: rgba(255, 255, 255, 0.1);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    }
}

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

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: 0.15em; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 9vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 6.5vw, 2.8rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

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

.skip {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 10px;
}
.skip:focus { top: 12px; }

.gradient-text {
    background: var(--dusk-text);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}

.eyebrow {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3); margin-bottom: 0.9em;
}

.lede { font-size: 1.15rem; color: var(--text-2); max-width: 40em; }

/* Header */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(17, 20, 47, 0.78);
    -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 8px; height: 56px; }
.brand { flex: none; display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
    color: rgba(255, 255, 255, 0.82); text-decoration: none; font-size: 0.95rem; font-weight: 500;
    padding: 8px 10px; border-radius: 10px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.1); }
.site-nav .nav-extra { display: none; }

/* Buttons */

.store-button {
    display: inline-flex; align-items: center; gap: 10px;
    background: #000; color: #fff; text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 12px;
    padding: 9px 18px 9px 14px; min-height: 52px;
    transition: transform 0.15s ease;
}
a.store-button:hover { transform: translateY(-1px); }
.store-button svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store-button span { display: flex; flex-direction: column; line-height: 1.1; }
.store-button small { font-size: 0.7rem; letter-spacing: 0.02em; }
.store-button strong { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.header-store { white-space: nowrap; gap: 6px; padding: 4px 10px 4px 8px; min-height: 36px; border-radius: 9px; }
.header-store svg { width: 17px; height: 17px; }
.header-store small { font-size: 0.55rem; }
.header-store strong { font-size: 0.9rem; }

/* On phones the header holds the icon, the links, and the App Store button, so the name
   is left to the icon and the links sit closer. */
@media (max-width: 479px) {
    .brand-name {
        position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
        clip: rect(0 0 0 0); white-space: nowrap;
    }
    .site-nav { gap: 0; }
    .site-nav a { padding: 8px 7px; }
}
@media (max-width: 359px) {
    .site-header .wrap { gap: 6px; }
    .site-nav a { padding: 8px 5px; font-size: 0.9rem; }
    .header-store { padding: 4px 8px 4px 6px; gap: 5px; }
}
.store-note { font-size: 0.85rem; color: rgba(255, 255, 255, 0.66); margin: 12px 0 0; }

/* Hero */

.hero {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(180deg, var(--night-top) 0%, var(--night-bottom) 100%);
    padding: 44px 0 0;
}
.hero::before {
    content: ""; position: absolute; inset: -30% -40% auto auto; width: 120%; height: 90%;
    background: radial-gradient(closest-side, rgba(224, 94, 152, 0.35), transparent 70%),
                radial-gradient(closest-side at 70% 60%, rgba(90, 108, 255, 0.3), transparent 70%);
    pointer-events: none;
}
.hero .wrap { position: relative; display: grid; gap: 40px; }
.hero h1 { margin-bottom: 0.4em; }
.hero .lede { color: rgba(255, 255, 255, 0.8); }
.hero .eyebrow { color: rgba(255, 255, 255, 0.6); }

/* The hero's phone: a Home Screen made of real widget pictures. */

.phone {
    position: relative; width: min(340px, 86vw); margin: 0 auto -170px;
    aspect-ratio: 9 / 19.5;
    border-radius: 54px; padding: 12px;
    background: #0b0b12;
    box-shadow: 0 0 0 2px #3a3a48, 0 30px 80px rgba(0, 0, 0, 0.5);
}
.phone-screen {
    position: relative; height: 100%; border-radius: 43px; overflow: hidden;
    background:
        radial-gradient(120% 70% at 10% 0%, rgba(253, 174, 114, 0.55), transparent 60%),
        radial-gradient(120% 70% at 100% 40%, rgba(224, 94, 152, 0.5), transparent 60%),
        radial-gradient(120% 80% at 30% 100%, rgba(90, 108, 255, 0.6), transparent 60%),
        #1d1640;
    padding: 52px 13px 14px;
}
.phone-screen::before {
    content: ""; position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
    width: 31%; height: 26px; border-radius: 20px; background: #000;
}
/* Whole widgets, each drawn with its own rounded corners and theme. */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.home-grid img { width: 100%; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)); }
.widget {
    background: #4d4d4d; border-radius: 18px; overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.widget img { width: 100%; height: auto; }
.home-grid .wide { grid-column: span 2; }
.widget.light { background: #fff; }

.phone-shine { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* Sections */

section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { margin-bottom: 36px; }

/* Steps */

.steps { display: grid; gap: 16px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow);
}
.step p { color: var(--text-2); margin: 0; }
.step-num {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--dusk); color: #fff; font-weight: 800; margin-bottom: 14px;
}

/* Layout diagrams: zones drawn on a CSS grid from LayoutCatalog's specs (site.js). */

.diagram {
    display: grid; gap: 4px; padding: 6px; border-radius: 14px;
    background: rgba(127, 127, 160, 0.16);
}
.diagram span {
    display: grid; place-items: center; border-radius: 8px;
    font-size: 0.7rem; font-weight: 700; color: rgba(255, 255, 255, 0.92);
    background: var(--dusk); background-attachment: local;
    min-height: 0;
}
.diagram span:nth-child(3n+2) { background: linear-gradient(120deg, #e05e98, #8b67e8); }
.diagram span:nth-child(3n) { background: linear-gradient(120deg, #7a6af0, #5a6cff); }
.diagram.small { aspect-ratio: 1; }
.diagram.medium { aspect-ratio: 2.12; }
.diagram.large { aspect-ratio: 1 / 1.05; }
.diagram.xl { aspect-ratio: 1 / 1.68; }
.diagram.wide { aspect-ratio: 2.12; }

.step .diagram { width: 128px; margin: 0 0 16px; }

.layout-families { display: grid; gap: 28px; }
/* A grid item is as wide as its content unless told otherwise, and a row of diagrams
   scrolled sideways would otherwise widen the whole page on a phone. */
.family { min-width: 0; }
.family h3 { display: flex; align-items: baseline; gap: 10px; }
.family h3 small { font-size: 0.85rem; font-weight: 500; color: var(--text-3); }
.family-layouts {
    display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px;
    scrollbar-width: thin;
}
.family-layouts figure { margin: 0; scroll-snap-align: start; }
.family-layouts figcaption { font-size: 0.85rem; color: var(--text-2); margin-top: 8px; text-align: center; }
.family[data-family="medium"] .family-layouts,
.family[data-family="wide"] .family-layouts { grid-auto-columns: 200px; }

/* One element at four sizes. */

.sizes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px 14px; }
.sizes figure { margin: 0; flex: none; max-width: 100%; }
.sizes figcaption { font-size: 0.85rem; color: var(--text-3); margin-top: 10px; }
.sizes .widget { box-shadow: var(--shadow); }
.sizes .s-tile { width: 76px; }
.sizes .s-small { width: 158px; }
.sizes .s-medium, .sizes .s-large { width: 340px; max-width: 100%; }

/* Three widgets apart, and the same three in one. */

.compare { display: grid; gap: 18px; align-items: center; justify-items: center; margin-bottom: 36px; }
.compare figure { margin: 0; width: min(100%, 380px); }
.compare figure img { width: 100%; filter: drop-shadow(0 6px 16px rgba(17, 20, 47, 0.2)); }
.apart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.apart-grid .wide { grid-column: span 2; }
.apart-grid img { opacity: 0.92; }
.compare figcaption { margin-top: 12px; text-align: center; }
.compare figcaption strong { display: block; }
.compare figcaption span { color: var(--text-3); font-size: 0.92rem; }
.compare-arrow { font-size: 2rem; color: var(--text-3); transform: rotate(90deg); line-height: 1; }
.features.compact .feature { padding: 20px 22px; }

/* Mosaic in numbers: the catalog's figures (site.js doesn't touch them; a MosaicCore test
   checks them against the catalogs). */

.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;
}

.numbers { background: var(--bg-soft); padding: 56px 0; text-align: center; }
.figures {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px;
    list-style: none; padding: 0; margin: 0 auto 36px; max-width: 900px;
    color: var(--text-2); font-size: 0.95rem;
}
.figures li:last-child { grid-column: span 2; }
.figures b {
    display: block; font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1.05;
    letter-spacing: -0.03em; color: var(--text);
}
.ways { font-family: var(--font-display); font-size: clamp(1.5rem, 5.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 auto 0.4em; max-width: 22em; }
.ways b { background: var(--dusk-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ways-more { color: var(--text-2); font-size: 1.1rem; max-width: 34em; margin: 0 auto 0.8em; }
.ways-more span { color: var(--text); font-weight: 700; }
.figures-note { font-size: 0.82rem; color: var(--text-3); margin: 0; }

/* The widgets that come with iPhone, beside Mosaic: a table on wider screens, a card for
   each row on a phone. */

.versus { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 8px; }
.versus thead { display: none; }
.versus tr {
    display: block; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px;
}
.versus td { display: block; padding: 0; }
.versus td:first-child { color: var(--text-3); font-size: 0.92rem; margin-bottom: 6px; }
.versus td:first-child::before { content: "Built in: "; font-weight: 700; }
.versus td:last-child { font-weight: 600; }
.versus td:last-child::before { content: "Mosaic: "; font-weight: 800; color: var(--accent); }

/* Examples: the size filter. */

.size-filter { flex-wrap: wrap; margin-bottom: 18px; }
/* Without site.js, the filter, the arrows, and the count, which need it, stay hidden. */
.size-filter[hidden], .strip-arrow[hidden], .gallery-count[hidden] { display: none; }
.size-filter .filter-count { font-weight: 400; color: var(--text-3); }
.gallery figure[hidden] { display: none; }

/* The nine categories. */

.categories { display: grid; gap: 16px; }
.category {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 22px 8px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column;
}
.category header { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; margin-bottom: 12px; }
.category .icon {
    grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: var(--dusk); color: #fff;
}
.category .icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.category h3 { margin: 0; }
.category-count { font-size: 0.85rem; color: var(--text-3); }
.category-count b { font-weight: 600; }
.category > p { color: var(--text-2); margin: 0 0 12px; }
.category-elements { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.category-elements li {
    border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 0.82rem; color: var(--text-2);
}
/* Like the examples, each card's strip cuts its next picture at the edge, deep enough to read as
   more, and site.js adds the arrows, fades, and count; they sit at the card's own edges. */
.gallery.category-gallery {
    grid-auto-columns: 74%; gap: 12px; margin: 0 -22px; padding: 4px 22px 14px; scroll-padding-left: 22px;
}
.gallery.category-gallery.single { grid-auto-columns: 100%; }
.category-gallery figure > img { width: 100%; filter: drop-shadow(0 4px 12px rgba(17, 20, 47, 0.16)); }
.category-gallery figure > img.small-widget { width: 56%; }
.category-gallery figcaption { margin-top: 8px; }
.category-gallery figcaption strong { font-size: 0.95rem; }
.category-gallery figcaption span { display: none; }
.category .strip-arrow { width: 36px; height: 36px; font-size: 1.35rem; }
.category .strip-arrow.back { left: -14px; }
.category .strip-arrow.forward { right: -14px; }
.category .gallery-count { margin: -8px 0 10px; font-size: 0.82rem; }

/* Feature cards. */

.features { display: grid; gap: 16px; }
.feature {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
}
.feature p { color: var(--text-2); margin: 0; }
.feature .icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: var(--dusk); color: #fff; margin-bottom: 16px;
}
.feature .icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Gallery. */

.gallery {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 340px); gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px var(--gutter) 18px; margin: 0 calc(-1 * var(--gutter));
    scroll-padding-left: var(--gutter);
}
.gallery figure { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; }
.gallery .widget { box-shadow: var(--shadow); }
.gallery figcaption { margin-top: 12px; }
.composites figure > img { width: 100%; filter: drop-shadow(0 6px 16px rgba(17, 20, 47, 0.18)); }
.composites figure > img.small-widget { width: 48%; }
/* An Extra Large is drawn as tall as a Large beside it, so the strip's row doesn't grow for it. */
.composites figure[data-size="extra-large"] > img { width: 64%; }
.gallery figcaption strong { display: block; font-size: 1.05rem; }
.gallery figcaption span { color: var(--text-2); font-size: 0.95rem; }
.gallery figcaption em { display: block; font-style: normal; font-size: 0.8rem; color: var(--text-3); margin: 2px 0 4px; }

/* The examples' strip shows there's more: a card cut through its middle at the right edge, with
   --cards across its visible width (--visible, from the first card's start), --gaps whole gaps
   among them. Without site.js, that alone says it scrolls. */
.composites {
    --cards: 1.3; --gaps: 1; --visible: calc(100vw - var(--gutter));
    grid-auto-columns: calc((var(--visible) - var(--gaps) * 16px) / var(--cards));
}

/* site.js adds the arrows over its edges, centred on the pictures (--arrow-top), each shown while
   there's more that way, and fades that edge. */
.strip { position: relative; }
.strip-arrow {
    position: absolute; top: var(--arrow-top, 40%); transform: translateY(-50%); z-index: 1;
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--card); color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer;
    box-shadow: var(--shadow); display: grid; place-items: center; padding: 0 0 3px;
    transition: top 0.2s ease-out;
}
.strip-arrow.back { left: 4px; }
.strip-arrow.forward { right: 12px; }
.strip-arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.strip.has-after .gallery { mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.strip.has-before .gallery { mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.strip.has-before.has-after .gallery {
    mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}
.gallery-count { text-align: right; margin: 4px 0 0; font-size: 0.9rem; color: var(--text-3); }

@media (hover: hover) and (pointer: fine) {
    .strip-arrow { width: 48px; height: 48px; }
}

/* The galleries' full-screen view (site.js): the picture as large as fits in 92% of the
   width and 78% of the height, up to its own pixels, over the dimmed page. */

.gallery figure > img[role="button"] { cursor: zoom-in; }
.gallery figure > img[role="button"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }

html:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
    width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
    background: rgba(10, 10, 20, 0.88); color: #fff; color-scheme: dark;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    overflow: auto; touch-action: pan-y pinch-zoom;
}
.lightbox[open] { display: flex; animation: lightbox-in 0.2s ease-out; }
.lightbox::backdrop { background: transparent; }
@keyframes lightbox-in { from { opacity: 0; } }
.lightbox-body {
    margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: max(16px, env(safe-area-inset-top)) 4vw max(16px, env(safe-area-inset-bottom));
}
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.lightbox-picture {
    width: auto; height: auto; max-width: 92vw; max-height: 78vh; max-height: 78dvh;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.5));
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.lightbox figcaption { margin-top: 16px; max-width: min(92vw, 34em); text-align: center; }
.lightbox-name { display: block; font-size: 1.1rem; }
.lightbox-detail { display: block; font-style: normal; font-size: 0.82rem; color: rgba(255, 255, 255, 0.62); margin: 2px 0 4px; }
.lightbox-line { color: rgba(255, 255, 255, 0.82); font-size: 0.95rem; }
.lightbox-bar { display: flex; align-items: center; gap: 16px; }
.lightbox-count {
    margin: 0; min-width: 5em; text-align: center;
    font-size: 0.9rem; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.7);
}
.lightbox button {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.lightbox button:disabled { opacity: 0.3; cursor: default; }
.lightbox-close {
    position: absolute; z-index: 1;
    top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.chips li {
    border: 1px solid var(--line); background: var(--card); border-radius: 999px;
    padding: 6px 14px; font-size: 0.9rem; color: var(--text-2);
}


/* Themes: each theme's real background and colors, from ThemeCatalog. */

.theme-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.segmented {
    display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(127, 127, 160, 0.16);
}
.segmented button {
    border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 0.92rem; font-weight: 600;
    padding: 7px 16px; border-radius: 9px; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.theme {
    border-radius: 18px; padding: 14px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between;
    border: 1px solid var(--line); box-shadow: var(--shadow);
    background: var(--t-bg); color: var(--t-text);
    transition: background 0.3s ease, color 0.3s ease;
}
.theme .t-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-accent); }
.theme .t-figure { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.theme .t-detail { font-size: 0.82rem; color: var(--t-text-2); }
.theme .t-name { font-size: 0.9rem; font-weight: 600; }

.fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.font-sample {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.font-sample b { display: block; font-size: 2.1rem; font-weight: 600; line-height: 1.1; }
.font-sample span { font-size: 0.85rem; color: var(--text-3); }
.font-sans b { font-family: system-ui, -apple-system, sans-serif; }
.font-rounded b { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
.font-serif b { font-family: ui-serif, "New York", Georgia, serif; }
.font-mono b { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 500; }

/* Privacy band. */

.privacy-band {
    background: linear-gradient(180deg, var(--night-top), var(--night-bottom)); color: #fff;
}
.privacy-band .lede { color: rgba(255, 255, 255, 0.8); }
.privacy-band .eyebrow { color: rgba(255, 255, 255, 0.6); }
.privacy-points { display: grid; gap: 14px; list-style: none; padding: 0; margin: 28px 0; }
.privacy-points li {
    display: flex; gap: 14px; align-items: flex-start;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px; padding: 16px 18px; color: rgba(255, 255, 255, 0.88);
}
.privacy-points svg { width: 22px; height: 22px; flex: none; margin-top: 2px; stroke: #ffb877; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.privacy-band a { color: #ffc89a; }

/* Final call to action. */

.cta { text-align: center; }
.cta img.app-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 22px; box-shadow: var(--shadow); }
.cta .lede { margin: 0 auto 26px; }
.cta .store-note { color: var(--text-3); }

/* Document pages: Support and Privacy. */

.page-hero {
    background: linear-gradient(180deg, var(--night-top), var(--night-bottom)); color: #fff;
    padding: 48px 0 40px;
}
.page-hero .lede { color: rgba(255, 255, 255, 0.8); margin: 0; }
.page-hero a { color: #ffc89a; }
.page-hero h1 { font-size: clamp(2.1rem, 8vw, 3.2rem); }

.doc { padding: 44px 0 72px; }
.doc .wrap { max-width: 760px; }
.doc h2 { font-size: 1.6rem; margin-top: 1.8em; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin-top: 1.4em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.5em; }
.doc .updated { color: var(--text-3); font-size: 0.95rem; }
.doc .summary {
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 32px;
}
.doc .summary ul { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1em; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 700; }

.contact-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow); margin-bottom: 36px;
}
.contact-card p:last-child { margin: 0; }
.contact-card .email { font-size: 1.2rem; font-weight: 700; }

.faq details {
    border-bottom: 1px solid var(--line); padding: 4px 0;
}
.faq summary {
    cursor: pointer; list-style: none; font-weight: 600; padding: 14px 32px 14px 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; font-weight: 400; color: var(--text-3);
    transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { color: var(--text-2); padding: 0 0 14px; }
.faq details > div p:last-child { margin-bottom: 0; }

/* Footer. */

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 0.9rem; color: var(--text-3); }
.site-footer .wrap { display: grid; gap: 18px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--text); }
.site-footer p { margin: 0; }
.legal { font-size: 0.8rem; }

/* Wider screens. */

@media (min-width: 640px) {
    :root { --gutter: 32px; }
    .site-nav .nav-extra { display: inline-block; }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .features { grid-template-columns: repeat(2, 1fr); }
    .compare { grid-template-columns: 1fr auto 1fr; align-items: center; }
    .compare-arrow { transform: none; }
    .themes { grid-template-columns: repeat(3, 1fr); }
    .fonts { grid-template-columns: repeat(4, 1fr); }
    .privacy-points { grid-template-columns: repeat(2, 1fr); }
    .layout-families { grid-template-columns: 1fr; }
    .figures { grid-template-columns: repeat(5, 1fr); }
    .figures li:last-child { grid-column: auto; }
    .versus thead { display: table-header-group; }
    .versus th { text-align: left; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 0 18px 10px; }
    .versus th:last-child { color: var(--accent); }
    .versus tr { display: table-row; background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
    .versus td { display: table-cell; padding: 16px 18px; border-top: 1px solid var(--line); vertical-align: top; width: 50%; }
    .versus td:first-child { margin: 0; font-size: 1rem; }
    .versus td::before { display: none; }
    .versus td:first-child::before, .versus td:last-child::before { content: none; }
    .categories { grid-template-columns: repeat(2, 1fr); }
    .features.four { grid-template-columns: repeat(2, 1fr); }
    .composites { --cards: 2.4; --gaps: 2; }
}

@media (min-width: 960px) {
    body { font-size: 18px; }
    section { padding: 104px 0; }
    .hero { padding: 72px 0 0; }
    .hero .wrap { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
    .phone { margin: 0 0 -190px auto; }
    .family-layouts { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); overflow: visible; }
    .family[data-family="medium"] .family-layouts,
    .family[data-family="wide"] .family-layouts { grid-template-columns: repeat(4, 1fr); }
    .features { grid-template-columns: repeat(3, 1fr); }
    .themes { grid-template-columns: repeat(5, 1fr); }
    .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; }
    .split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
    .gallery { margin: 0; padding-left: 2px; padding-right: 2px; grid-auto-columns: 340px; }
    /* The examples run from the column's left edge, in line with the heading, to the window's
       right edge, where the cut card meets it rather than a margin. */
    .composites {
        --cards: 3.5; --gaps: 3;
        --visible: calc(min(100vw, var(--wrap)) - var(--gutter) + (100vw - min(100vw, var(--wrap))) / 2 - 2px);
        margin-right: calc((100% - 100vw) / 2); padding-right: var(--gutter);
        grid-auto-columns: calc((var(--visible) - var(--gaps) * 16px) / var(--cards));
    }
    /* ‹ on the column's edge, › on the window's, over the cut card. */
    .composites ~ .strip-arrow.back { left: -24px; }
    .composites ~ .strip-arrow.forward { right: calc((100% - 100vw) / 2 + 12px); }
    .categories { grid-template-columns: repeat(3, 1fr); }
    /* Wide is twice a Medium's width, so it takes two places in the strip. */
    .composites figure[data-size="wide"] { grid-column: span 2; }
    .features.four { grid-template-columns: repeat(4, 1fr); }
    .numbers { padding: 80px 0; }
    .figures b { font-size: 3.4rem; }
}
