/* Safari has SF Pro Rounded, the app's own rounded type, as ui-rounded. Other browsers don't,
   so they get Nunito, which is close. Safari never downloads it. */
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 500 900;
    font-display: swap;
    src: url("fonts/nunito-latin.woff2") format("woff2");
}

/* The icon's sky, from AppIcon.icon, and the app's blue, from Theme.swift */
:root {
    --sky-top: #3dd3ff;
    --sky-bottom: #0096fa;
    --page: #f3f9fe;
    --ink: #04253f;
    --muted: #3f5b73;
    /* Theme.blue: the Left and Right buttons. White on it is 4.6:1 */
    --blue: #0f78cf;
    /* Theme.accent */
    --accent: #0f78cf;
    /* The big "Left" or "Right", on the sky */
    --answer: #04253f;
    --link: #0a5ea6;
    --rule: rgba(4, 37, 63, 0.14);
    --panel: #ffffff;
    --pill: rgba(255, 255, 255, 0.86);
    --wrap: 1080px;
    --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
    --rounded: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color-scheme: light dark;
}

/* The icon's dark gradient and the app's night colours, for anyone reading this at 3am */
@media (prefers-color-scheme: dark) {
    :root {
        --sky-top: #004573;
        --sky-bottom: #001c38;
        --page: #000a14;
        --ink: #ffffff;
        --muted: rgba(255, 255, 255, 0.74);
        --accent: #40a3ff;
        --answer: #40a3ff;
        --link: #7cc2ff;
        --rule: rgba(255, 255, 255, 0.16);
        --panel: rgba(255, 255, 255, 0.06);
        --pill: rgba(255, 255, 255, 0.12);
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.doc {
    --wrap: 720px;
}

a {
    color: var(--link);
}

img {
    max-width: 100%;
}

h1,
h2,
h3 {
    font-family: var(--rounded);
    text-wrap: balance;
}

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

.wrap {
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.sky {
    background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}

/* Home: the page's title is the question, and the big word under it is the answer, as in the app */

.top__inner {
    display: grid;
    gap: 20px;
    padding-top: max(36px, env(safe-area-inset-top));
    padding-bottom: 56px;
}

/* So the icon itself is the grid item, not the <picture> that picks light or dark */
.top__inner > picture {
    display: contents;
}

.top__icon {
    width: 84px;
    height: 84px;
    filter: drop-shadow(0 8px 14px rgba(0, 40, 90, 0.3));
}

@media (min-width: 880px) {
    .top__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 48px;
        padding-top: 72px;
        padding-bottom: 88px;
    }

    .top__text {
        grid-column: 1;
        grid-row: 1;
    }

    .top__icon {
        grid-column: 2;
        grid-row: 1;
        width: 300px;
        height: 300px;
        filter: drop-shadow(0 26px 34px rgba(0, 40, 90, 0.35));
    }
}

.top h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 0 0 22px;
}

.answer {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.answer__label {
    font-family: var(--rounded);
    font-size: 1.35rem;
    font-weight: 700;
}

.answer__side {
    font-family: var(--rounded);
    font-size: clamp(6rem, 30vw, 11rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.035em;
    color: var(--answer);
    margin: 0 0 12px -0.04em;
}

.answer__side.is-changing {
    animation: swap 0.3s ease-out;
}

@keyframes swap {
    from {
        opacity: 0;
        transform: translateY(0.08em);
    }
}

.answer__last {
    font-size: 1.2rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.log {
    max-width: 440px;
    margin-top: 28px;
}

.log-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Theme.blue, the way .glassProminent fills it: flat, with a light top edge */
.side-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 0 10px;
    font-family: var(--rounded);
    font-size: clamp(1.15rem, 4.6vw, 1.35rem);
    font-weight: 700;
    color: #ffffff;
    background: var(--blue);
    border: 0;
    border-radius: 30px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 40, 90, 0.25);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.12s ease;
}

.side-button svg {
    flex: none;
    width: 17px;
    height: 17px;
}

.side-button:hover {
    background: #0d6dbd;
}

.side-button:active {
    transform: scale(0.97);
}

.side-button:focus-visible {
    border-radius: 30px;
}

/* Stacked when two across won't fit, like the app at the biggest text sizes */
@media (max-width: 359px) {
    .log-buttons {
        grid-template-columns: 1fr;
    }

    .side-button {
        min-height: 68px;
    }
}

.undo-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0 6px 0 16px;
    min-height: 52px;
    border-radius: 999px;
    background: var(--pill);
    font-size: 0.98rem;
    font-weight: 500;
}

.undo-pill[hidden] {
    display: none;
}

.undo-pill__tick {
    flex: none;
    width: 22px;
    height: 22px;
}

.undo-pill__text {
    flex: 1;
}

.undo-pill button {
    font: inherit;
    font-weight: 700;
    color: var(--link);
    background: none;
    border: 0;
    padding: 0 14px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
    cursor: pointer;
}

.try-note {
    margin: 12px 0 0;
    font-size: 0.95rem;
}

.lede {
    font-size: 1.15rem;
    max-width: 30em;
    margin: 36px 0 22px;
}

.app-store {
    display: inline-block;
    border-radius: 12px;
}

.app-store img {
    display: block;
    width: 180px;
    height: auto;
}

/* Screenshots */

.screens {
    padding: 48px 0 0;
}

/* A scrolling row clips whatever spills out of it, so its padding leaves room for the frames' edges and shadows */
.screens__row {
    display: flex;
    align-items: center;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 12px var(--gutter) 44px;
    scrollbar-width: none;
}

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

.screens__row:focus-visible {
    outline-offset: -3px;
    border-radius: 24px;
}

/* An iPhone: black bezel, a thin titanium edge, and the buttons down each side. Sizes follow the screen's width */
.phone {
    --screen: min(240px, 62vw);
    --bezel: calc(var(--screen) * 0.036);
    position: relative;
    flex: 0 0 auto;
    padding: var(--bezel);
    border-radius: calc(var(--screen) * 0.135 + var(--bezel));
    background: #0a0a0b;
    box-shadow:
        0 0 0 1.5px #4a4a50,
        0 0 0 3px #1c1c1f,
        0 22px 40px -22px rgba(0, 40, 90, 0.5);
    scroll-snap-align: center;
}

.phone img {
    display: block;
    width: var(--screen);
    height: auto;
    border-radius: calc(var(--screen) * 0.135);
}

/* Action button and volume on the left, side button on the right */
.phone::before,
.phone::after {
    content: "";
    position: absolute;
    width: 3px;
    background: #3a3a3f;
}

.phone::before {
    left: -6px;
    top: 17%;
    height: 5%;
    border-radius: 2px 0 0 2px;
    box-shadow:
        0 calc(var(--screen) * 0.17) 0 #3a3a3f,
        0 calc(var(--screen) * 0.34) 0 #3a3a3f;
}

.phone::after {
    right: -6px;
    top: 26%;
    height: 10%;
    border-radius: 0 2px 2px 0;
}

/* An Apple Watch: black glass in an aluminium case, the Digital Crown and side button, and a sport band */
.watch {
    --screen: min(200px, 52vw);
    position: relative;
    flex: 0 0 auto;
    padding: calc(var(--screen) * 0.3) 0;
    scroll-snap-align: center;
}

/* The band, narrower than the case and fading out at both ends */
.watch::before {
    content: "";
    position: absolute;
    inset: 0 calc(var(--screen) * 0.16);
    border-radius: calc(var(--screen) * 0.06);
    background: linear-gradient(90deg, #22354a, #31506e 50%, #22354a);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
}

.watch__case {
    position: relative;
    padding: calc(var(--screen) * 0.06);
    border-radius: calc(var(--screen) * 0.27);
    background: #000;
    box-shadow:
        0 0 0 calc(var(--screen) * 0.035) #34343a,
        0 0 0 calc(var(--screen) * 0.035 + 1px) #5a5a61,
        0 22px 40px -22px rgba(0, 40, 90, 0.5);
}

.watch__case img {
    display: block;
    width: var(--screen);
    height: auto;
    border-radius: calc(var(--screen) * 0.21);
}

/* The Digital Crown, ridged, and the flat side button below it */
.watch__case::before,
.watch__case::after {
    content: "";
    position: absolute;
}

.watch__case::before {
    right: calc(var(--screen) * -0.075);
    top: 22%;
    width: calc(var(--screen) * 0.04);
    height: 17%;
    border-radius: 0 4px 4px 0;
    background: repeating-linear-gradient(to bottom, #707078 0 1.5px, #3a3a40 1.5px 3px);
}

.watch__case::after {
    right: calc(var(--screen) * -0.055);
    top: 50%;
    width: calc(var(--screen) * 0.02);
    height: 24%;
    border-radius: 0 3px 3px 0;
    background: #3a3a40;
}

/* All five fit across a wide window, so they sit still in the middle rather than cut off at the edge */
@media (min-width: 1420px) {
    .screens__row {
        justify-content: center;
    }
}

/* What's in it, in the App Store description's own words */

.details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 36px 44px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.details__group {
    border-top: 3px solid var(--accent);
    padding-top: 14px;
}

.details h2 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
}

.details h2 + ul + h2 {
    margin-top: 28px;
}

.details ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.details li {
    position: relative;
    padding-left: 18px;
    color: var(--muted);
}

.details li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.details li + li {
    margin-top: 8px;
}

.promise {
    margin-top: 40px;
    padding-bottom: 8px;
}

/* The rule lines up with the text, not the page's side gutters */
.promise::before {
    content: "";
    display: block;
    border-top: 1px solid var(--rule);
    margin-bottom: 32px;
}

.promise p {
    margin: 0 0 8px;
    max-width: 34em;
}

.promise__headline {
    font-family: var(--rounded);
    font-size: clamp(1.3rem, 3.6vw, 1.55rem);
    font-weight: 700;
    line-height: 1.3;
    text-wrap: balance;
}

.promise__family {
    margin-top: 24px !important;
    color: var(--muted);
}

/* Questions: every answer stays open, so what you read is what a search engine reads */

.questions,
.guides {
    padding-top: 40px;
}

.questions > h2,
.guides > h2 {
    font-size: clamp(1.6rem, 4.6vw, 2rem);
    font-weight: 800;
    margin: 0 0 8px;
}

.questions__item {
    max-width: 46em;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
}

.questions__item h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
}

.questions__item p {
    margin: 0;
    color: var(--muted);
}

.questions__item .questions__more {
    margin-top: 8px;
}

.guides ul {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
}

.guides a {
    display: block;
    height: 100%;
    padding: 18px 22px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--rule);
    text-decoration: none;
}

.guides a:hover {
    border-color: var(--accent);
}

.guides__title {
    display: block;
    font-family: var(--rounded);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink);
}

.guides__text {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 36px;
    padding-bottom: calc(36px + env(safe-area-inset-bottom));
}

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

footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* Privacy policy and support */

.band__inner {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: 40px;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--rounded);
    font-size: 1.1rem;
    font-weight: 700;
}

.home-link img {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 3px 6px rgba(0, 40, 90, 0.3));
}

.band h1 {
    font-size: clamp(2.3rem, 7vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin: 44px 0 0;
}

.policy-content {
    padding-top: 32px;
    padding-bottom: 16px;
}

.policy-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 40px 0 8px;
    color: var(--accent);
}

.policy-content h3 {
    font-size: 1.12rem;
    font-weight: 700;
    margin: 26px 0 4px;
}

.policy-content p,
.policy-content li {
    color: var(--muted);
}

.policy-content strong {
    color: var(--ink);
}

.policy-content ul,
.policy-content ol {
    padding-left: 22px;
}

/* Guides */

.band__lede {
    max-width: 34em;
    margin: 12px 0 20px;
    font-size: 1.15rem;
    color: var(--ink);
}

.guide__checked {
    margin-top: 36px;
    padding: 16px 20px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--rule);
}

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

.summary {
    margin: 0 0 8px;
    padding: 20px 24px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--rule);
}

.summary p {
    margin: 0;
    color: var(--ink);
    font-size: 1.1rem;
}

.summary p + p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 1rem;
}

.contact-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
}

.contact-card > div {
    flex: 1 1 300px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    font-family: var(--rounded);
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    text-decoration: none;
    background: var(--blue);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button:hover {
    background: #0d6dbd;
}

.button:focus-visible {
    border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
    .answer__side.is-changing {
        animation: none;
    }

    .side-button {
        transition: none;
    }
}
