/* Mihrab landing page. Colours are the app's own (Shared/Theme.swift). */
:root {
    --teal: #0a4040;
    --teal-deep: #062c2d;
    --ivory: #f7f2e8;
    --paper: #fcfaf5;
    --ink: #10201f;
    --ink-soft: #4d5b58;
    --gold: #a67d42;
    --card-gold: #c9a46a;
    --next-gold: #f3d48e;
    --caption-ivory: #fff3d6;
    --facing-green: #3ccb7f;
    --line: #e2d8c4;
    --measure: 34rem;
    --gutter: clamp(1.25rem, 5vw, 3rem);
    --wide: 68rem;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ivory);
    color: var(--ink);
    font-family: system-ui, -apple-system, "SF Pro Text", "SF Arabic", "Segoe UI", "Noto Sans", "Noto Sans Arabic", sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--teal);
    text-underline-offset: 0.18em;
}

:focus-visible {
    outline: 3px solid var(--card-gold);
    outline-offset: 3px;
    border-radius: 4px;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: -0.025em;
    font-weight: 700;
    text-wrap: balance;
}

/* Arabic is never tracked, and needs more room between lines. */
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3 {
    letter-spacing: 0;
    line-height: 1.35;
}

:lang(ar) body {
    line-height: 1.85;
}

p {
    margin: 0;
}

.wrap {
    max-width: var(--wide);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(170deg, var(--teal) 0%, var(--teal-deep) 100%);
}

/* The app's star pattern, strongest in the top corner and gone by the middle. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("assets/stars-gold.svg") 0 0 / 53.113px;
    opacity: 0.34;
    -webkit-mask-image: radial-gradient(90% 80% at 100% 0%, #000 0%, transparent 70%);
    mask-image: radial-gradient(90% 80% at 100% 0%, #000 0%, transparent 70%);
    pointer-events: none;
}

[dir="rtl"] .hero::before {
    -webkit-mask-image: radial-gradient(90% 80% at 0% 0%, #000 0%, transparent 70%);
    mask-image: radial-gradient(90% 80% at 0% 0%, #000 0%, transparent 70%);
}

.hero > * {
    position: relative;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-weight: 650;
    font-size: 1.15rem;
    text-decoration: none;
}

.brand svg {
    width: 1.75rem;
    height: 2.1rem;
}

.lang {
    color: var(--caption-ivory);
    font-size: 1rem;
    padding: 0.4rem 0.2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2rem;
    align-items: center;
    min-height: min(44rem, 88vh);
}

.hero-copy {
    padding-block: 3rem 5rem;
}

.hero h1 {
    font-size: clamp(2.75rem, 6.4vw, 4.75rem);
    letter-spacing: -0.035em;
    max-width: 11ch;
}

:lang(ar) .hero h1 {
    max-width: 12ch;
}

.hero-lede {
    margin-top: 1.5rem;
    max-width: 30rem;
    font-size: 1.25rem;
    line-height: 1.5;
    color: rgb(255 255 255 / 0.84);
}

:lang(ar) .hero-lede {
    line-height: 1.8;
}

.store {
    display: inline-flex;
    flex-direction: column;
    margin-top: 2.25rem;
    padding: 0.7rem 1.5rem 0.8rem;
    border-radius: 0.9rem;
    background: var(--next-gold);
    color: var(--teal-deep);
    text-decoration: none;
    line-height: 1.2;
    transition: background-color 0.15s ease;
}

.store:hover {
    background: #ffe7b0;
}

.store small {
    font-size: 0.8rem;
    font-weight: 500;
}

.store strong {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

:lang(ar) .store strong {
    letter-spacing: 0;
}

.hero-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: rgb(255 255 255 / 0.62);
}

.hero-devices {
    position: relative;
    align-self: end;
    justify-self: center;
    width: min(100%, 20rem);
    margin-bottom: -7rem;
}

/* ---------- Devices ---------- */

.phone {
    padding: 0.55rem;
    border-radius: 2.9rem;
    background: #0b1413;
    box-shadow:
        0 0 0 1px rgb(255 255 255 / 0.08) inset,
        0 2rem 4rem -1.5rem rgb(3 24 24 / 0.55);
}

.phone img {
    width: 100%;
    border-radius: 2.4rem;
}

/* A phone that runs off the bottom of its frame: only the top of the screen matters. */
.phone-cut {
    padding-bottom: 0;
    border-end-start-radius: 0;
    border-end-end-radius: 0;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08) inset;
    -webkit-mask-image: linear-gradient(#000 78%, transparent);
    mask-image: linear-gradient(#000 78%, transparent);
}

.phone-cut img {
    border-end-start-radius: 0;
    border-end-end-radius: 0;
}

.watch {
    padding: 0.5rem;
    border-radius: 2.1rem;
    background: #0b1413;
    box-shadow:
        0 0 0 1px rgb(255 255 255 / 0.1) inset,
        0 1.5rem 3rem -1rem rgb(3 24 24 / 0.6);
}

.watch img {
    width: 100%;
    border-radius: 1.65rem;
}

.hero-devices .watch {
    position: absolute;
    inset-inline-start: -8rem;
    top: 50%;
    width: 10rem;
}

/* ---------- Features ---------- */

.features {
    padding-block: clamp(4rem, 10vw, 8rem) 0;
}

.feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.feature + .feature {
    margin-top: clamp(4.5rem, 11vw, 9rem);
}

.feature:nth-child(even) .feature-shot {
    order: -1;
}

.feature h2 {
    font-size: clamp(1.9rem, 3.8vw, 2.75rem);
    color: var(--teal);
    max-width: 16ch;
}

.feature p {
    margin-top: 1.25rem;
    max-width: var(--measure);
    color: var(--ink-soft);
}

.feature p + p {
    margin-top: 0.9rem;
}

.feature-shot {
    position: relative;
    justify-self: center;
    width: min(100%, 18.5rem);
}

.feature-shot .watch {
    position: absolute;
    inset-inline-end: -4.5rem;
    bottom: 2.5rem;
    width: 9.5rem;
    box-shadow:
        0 0 0 1px rgb(255 255 255 / 0.1) inset,
        0 1.5rem 3rem -1rem rgb(16 32 31 / 0.45);
}

/* Two watches side by side, for the feature that has no phone screen. */
.watch-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: min(100%, 24rem);
}

.watch-pair .watch {
    position: static;
    width: auto;
}

.watch-pair .watch:last-child {
    margin-top: 2.5rem;
}

/* ---------- Details ---------- */

.details {
    margin-top: clamp(5rem, 11vw, 9rem);
    padding-block: 3rem;
    border-block: 1px solid var(--line);
}

.details ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.details h3 {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--teal);
}

.details p {
    margin-top: 0.4rem;
    font-size: 0.98rem;
    color: var(--ink-soft);
}

/* ---------- Privacy ---------- */

.privacy {
    margin-top: clamp(4rem, 9vw, 7rem);
    padding: clamp(2.5rem, 6vw, 4.5rem);
    border-radius: 2rem;
    background: var(--teal);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.privacy::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("assets/stars-gold.svg") 0 0 / 53.113px;
    opacity: 0.22;
    -webkit-mask-image: radial-gradient(60% 90% at 100% 100%, #000, transparent 75%);
    mask-image: radial-gradient(60% 90% at 100% 100%, #000, transparent 75%);
}

[dir="rtl"] .privacy::before {
    -webkit-mask-image: radial-gradient(60% 90% at 0% 100%, #000, transparent 75%);
    mask-image: radial-gradient(60% 90% at 0% 100%, #000, transparent 75%);
}

.privacy > * {
    position: relative;
}

.privacy h2 {
    font-size: clamp(1.9rem, 3.8vw, 2.75rem);
    max-width: 18ch;
}

.privacy p {
    margin-top: 1.25rem;
    max-width: 38rem;
    color: rgb(255 255 255 / 0.84);
}

.privacy a {
    color: var(--next-gold);
}

/* ---------- Suggestions ---------- */

.suggest {
    padding-block: clamp(4.5rem, 10vw, 8rem);
}

.suggest h2 {
    font-size: clamp(1.9rem, 3.8vw, 2.75rem);
    color: var(--teal);
}

.suggest p {
    margin-top: 1.25rem;
    max-width: var(--measure);
    color: var(--ink-soft);
}

.mail {
    display: inline-block;
    margin-top: 1.75rem;
    font-size: clamp(1.5rem, 4.4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--teal);
    text-decoration-color: var(--card-gold);
    text-decoration-thickness: 0.09em;
    text-underline-offset: 0.22em;
}

.mail:hover {
    text-decoration-color: var(--teal);
}

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

.footer {
    padding-block: 2.5rem 3.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    align-items: baseline;
    justify-content: space-between;
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.footer p + p {
    margin-top: 0.75rem;
    max-width: 44rem;
}

/* ---------- Privacy policy page ---------- */

.plainbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.plainbar .brand {
    color: var(--teal);
}

.plainbar .lang {
    color: var(--teal);
}

.policy {
    max-width: 40rem;
    padding-block: clamp(3rem, 8vw, 5rem);
}

.policy h1 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    color: var(--teal);
}

.policy h2 {
    margin-top: 2.5rem;
    font-size: 1.35rem;
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--teal);
}

.policy p,
.policy ul {
    margin-top: 0.9rem;
}

.policy ul {
    padding-inline-start: 1.25rem;
}

.policy li + li {
    margin-top: 0.4rem;
}

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

/* ---------- Narrow screens ---------- */

@media (max-width: 52rem) {
    .hero-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-copy {
        padding-block: 2rem 3rem;
    }

    .hero-devices {
        width: min(72%, 17rem);
        margin-inline-start: auto;
        margin-inline-end: 6%;
        margin-bottom: -6rem;
    }

    .hero-devices .watch {
        inset-inline-start: -6.5rem;
        width: 8.5rem;
    }

    .feature {
        grid-template-columns: 1fr;
    }

    .feature:nth-child(even) .feature-shot {
        order: 0;
    }

    .feature-shot {
        width: min(74%, 17rem);
    }

    .feature-shot.has-watch {
        justify-self: start;
        margin-inline-start: 4%;
    }

    .feature-shot .watch {
        inset-inline-end: -4rem;
        width: 8rem;
    }

    .watch-pair {
        width: min(100%, 22rem);
    }

    .details ul {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .privacy {
        border-radius: 1.5rem;
    }
}

@media (min-width: 52.01rem) and (max-width: 64rem) {
    .details ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}
