/*
 * Third Slip - the home page.
 *
 * Builds on theme.css and declares no colour, radius or spacing value of its
 * own. If a component here needs a colour, it needs a token.
 */

main {
    max-width: none;
    padding: 0;
}

section {
    max-width: var(--page);
    margin: 0 auto;
    padding: var(--gap-7) var(--gutter);
}

.section-heading {
    max-width: 40ch;
    text-wrap: balance;
    margin: 0 auto var(--gap-3);
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-align: center;
}

.section-subheading {
    max-width: 54ch;
    text-wrap: pretty;
    margin: 0 auto var(--gap-6);
    color: var(--text-dim);
    font-size: 1.02rem;
    text-align: center;
}

.eyebrow {
    display: block;
    margin-bottom: var(--gap-3);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Apple's names are cased, and no styling rule outranks that: "IPHONE" and
   "CARPLAY" are misspellings. Any eyebrow naming a product uses this. */
.eyebrow.keeps-case {
    text-transform: none;
    letter-spacing: 0.06em;
}

/* -------------------------------------------------------------------- hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    align-items: center;
    gap: var(--gap-7);
    padding-top: var(--gap-7);
    padding-bottom: var(--gap-7);
}

.hero h1 {
    font-size: clamp(2.05rem, 5.2vw, 3.4rem);
    max-width: 15ch;
    text-wrap: balance;
}

.hero-lede .ball {
    color: var(--live);
    font-weight: 750;
}

.hero-lede {
    max-width: 46ch;
    margin-bottom: var(--gap-5);
    color: var(--text-dim);
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    line-height: 1.6;
}

.store-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--gap-3);
}

.store-badge {
    display: inline-flex;
    align-items: center;
    height: 54px;
}

.store-badge img {
    height: 100%;
    width: auto;
}

/* The App Store badge is a placeholder until the app has an id, so it is drawn
   rather than linked. Remove this rule with the real badge. */
.store-badge.is-placeholder {
    padding: 0 1.15rem;
    border: 1px dashed var(--line-2);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 650;
}

.platform-note {
    margin-top: var(--gap-3);
    color: var(--text-mute);
    font-size: 0.88rem;
}

.hero-links {
    margin-top: var(--gap-3);
    color: var(--text-mute);
    font-size: 0.9rem;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-2) var(--gap-4);
    margin-top: var(--gap-5);
    padding-top: var(--gap-4);
    border-top: 1px solid var(--line);
    list-style: none;
    color: var(--text-mute);
    font-size: 0.88rem;
}

.hero-proof li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-proof svg {
    flex: none;
}

/* ------------------------------------------------------------- the mock-up */

/* A Lock Screen drawn in CSS rather than photographed. It stands in for the
   real screenshot, and it is also the honest thing to show: this is the card
   the app actually puts on the Lock Screen. */
.phone {
    position: relative;
    width: min(320px, 100%);
    margin: 0 auto;
    padding: 0.6rem;
    border: 1px solid var(--line-2);
    border-radius: 44px;
    background: rgba(0, 0, 0, 0.35);
}

.phone-screen {
    display: flex;
    flex-direction: column;
    gap: var(--gap-5);
    aspect-ratio: 9 / 19.5;
    padding: 2.2rem 0.85rem 1.1rem;
    border-radius: 38px;
    background:
        radial-gradient(120% 45% at 50% 100%, rgba(46, 140, 58, 0.30), transparent 70%),
        linear-gradient(170deg, #08111F 0%, #123055 55%, #0B1A2C 100%);
    overflow: hidden;
}

.phone-clock {
    text-align: center;
    line-height: 1.1;
}

.phone-clock .date {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
    font-weight: 600;
}

.phone-clock .time {
    font-size: 3.4rem;
    font-weight: 300;
    letter-spacing: -0.04em;
}

/* The Live Activity card itself: format line, one row per innings, a state
   line underneath. The same hierarchy the widget draws. */
.activity {
    display: grid;
    gap: 0.6rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: rgba(8, 14, 24, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-2);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.activity-head .app {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--brand);
}

.activity-head img {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--live);
}

.live-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: var(--r-pill);
    background: var(--live);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot::before {
        animation: none;
    }
}

.innings {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--gap-3);
}

.innings .side {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.innings .bat {
    color: var(--brand);
}

.innings .score {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.innings .overs {
    margin-left: 0.3rem;
    color: var(--text-mute);
    font-size: 0.82rem;
    font-weight: 600;
}

.innings.is-done .side,
.innings.is-done .score {
    color: var(--text-dim);
    font-weight: 650;
}

.activity-state {
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
    color: var(--text-dim);
    font-size: 0.8rem;
}

.activity-state strong {
    color: var(--text);
    font-weight: 700;
}

.phone-caption {
    margin-top: var(--gap-3);
    color: var(--text-mute);
    font-size: 0.82rem;
    text-align: center;
}

/* ---------------------------------------------------------------- features */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--gap-4);
}

.feature-card {
    padding: var(--gap-5);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--surface);
}

.feature-card h3 {
    margin: var(--gap-4) 0 var(--gap-2);
    font-size: 1.05rem;
}

.feature-card p {
    color: var(--text-dim);
    font-size: 0.94rem;
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    border: 1px solid var(--brand-edge);
    background: var(--brand-wash);
}

.feature-icon.ball {
    border-color: var(--live-edge);
    background: var(--live-wash);
}

.feature-icon.turf {
    border-color: var(--turf-edge);
    background: var(--turf-wash);
}

/* ------------------------------------------------------------------- steps */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--gap-5);
    counter-reset: step;
}

.step {
    position: relative;
    padding-top: var(--gap-5);
    border-top: 2px solid var(--line);
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: calc(-1 * var(--gap-4));
    left: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: var(--r-pill);
    background: var(--brand);
    color: var(--on-brand);
    font-size: 0.9rem;
    font-weight: 800;
}

.step h3 {
    margin-bottom: var(--gap-2);
    font-size: 1.05rem;
}

.step p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* --------------------------------------------------------------- the Tests */

/* The one section that is an argument rather than a list: cricket is not a
   ninety-minute game, and a live score built for one does not fit it. */
.longform {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: var(--gap-7);
    padding: var(--gap-7) var(--gap-6);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--surface);
}

.longform h2 {
    max-width: 26ch;
    text-wrap: balance;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: var(--gap-4);
}

.longform p {
    max-width: 52ch;
    margin-bottom: var(--gap-4);
    color: var(--text-dim);
}

.longform p:last-child {
    margin-bottom: 0;
}

.longform strong {
    color: var(--text);
    font-weight: 700;
}

/* A day of a Test drawn as a timeline, so the claim beside it is visible
   rather than only asserted. */
.day-track {
    display: grid;
    gap: var(--gap-3);
    margin: 0;
    list-style: none;
}

.day-track li {
    display: grid;
    grid-template-columns: 4.6rem 1fr;
    align-items: center;
    gap: var(--gap-3);
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--bg-soft);
    font-size: 0.9rem;
}

.day-track .when {
    color: var(--text-mute);
    font-size: 0.82rem;
    font-weight: 650;
}

.day-track .what {
    color: var(--text-dim);
}

.day-track li.is-live {
    border-color: var(--live-edge);
    background: var(--live-wash);
}

.day-track li.is-live .what {
    color: var(--text);
    font-weight: 650;
}

.day-track li.is-off .what {
    color: var(--text-mute);
}

/* --------------------------------------------------------- the full list */

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap-4) var(--gap-6);
    margin: 0;
    list-style: none;
}

.feature-list li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: var(--gap-3);
    align-items: start;
}

.feature-list svg {
    margin-top: 0.2rem;
}

.feature-list h3 {
    margin-bottom: 0.15rem;
    font-size: 0.98rem;
}

.feature-list p {
    color: var(--text-dim);
    font-size: 0.92rem;
}

/* ------------------------------------------------------------ independence */

.independent {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--gap-5);
    align-items: start;
    padding: var(--gap-6);
    border: 1px solid var(--turf-edge);
    border-radius: var(--r-card);
    background: var(--turf-wash);
}

.independent h2 {
    margin-bottom: var(--gap-3);
    font-size: clamp(1.3rem, 2.6vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.025em;
}

/* A measure as well as balance. The card is wider than a line wants to be, and
   without a cap this sentence sets as one 109-character line on a desktop. The
   three "no X" clauses are bound with non-breaking spaces in the markup, so
   wherever it does break, it breaks between clauses rather than after "no". */
.independent p {
    max-width: 62ch;
    color: var(--text-dim);
    text-wrap: balance;
}

/* -------------------------------------------------------------- the gallery */

.gallery-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 260px);
    gap: var(--gap-4);
    padding-bottom: var(--gap-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.gallery-track figure {
    scroll-snap-align: start;
}

.gallery-track img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.gallery-track figcaption {
    margin-top: var(--gap-2);
    color: var(--text-mute);
    font-size: 0.85rem;
    text-align: center;
}

/* --------------------------------------------------------------------- FAQ */

.faq {
    max-width: 820px;
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-4);
    padding: var(--gap-4) 0;
    cursor: pointer;
    list-style: none;
}

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

.faq-item summary h3 {
    font-size: 1.02rem;
    font-weight: 650;
}

.faq-item summary::after {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-mute);
    border-bottom: 2px solid var(--text-mute);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.15s ease;
}

.faq-item[open] summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

.faq-item summary:hover h3 {
    color: var(--brand);
}

.faq-item > p {
    max-width: 68ch;
    padding-bottom: var(--gap-4);
    color: var(--text-dim);
}

/* --------------------------------------------------------------- final CTA */

.final-cta {
    text-align: center;
}

.final-cta h2 {
    max-width: 20ch;
    text-wrap: balance;
    margin: 0 auto var(--gap-3);
    font-size: clamp(1.6rem, 3.6vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.final-cta p {
    max-width: 46ch;
    margin: 0 auto var(--gap-5);
    color: var(--text-dim);
}

.final-cta .store-badges,
.final-cta .platform-note {
    justify-content: center;
    text-align: center;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
    section {
        padding-top: var(--gap-7);
        padding-bottom: var(--gap-7);
    }

    .hero,
    .longform {
        grid-template-columns: 1fr;
    }

    .hero {
        text-align: center;
    }

    .hero h1,
    .hero-lede {
        max-width: none;
    }

    .hero .store-badges,
    .hero-proof {
        justify-content: center;
    }

    .longform {
        padding: var(--gap-6) var(--gap-5);
    }

    .longform h2,
    .longform p {
        max-width: none;
    }

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

/* ------------------------------------------------------------- live strip */

/* Filled by functions/inject.js when there is cricket on; otherwise this is
   the authored note, which is why the section is styled either way. */
.score-strip {
    padding-top: 0;
    padding-bottom: 0;
}

.strip-note {
    padding: var(--gap-4) var(--gap-5);
    border: 1px dashed var(--line);
    border-radius: var(--r-card);
    color: var(--text-mute);
    font-size: 0.9rem;
    text-align: center;
}

/* A rail rather than a wrapping grid: the strip is a glance, and a second row
   of it is a section. */
.strip-track {
    display: flex;
    gap: var(--gap-3);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: var(--gap-3);
    scrollbar-width: thin;
}

.chip {
    display: block;
    flex: 0 0 auto;
    min-width: 11rem;
    padding: var(--gap-3) var(--gap-4);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: inherit;
    scroll-snap-align: start;
}

.chip:hover {
    border-color: var(--line-2);
    background: var(--surface-2);
    color: inherit;
}

.chip.is-live {
    border-color: var(--live-edge);
    background: var(--live-wash);
}

.chip-meta {
    display: block;
    margin-bottom: var(--gap-2);
    color: var(--text-mute);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chip-side {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--gap-3);
    color: var(--text-dim);
    font-size: 0.86rem;
}

.chip-side.is-batting {
    color: var(--text);
}

.chip-code {
    font-weight: 700;
}

.chip-score {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.chip-state {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: var(--gap-2);
    padding-top: var(--gap-2);
    border-top: 1px solid var(--line);
    color: var(--text-mute);
    font-size: 0.75rem;
}

.chip.is-live .chip-state {
    color: var(--live);
}

.chip .live-mark {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: var(--r-pill);
    background: var(--live);
    animation: pulse 2s ease-in-out infinite;
}

.strip-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--gap-4);
    margin-bottom: var(--gap-3);
    color: var(--text-mute);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.strip-heading a {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}
