/* ============================================================================
   VerseGuard — Landing page
   Concept: "the title page of a finely bound edition."
   Shares the Quiet System DNA with legal pages — parchment, letterpress,
   wax seal, gold/red accents — but structured for a marketing landing page.
   ========================================================================== */

:root {
    --page: #ece8df;
    --paper: #f6efe2;
    --paper-deep: #ece4d2;
    --preview-paper: #ece8df;
    --ink: #1a1c1c;
    --ink-warm: #2b2620;
    --body: #3a342d;
    --sub: #5d5c5b;
    --muted: #8c857b;
    --red: #b7131a;
    --red-deep: #8a0c12;
    --gold: #c9a36a;
    --gold-glint: #f1d58b;
    --hair: rgba(159, 128, 92, 0.30);
    --hair-soft: rgba(159, 128, 92, 0.16);

    --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --body-font: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
}

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

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

body {
    font-family: var(--body-font);
    font-optical-sizing: auto;
    background-color: var(--page);
    color: var(--body);
    font-size: 19px;
    line-height: 1.72;
    letter-spacing: 0.002em;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Paper atmosphere — grain + warm top light + base vignette */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.045;
    mix-blend-mode: multiply;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(125% 75% at 50% -12%, rgba(255, 251, 242, 0.7), transparent 58%),
        radial-gradient(150% 130% at 50% 125%, rgba(120, 90, 50, 0.10), transparent 55%);
}

/* ----------------------------------------------------------- Skip link */
.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 70;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ----------------------------------------------------------- Masthead */
.masthead {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    padding: 30px 30px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    color: var(--ink);
}
.brand img {
    width: 40px;
    height: 40px;
    display: block;
    filter: drop-shadow(0 1px 1.5px rgba(70, 30, 20, 0.18));
}
.wordmark {
    font-family: var(--display);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.005em;
}

.masthead-nav {
    display: flex;
    gap: 24px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.masthead-nav a {
    color: var(--muted);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 1.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.masthead-nav a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ----------------------------------------------------------- Hero */
.hero {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    padding: 100px 30px 80px;
    text-align: center;
}

.hero-grid {
    display: grid;
    align-items: center;
    gap: 54px;
}

.hero-copy {
    max-width: 820px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.6rem, 7.5vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 22px;
}

.hero-accent {
    color: var(--red);
    font-style: italic;
    font-weight: 500;
}

.hero-sub {
    font-family: var(--body-font);
    font-size: clamp(1.05rem, 2.8vw, 1.28rem);
    line-height: 1.5;
    color: var(--sub);
    max-width: 32ch;
    margin: 0 auto 40px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--body-font);
    font-size: 15px;
    letter-spacing: 0.02em;
    padding: 14px 30px;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 18px rgba(40, 20, 10, 0.15);
}
.hero-cta:hover {
    background: var(--ink-warm);
    transform: translateY(-1px);
}
.hero-cta svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ----------------------------------------------------------- Divider */
.divider {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 30px;
}
.divider-line {
    border: none;
    height: 1px;
    background: var(--ink);
    position: relative;
}
.divider-line::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 1px;
    background: var(--gold);
}

/* ----------------------------------------------------------- Pillars */
.pillars {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 80px 30px 100px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.pillar {}

.pillar-no {
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--red);
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    display: block;
}

.pillar-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1.18;
    letter-spacing: -0.012em;
    color: var(--ink);
    margin-bottom: 14px;
}

.pillar-body {
    font-size: 0.95rem;
    line-height: 1.72;
    color: var(--body);
}

/* ----------------------------------------------------------- Colophon */
.colophon {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 30px 80px;
    border-top: 1px solid var(--ink);
    text-align: center;
}
.colophon-seal {
    width: 46px;
    height: 46px;
    display: block;
    margin: 0 auto 18px;
    opacity: 0.92;
}
.colophon-verse {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--sub);
    max-width: 32ch;
    margin: 0 auto 8px;
}
.colophon-ref {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 28px;
}
.colophon-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px 18px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.colophon-nav a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}
.colophon-nav a:hover { color: var(--red); }
.colophon-contact {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}
.colophon-contact a {
    color: var(--red);
    text-decoration: none;
    transition: color 0.2s;
}
.colophon-contact a:hover { color: var(--red-deep); }
.set-in {
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.set-in em { font-style: italic; color: var(--sub); }
.copyright {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

/* ----------------------------------------------------------- Back to top */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--hair);
    background: var(--paper);
    color: var(--red);
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s, border-color 0.2s;
    box-shadow: 0 6px 22px rgba(80, 50, 20, 0.14);
}
.to-top.show { opacity: 1; transform: none; }
.to-top:hover { border-color: var(--red); }

/* ----------------------------------------------------------- Phone mockup */
.mockup-wrap {
    width: 100%;
    margin: 52px auto 0;
    max-width: 300px;
}

.phone-preview {
    aspect-ratio: 567 / 1142;
    width: 100%;
    position: relative;
    isolation: isolate;
}

.phone-preview-screen {
    position: absolute;
    top: 8.5%;
    right: 5.5%;
    bottom: 3.5%;
    left: 5.5%;
    z-index: 1;
    overflow: hidden;
    border-radius: 12%;
    background: var(--preview-paper);
}

.phone-preview-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: var(--preview-paper);
}

.phone-preview-bezel {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    filter:
        drop-shadow(0 2px 8px rgba(80, 50, 20, 0.10))
        drop-shadow(0 18px 42px rgba(80, 50, 20, 0.16));
}

/* ----------------------------------------------------------- Focus + motion */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(14px);
        animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    }
    .reveal.d1 { animation-delay: 0.08s; }
    .reveal.d2 { animation-delay: 0.16s; }
    .reveal.d3 { animation-delay: 0.24s; }
    .reveal.d4 { animation-delay: 0.32s; }
    .reveal.d5 { animation-delay: 0.40s; }
    @keyframes rise { to { opacity: 1; transform: none; } }

    .scroll-reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1),
                    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    }
    .scroll-reveal.visible {
        opacity: 1;
        transform: none;
    }
}

/* ----------------------------------------------------------- Responsive */
@media (min-width: 920px) {
    .hero {
        padding: 96px 34px 92px;
        text-align: left;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1.16fr) minmax(300px, 360px);
        gap: 56px;
        padding: 44px 54px;
        border: 1px solid var(--hair-soft);
        border-radius: 36px;
        background: rgba(246, 239, 226, 0.28);
        box-shadow: inset 0 1px 0 rgba(255, 251, 242, 0.45);
    }

    .hero-copy {
        max-width: 660px;
        margin: 0;
    }

    .hero-title {
        font-size: clamp(3.35rem, 5.25vw, 5rem);
        margin-bottom: 26px;
    }

    .hero-sub {
        max-width: 34ch;
        margin: 0 0 36px;
    }

    .mockup-wrap {
        width: min(100%, 340px);
        max-width: none;
        margin: 0;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .pillars {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 30px;
    }
    .hero { padding: 70px 24px 60px; }
    .mockup-wrap { max-width: 240px; }
}

@media (max-width: 600px) {
    body { font-size: 18px; }
    .masthead { padding: 20px 22px 0; }
    .masthead-nav { gap: 16px; }
    .hero { padding: 56px 22px 48px; }
    .pillars { padding: 48px 22px 72px; }
    .colophon { padding: 36px 22px 70px; }
    .mockup-wrap { max-width: 220px; }
}

/* ----------------------------------------------------------- Print */
@media print {
    body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
    body::before, body::after, .to-top { display: none !important; }
    .hero-cta { display: none; }
    .masthead, .hero, .pillars, .colophon { max-width: none; }
    .reveal, .scroll-reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}
