/* ============================================================
   SnapVerse — "Stained Glass" design system
   Palette and geometry derive from the app icon: an open book
   in faceted glass — warm panes on the left page, cool panes on
   the right, a cross in the leading, on a deep indigo field.
   ============================================================ */

/* ---------- Fonts (self-hosted, no CDN) ---------- */
@font-face {
    font-family: "Fraunces";
    src: url("../assets/fonts/fraunces-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Fraunces";
    src: url("../assets/fonts/fraunces-italic-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    /* Canvas */
    --indigo-950: #120C2E;
    --indigo-900: #1A1140;   /* page canvas */
    --indigo-850: #201649;
    --indigo-800: #241850;   /* app theme indigo */
    --indigo-700: #2F2163;

    /* Stained glass — warm (left page of the icon) */
    --gold:  #F5C51D;
    --amber: #F09E3C;
    --ember: #E98B56;        /* app theme sunset */
    --coral: #F98C86;        /* app theme highlight */

    /* Stained glass — cool (right page of the icon) */
    --teal: #2DE1C2;
    --cyan: #3EC4EC;
    --blue: #4A7FE8;

    /* Interactive */
    --lavender: #B084FF;     /* app AccentColor */
    --violet:   #7A4DE0;

    /* Text on indigo */
    --text:   #F4F0FF;
    --text-2: #C3B8E4;
    --text-3: #9386BE;
    --line:   rgba(176, 132, 255, 0.16);

    /* Document sheet (legal pages) */
    --paper:      #FBF7EF;
    --paper-edge: #EFE7D8;
    --ink:        #2B2145;
    --ink-2:      #5A4E7E;

    --serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

    --max-width: 1120px;
    --radius-card: 20px;
    --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    color: var(--text);
    background-color: var(--indigo-900);
    background-image:
        radial-gradient(1100px 520px at 82% -6%, rgba(122, 77, 224, 0.28), transparent 62%),
        radial-gradient(900px 480px at -12% 14%, rgba(233, 139, 86, 0.12), transparent 58%),
        radial-gradient(1200px 800px at 50% 118%, var(--indigo-950), transparent 70%);
    background-attachment: fixed;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img, svg { max-width: 100%; display: block; }

a { color: var(--lavender); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

::selection { background: rgba(176, 132, 255, 0.35); }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.skip-link {
    position: absolute;
    left: 1rem; top: -3rem;
    background: var(--lavender);
    color: var(--indigo-950);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    z-index: 100;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 560; line-height: 1.08; letter-spacing: -0.012em; text-wrap: balance; }

.eyebrow {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}
.eyebrow .tick { color: var(--gold); }

.section-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
.section-sub {
    color: var(--text-2);
    font-size: 1.075rem;
    max-width: 40rem;
    margin-top: 0.9rem;
}

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(22, 14, 53, 0.78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand svg, .brand .brand-logo { width: 34px; height: 34px; }
.brand .brand-snap  { color: var(--ember); }
.brand .brand-a     { color: var(--text-3); font-weight: 600; }
.brand .brand-verse { color: var(--cyan); }

.nav-links {
    display: flex;
    gap: 1.6rem;
    margin-left: auto;
    list-style: none;
}
.nav-links a {
    color: var(--text-2);
    font-size: 0.95rem;
    font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav .btn-store { margin-left: 0.4rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 1.6rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
    background: var(--lavender);
    color: var(--indigo-950);
    box-shadow: 0 8px 28px rgba(176, 132, 255, 0.28);
}
.btn-primary:hover { background: #C29DFF; box-shadow: 0 10px 34px rgba(176, 132, 255, 0.38); }

.btn-ghost {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* Apple App Store badge (drawn, official proportions) */
.btn-store {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: #000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 12px;
    padding: 0.55rem 1.1rem 0.6rem;
    line-height: 1.15;
    transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn-store:hover { text-decoration: none; transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.6); }
.btn-store svg { width: 26px; height: 26px; flex: none; }
.btn-store .store-text { display: flex; flex-direction: column; text-align: left; }
.btn-store .store-small { font-size: 0.62rem; letter-spacing: 0.02em; opacity: 0.85; }
.btn-store .store-big { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Sections rhythm ---------- */
.section { padding: 5.5rem 0; }
.section-tight { padding: 3.5rem 0; }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 3rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.7rem, 6vw, 4.35rem);
    font-weight: 580;
    margin: 1.1rem 0 1.3rem;
}
.hero h1 em {
    font-style: italic;
    font-weight: 480;
    background: linear-gradient(100deg, var(--gold) 0%, var(--ember) 45%, var(--coral) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero .lead {
    font-size: 1.16rem;
    color: var(--text-2);
    max-width: 34rem;
    margin-bottom: 2rem;
}
.hero .lead strong { color: var(--text); font-weight: 600; }

.hero-ctas { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }

.hero-facts {
    margin-top: 1.4rem;
    display: flex;
    gap: 0.55rem 1.4rem;
    flex-wrap: wrap;
    list-style: none;
    color: var(--text-3);
    font-size: 0.92rem;
}
.hero-facts li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-facts svg { width: 15px; height: 15px; flex: none; }

/* The window scene — the page's signature */
.window-scene {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 0;
}
.hero-logo {
    width: min(400px, 86%);
    filter: drop-shadow(0 28px 64px rgba(10, 6, 30, 0.6)) drop-shadow(0 0 46px rgba(176, 132, 255, 0.22));
}
.window-glow {
    position: absolute;
    inset: -12% -20%;
    background:
        radial-gradient(46% 38% at 62% 30%, rgba(245, 197, 29, 0.16), transparent 68%),
        radial-gradient(50% 42% at 38% 34%, rgba(45, 225, 194, 0.13), transparent 70%);
    pointer-events: none;
}

/* light rays falling from the window toward the headline */
.hero-rays {
    position: absolute;
    top: -6rem;
    right: -4rem;
    width: 68rem;
    height: 44rem;
    transform: rotate(-14deg);
    background:
        linear-gradient(103deg, transparent 41.2%, rgba(245, 197, 29, 0.075) 41.4%, rgba(245, 197, 29, 0.075) 45.8%, transparent 46%),
        linear-gradient(103deg, transparent 51.2%, rgba(176, 132, 255, 0.06) 51.5%, rgba(176, 132, 255, 0.06) 57.8%, transparent 58%),
        linear-gradient(103deg, transparent 63.2%, rgba(45, 225, 194, 0.05) 63.5%, rgba(45, 225, 194, 0.05) 67.8%, transparent 68%);
    pointer-events: none;
}

/* ---------- Scripture band ---------- */
.scripture {
    padding: 4.5rem 0;
    text-align: center;
    position: relative;
}
.scripture blockquote {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 440;
    font-size: clamp(1.5rem, 3.4vw, 2.4rem);
    line-height: 1.35;
    max-width: 46rem;
    margin: 0 auto;
    color: var(--text);
}
.scripture blockquote .light-word {
    background: linear-gradient(95deg, var(--gold), var(--ember));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.scripture cite {
    display: block;
    margin-top: 1.2rem;
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.85rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.rule-glass {
    height: 1px;
    max-width: var(--max-width);
    margin: 0 auto;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--ember) 25%, var(--lavender) 50%, var(--teal) 75%, transparent);
    opacity: 0.4;
}

/* ---------- Feature cards ---------- */
.features-grid {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 1.7rem 1.6rem 1.8rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(176, 132, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
}
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--facet, var(--lavender));
    opacity: 0.85;
}

.card .card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--facet, var(--lavender)) 14%, transparent);
    margin-bottom: 1.1rem;
}
.card .card-icon svg { width: 22px; height: 22px; stroke: var(--facet, var(--lavender)); }

.card h3 { font-size: 1.22rem; margin-bottom: 0.5rem; font-weight: 540; }
.card p { color: var(--text-2); font-size: 0.97rem; }

.facet-gold  { --facet: var(--gold); }
.facet-amber { --facet: var(--amber); }
.facet-ember { --facet: var(--ember); }
.facet-coral { --facet: var(--coral); }
.facet-teal  { --facet: var(--teal); }
.facet-cyan  { --facet: var(--cyan); }
.facet-lav   { --facet: var(--lavender); }

/* ---------- How it works ---------- */
.steps {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    counter-reset: step;
}
.step {
    position: relative;
    padding: 1.6rem 1.5rem 1.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
}
.step::before {
    counter-increment: step;
    content: counter(step);
    font-family: var(--serif);
    font-weight: 560;
    font-size: 1.05rem;
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    color: var(--indigo-950);
    background: linear-gradient(135deg, var(--gold), var(--ember));
    margin-bottom: 1rem;
}
.step:nth-child(2)::before { background: linear-gradient(135deg, var(--coral), var(--lavender)); }
.step:nth-child(3)::before { background: linear-gradient(135deg, var(--teal), var(--cyan)); }
.step h3 { font-size: 1.18rem; margin-bottom: 0.45rem; font-weight: 540; }
.step p { color: var(--text-2); font-size: 0.97rem; }

/* ---------- Screens strip ---------- */
.screens {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.screen-shot {
    width: min(230px, 42vw);
    border-radius: 28px;
    border: 6px solid #0C0824;
    box-shadow: 0 18px 44px rgba(8, 5, 24, 0.55), 0 0 0 1px rgba(176, 132, 255, 0.22);
    overflow: hidden;
    background: #0C0824;
}
.screen-shot img { width: 100%; height: auto; }
.screens figcaption {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-3);
}

/* ---------- Free forever ---------- */
.free {
    text-align: center;
    position: relative;
    overflow: hidden;
}
.free .free-inner {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 4rem 2rem 4.25rem;
    background:
        radial-gradient(60% 90% at 50% 0%, rgba(245, 197, 29, 0.08), transparent 70%),
        rgba(255, 255, 255, 0.03);
}
.free h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
.free .mission {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 450;
    font-size: 1.35rem;
    color: var(--text-2);
    max-width: 36rem;
    margin: 1.3rem auto 0;
}
.free .tip-note {
    color: var(--text-3);
    font-size: 0.98rem;
    max-width: 34rem;
    margin: 1.1rem auto 2.1rem;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(14, 9, 36, 0.6);
    padding: 2.6rem 0 2.2rem;
    margin-top: 3rem;
}
.footer-grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.footer-brand p {
    color: var(--text-3);
    font-size: 0.9rem;
    max-width: 21rem;
    margin-top: 0.6rem;
}
.footer-links {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    list-style: none;
}
.footer-links h4 {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 0.7rem;
}
.footer-links ul { list-style: none; display: grid; gap: 0.45rem; }
.footer-links a { color: var(--text-2); font-size: 0.93rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
    margin-top: 2.2rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(176, 132, 255, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-3);
    font-size: 0.85rem;
}

/* ---------- Document pages (privacy / terms / eula / support) ---------- */
.page-head { padding: 3.6rem 0 2.4rem; }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); font-weight: 570; }
.page-head .doc-meta { margin-top: 0.9rem; color: var(--text-3); font-size: 0.95rem; }

.doc-sheet {
    background: var(--paper);
    color: var(--ink);
    border-radius: 26px;
    border: 1px solid var(--paper-edge);
    box-shadow: 0 30px 80px rgba(8, 5, 24, 0.45);
    padding: clamp(1.8rem, 5vw, 4rem);
    margin-bottom: 4.5rem;
}
.doc-sheet > * + * { margin-top: 1.05em; }
.doc-sheet h2 {
    font-size: 1.5rem;
    font-weight: 560;
    color: var(--ink);
    margin-top: 2.1em;
    padding-top: 1.1em;
    border-top: 1px solid var(--paper-edge);
}
.doc-sheet h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-sheet h3 { font-size: 1.13rem; font-weight: 600; font-family: var(--sans); margin-top: 1.6em; }
.doc-sheet p, .doc-sheet li { font-size: 1.02rem; line-height: 1.75; color: var(--ink); }
.doc-sheet ul, .doc-sheet ol { padding-left: 1.4rem; }
.doc-sheet li + li { margin-top: 0.35em; }
.doc-sheet a { color: var(--violet); font-weight: 500; }
.doc-sheet strong { color: var(--ink); }
.doc-sheet .muted { color: var(--ink-2); }

/* Support page cards on dark */
.support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 2.4rem 0 0;
}
.support-grid .card h3 { display: flex; align-items: center; gap: 0.55rem; }
.support-grid .card h3 svg { width: 19px; height: 19px; stroke: var(--facet, var(--lavender)); flex: none; }

.faq { margin-top: 1.6rem; }
.faq details {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0;
    margin-top: 0.7rem;
}
.faq summary {
    cursor: pointer;
    list-style: none;
    padding: 1.05rem 1.3rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-family: var(--serif);
    font-size: 1.3rem;
    color: var(--lavender);
    transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 1.3rem 1.2rem; color: var(--text-2); font-size: 0.98rem; }
.faq .faq-body a { color: var(--lavender); }

/* ---------- 404 ---------- */
.lost {
    text-align: center;
    padding: 6rem 0 7rem;
}
.lost h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 1.4rem 0 0.9rem; }
.lost p { color: var(--text-2); max-width: 30rem; margin: 0 auto 2.2rem; }

/* ---------- Hero entrance (CSS-only, content never hidden without JS risk) ---------- */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.hero .eyebrow, .hero h1, .hero .lead, .hero-ctas, .hero-facts { animation: rise-in 0.7s var(--ease) backwards; }
.hero h1 { animation-delay: 0.08s; }
.hero .lead { animation-delay: 0.16s; }
.hero-ctas { animation-delay: 0.24s; }
.hero-facts { animation-delay: 0.32s; }
.window-scene { animation: rise-in 0.9s var(--ease) 0.1s backwards; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero .eyebrow, .hero h1, .hero .lead, .hero-ctas, .hero-facts, .window-scene { animation: none; }
    .btn, .card, .btn-store { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .window-scene { order: -1; }
    .hero-logo { width: min(300px, 70%); }
    .hero { padding-top: 2.8rem; }
    .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

@media (max-width: 640px) {
    .section { padding: 4rem 0; }
    .features-grid { grid-template-columns: 1fr; }
    .support-grid { grid-template-columns: 1fr; }
    .footer-grid { flex-direction: column; }
}
