:root {
    --primary: #E53935;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --text-muted: #6a6a6a;
    --gradient-start: #E53935;
    --gradient-end: #FF7043;
    --green: #4CAF50;
    --purple: #C062E8;
    --line: rgba(255, 255, 255, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: #FF8A65; }

/* Top navigation */
.topnav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topnav .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}
.topnav .brand img { width: 28px; height: 28px; border-radius: 7px; }
.topnav .links { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: flex-end; }
.topnav .links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
}
.topnav .links a:hover, .topnav .links a.current { color: var(--text-primary); }

/* Hero */
.hero {
    min-height: 88vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 1.5rem;
    background: radial-gradient(ellipse at 50% 0%, rgba(229, 57, 53, 0.15) 0%, transparent 60%);
}
.app-icon {
    width: 120px; height: 120px;
    border-radius: 26px;
    box-shadow: 0 20px 60px rgba(229, 57, 53, 0.4);
    margin-bottom: 2rem;
    animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-secondary);
    max-width: 680px;
    margin-bottom: 1rem;
    font-weight: 300;
}
.free-badge {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--green);
    margin-bottom: 2.5rem;
    letter-spacing: 0.5px;
}
.cta-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem; font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(229, 57, 53, 0.5); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid rgba(255, 255, 255, 0.1); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: rgba(255, 255, 255, 0.2); }
.apple-logo { width: 20px; height: 20px; }

/* Sections */
section { padding: 5rem 1.5rem; }
.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 1rem;
}
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 3.5rem;
    font-size: 1.08rem;
}
.tint { background: linear-gradient(180deg, transparent, rgba(229, 57, 53, 0.035), transparent); }

/* Screen rows: an iPhone capture beside its text */
.screen-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto 5rem;
}
.screen-row.flip { grid-template-columns: 1fr 300px; }
.screen-row.flip .phone { order: 2; }
.phone {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 44px;
    padding: 10px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
    justify-self: center;
    width: 100%;
    max-width: 300px;
}
.phone img { width: 100%; border-radius: 35px; display: block; }
.screen-text .kicker {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}
.screen-text h3 { font-size: 1.7rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.25; }
.screen-text p { color: var(--text-secondary); margin-bottom: 0.9rem; }
.screen-text ul { color: var(--text-secondary); padding-left: 1.2rem; }
.screen-text li { margin-bottom: 0.45rem; }
.screen-text strong { color: var(--text-primary); font-weight: 500; }

/* Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
    gap: 1.5rem;
    max-width: 1150px;
    margin: 0 auto;
}
.card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}
.grid.two { max-width: 820px; }
.card:hover { background: var(--bg-card-hover); border-color: rgba(229, 57, 53, 0.3); }
.card .icon { font-size: 1.6rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.6rem; }
.card p { color: var(--text-secondary); font-size: 0.95rem; }

/* A closer look: crops of the app's cards, as a mosaic */
.shots { columns: 3 300px; column-gap: 1.5rem; max-width: 1150px; margin: 0 auto; }
.shot { break-inside: avoid; margin: 0 0 1.8rem; display: inline-block; width: 100%; }
.shot img {
    width: 100%; display: block;
    border-radius: 18px;
    background: #f2f2f7;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.shot figcaption { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.8rem; }
.shot figcaption strong { color: var(--text-primary); font-weight: 500; }

/* Labs list */
.labs {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 0.8rem;
}
.lab {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--purple);
}
.lab b { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.lab span { color: var(--text-secondary); font-size: 0.9rem; }

/* Watch row */
.watch-row { display: flex; justify-content: center; align-items: flex-start; gap: 2.5rem; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; }
.watch-fig { margin: 0; width: 220px; text-align: center; }
.watch {
    background: linear-gradient(145deg, #3a3a3a, #161616);
    border-radius: 52px;
    padding: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.watch img { width: 100%; border-radius: 40px; display: block; background: #000; }
.watch-fig figcaption { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; }

/* Zones */
.zones-container { max-width: 860px; margin: 0 auto; }
.zone-item {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 0.9rem;
    border-left: 4px solid;
}
.zone-1 { border-color: #F44336; } .zone-2 { border-color: #FF9800; } .zone-3 { border-color: #FFC107; }
.zone-4 { border-color: #8BC34A; } .zone-5 { border-color: #2196F3; }
.zone-number {
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.zone-1 .zone-number { background: rgba(244, 67, 54, 0.2); color: #F44336; }
.zone-2 .zone-number { background: rgba(255, 152, 0, 0.2); color: #FF9800; }
.zone-3 .zone-number { background: rgba(255, 193, 7, 0.2); color: #FFC107; }
.zone-4 .zone-number { background: rgba(139, 195, 74, 0.2); color: #8BC34A; }
.zone-5 .zone-number { background: rgba(33, 150, 243, 0.2); color: #2196F3; }
.zone-info h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.15rem; }
.zone-info p { color: var(--text-secondary); font-size: 0.9rem; }

/* Tables */
.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 2rem; max-width: 1050px; margin: 0 auto; }
.table-container { overflow-x: auto; }
.table-container h3 { text-align: center; font-weight: 600; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 16px; overflow: hidden; }
th, td { padding: 0.75rem 0.9rem; text-align: center; font-size: 0.95rem; }
th { background: rgba(229, 57, 53, 0.1); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
td { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.poor { color: #F44336; } .fair { color: #FFC107; } .good { color: #8BC34A; } .excellent { color: #4CAF50; }
.table-note { color: var(--text-muted); font-size: 0.85rem; text-align: center; margin-top: 1.5rem; max-width: 760px; margin-left: auto; margin-right: auto; }

/* Long-form pages (methodology, references) */
.doc { max-width: 820px; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; margin-bottom: 0.8rem; }
.doc .lead { color: var(--text-secondary); font-size: 1.12rem; margin-bottom: 2.5rem; }
.doc h2 {
    font-size: 1.5rem; font-weight: 600;
    margin: 3rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}
.doc h3 { font-size: 1.12rem; font-weight: 600; margin: 1.8rem 0 0.6rem; }
.doc p, .doc li { color: #cfcfcf; }
.doc p { margin-bottom: 0.9rem; }
.doc ul, .doc ol { padding-left: 1.3rem; margin-bottom: 1rem; }
.doc li { margin-bottom: 0.4rem; }
.doc strong { color: var(--text-primary); font-weight: 600; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: #1c1c1c; padding: 0.1em 0.35em; border-radius: 5px; }
.doc .toc { background: var(--bg-card); border-radius: 16px; padding: 1.3rem 1.6rem; margin-bottom: 1rem; }
.doc .toc ol { margin: 0; }
.doc .toc a { color: var(--text-secondary); text-decoration: none; }
.doc .toc a:hover { color: var(--text-primary); }
.doc .note {
    background: var(--bg-card);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin: 1.2rem 0;
    color: var(--text-secondary);
}
.doc table { margin: 1rem 0 1.4rem; display: block; overflow-x: auto; }
.doc td, .doc th { text-align: left; vertical-align: top; }
.doc td:first-child { min-width: 10rem; }
.ref { margin-bottom: 1.1rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.ref .t { color: var(--text-primary); font-weight: 500; }
.ref .a { color: var(--text-secondary); font-size: 0.93rem; }
.ref .u { color: var(--text-muted); font-size: 0.88rem; }

/* Footer */
footer { padding: 3.5rem 1.5rem; text-align: center; border-top: 1px solid var(--line); }
.footer-logo { width: 56px; height: 56px; border-radius: 13px; margin-bottom: 1.2rem; }
footer h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
footer p { color: var(--text-secondary); margin-bottom: 1.6rem; }
.footer-links { display: flex; justify-content: center; gap: 1.8rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.copyright { color: var(--text-muted); font-size: 0.85rem; }

/* Scroll animation */
.fade-in { opacity: 0; transform: translateY(24px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1; transform: none; transition: none; }
    .app-icon { animation: none; }
}

@media (max-width: 820px) {
    .screen-row, .screen-row.flip { grid-template-columns: 1fr; gap: 2rem; margin-bottom: 4rem; }
    .screen-row.flip .phone { order: 0; }
    .phone { max-width: 260px; }
    .zone-item { flex-direction: column; text-align: center; }
    .topnav .links { gap: 0.8rem; }
    .topnav .links a { font-size: 0.85rem; }
    .tables { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .topnav .brand span { display: none; }
}

/* iPhone Duo ------------------------------------------------------------ */
.duo-section { background: radial-gradient(ellipse at 50% 0%, rgba(0, 188, 212, 0.10) 0%, transparent 65%); }
.duo-badge { display: table; margin: 0 auto 1rem; padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #00BCD4; border: 1px solid rgba(0, 188, 212, 0.45); background: rgba(0, 188, 212, 0.08); }
.duo-row { display: flex; justify-content: center; align-items: flex-end; gap: 2.5rem; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; }
.duo-fig { margin: 0; text-align: center; }
.duo-fig figcaption { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; }
.duo-closed { width: min(240px, 100%); }
.duo-open { width: min(700px, 100%); }
.duo-wide { width: min(900px, 100%); margin: 3rem auto 0; }
.duo-device { background: #1d1d1f; padding: 10px; box-shadow: 0 0 0 1px #3a3a3c, 0 30px 80px rgba(0, 0, 0, 0.55); }
.duo-device.closed { border-radius: 34px; }
.duo-device.open { border-radius: 30px; position: relative; }
.duo-device.open::after { content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 1px; background: rgba(255, 255, 255, 0.06); }
.duo-device img { display: block; width: 100%; height: auto; }
.duo-device.closed img { border-radius: 25px; }
.duo-device.open img { border-radius: 21px; }
