/* ============================================================
   HSJ Motion — flipbook-first homepage stylesheet
   Layout model researched 2026-08-24 against kinfolk.com and
   thegentlewoman.co.uk: the cover is a physical object on a
   clean light page; issue title in centered serif above it;
   minimal chrome. Motion = paper depth, tilt, float — not
   gradients or decoration.

   Palette + type from design/DESIGN.md (never invent colors):
   bg #FBFAF7 · surface #FFF · elevated #F4F0E8 · ink #1A1A1A
   gold #C9A35A · palm #3B5C42 · sunset #D86A3A
   Playfair Display (serif) · Inter (sans)
   ============================================================ */

:root {
    --bg: #FBFAF7;
    --surface: #FFFFFF;
    --elevated: #F4F0E8;
    --ink: #1A1A1A;
    --ink-2: #5C5C5C;
    --muted: #999999;
    --gold: #C9A35A;
    --palm: #3B5C42;
    --sunset: #D86A3A;
    --hairline: rgba(0, 0, 0, 0.08);
    --divider: rgba(0, 0, 0, 0.12);
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--palm); text-decoration: none; }
a:hover { color: var(--ink); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ---------- reveals ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- nav ---------- */
.nav {
    position: fixed; inset: 0 0 auto 0; z-index: 500;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 32px;
    background: rgba(251, 250, 247, .88);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline);
}
.nav-logo img { height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    color: var(--ink-2); font-size: .74rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .btn-subscribe {
    color: var(--ink); background: var(--gold);
    padding: 9px 20px; border-radius: 999px; letter-spacing: .12em;
    transition: transform .25s ease, box-shadow .25s ease;
}
.nav-links .btn-subscribe:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(201, 163, 90, .38); color: var(--ink); }
@media (max-width: 640px) { .nav-links a:not(.btn-subscribe) { display: none; } }

/* ---------- hero — pinned scroll scene (260vh of scroll drives the show) ---------- */
.hero { position: relative; height: 260vh; background: var(--bg); }
.hero-pin {
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 96px 24px 40px;
}
@media (prefers-reduced-motion: reduce) {
    .hero { height: auto; min-height: 100vh; }
    .hero-pin { position: static; height: auto; min-height: 100vh; }
}
/* giant ghost word behind the cover — opposite-parallax depth layer */
.hero-ghost {
    position: absolute; top: 54%; left: 50%; transform: translate(-50%, -50%);
    font-family: var(--serif); font-weight: 400; font-style: italic;
    font-size: clamp(6rem, 22vw, 19rem); line-height: 1; white-space: nowrap;
    color: transparent; -webkit-text-stroke: 1px rgba(201, 163, 90, .35);
    pointer-events: none; user-select: none; z-index: 0; will-change: transform, opacity;
}
/* drifting depth orbs (brand gold + palm, heavily blurred) */
.orb {
    position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
    filter: blur(60px); opacity: .5; will-change: transform;
}
.orb-gold { width: 420px; height: 420px; background: radial-gradient(circle, rgba(201,163,90,.5), transparent 70%); top: -80px; right: -100px; animation: orbDrift 16s ease-in-out infinite; }
.orb-palm { width: 520px; height: 520px; background: radial-gradient(circle, rgba(59,92,66,.4), transparent 70%); bottom: -160px; left: -140px; animation: orbDrift 20s ease-in-out infinite reverse; }
@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, 40px) scale(1.15); }
}
.hero-kicker {
    color: var(--gold); font-size: .72rem; font-weight: 700;
    letter-spacing: .32em; text-transform: uppercase; margin-bottom: 18px;
    position: relative; z-index: 2;
    opacity: 0; animation: riseIn .8s cubic-bezier(.22,1,.36,1) .1s forwards;
}
.hero-title {
    font-family: var(--serif); font-weight: 400;
    font-size: clamp(2.1rem, 4.6vw, 3.6rem);
    line-height: 1.12; letter-spacing: .01em;
    max-width: 18ch; margin: 0 auto 44px;
    position: relative; z-index: 2;
}
/* staggered word-rise entrance (spans injected by motion.js) */
.hero-title .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero-title .wi {
    display: inline-block; transform: translateY(115%);
    animation: wordUp .85s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes wordUp { to { transform: translateY(0); } }
@keyframes riseIn {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-scene {
    perspective: 1400px; margin-bottom: 40px; position: relative; z-index: 1;
    transform-style: preserve-3d;
    opacity: 0; animation: sceneIn 1.1s cubic-bezier(.22,1,.36,1) .25s forwards;
}
/* August pages that fan out of the book on scroll (transforms via motion.js) */
.hero-fan { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.fan-sheet {
    position: absolute; inset: 0;
    border-radius: 3px; overflow: hidden; background: #fff;
    box-shadow: 0 14px 44px rgba(26, 26, 26, .28);
    transform: translateZ(-20px) scale(.96); opacity: 0;
    will-change: transform, opacity; backface-visibility: hidden;
}
.fan-sheet img { width: 100%; height: 100%; object-fit: cover; }
@keyframes sceneIn {
    from { opacity: 0; transform: translateY(70px) scale(.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-cover {
    position: relative; width: min(400px, 76vw); cursor: pointer;
    transform-style: preserve-3d;
    /* static standing pose — the JS engine takes over per-frame */
    transform: rotateY(-14deg) rotateX(5deg) translateZ(30px);
    will-change: transform, opacity;
}
.hero-cover img {
    width: 100%; border-radius: 3px;
    /* physical-object shadow: tight contact + soft ambient, like a
       magazine lying on paper (The Gentlewoman treatment) */
    box-shadow:
        0 1px 2px rgba(26, 26, 26, .14),
        0 12px 28px rgba(26, 26, 26, .16),
        0 36px 80px rgba(26, 26, 26, .18);
}
.hero-cover::before { /* spine light */
    content: ''; position: absolute; inset: 0 auto 0 0; width: 9%; z-index: 2;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(90deg, rgba(0, 0, 0, .09), rgba(255, 255, 255, .12) 55%, transparent);
    pointer-events: none;
}
.hero-cover::after { /* page-block edge */
    content: ''; position: absolute; top: 1%; bottom: 1%; right: -7px; width: 7px;
    background: repeating-linear-gradient(180deg, #f2ede2 0 2px, #ddd6c6 2px 3px);
    border-radius: 0 2px 2px 0;
    transform: translateZ(-8px);
}
@media (prefers-reduced-motion: reduce) {
    .hero-kicker, .hero-scene { animation: none; opacity: 1; }
    .hero-title .wi { animation: none; transform: none; }
    .orb { animation: none; }
}

.hero-actions {
    display: flex; flex-direction: column; align-items: center; gap: 18px;
    position: relative; z-index: 2;
    opacity: 0; animation: riseIn .8s cubic-bezier(.22,1,.36,1) .55s forwards;
}
@media (prefers-reduced-motion: reduce) { .hero-actions { animation: none; opacity: 1; } }
.scroll-cue {
    position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
    z-index: 2; color: var(--muted); font-size: .66rem;
    letter-spacing: .34em; text-transform: uppercase;
}
.scroll-cue::after {
    content: ''; display: block; width: 1px; height: 38px; margin: 8px auto 0;
    background: linear-gradient(var(--gold), transparent);
    animation: cueDrop 1.8s ease-in-out infinite;
}
@keyframes cueDrop {
    0% { transform: scaleY(0); transform-origin: top; }
    60% { transform: scaleY(1); }
    100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .scroll-cue::after { animation: none; } }
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    padding: 15px 40px; border-radius: 999px; cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.btn-read {
    background: transparent; color: var(--ink); border: 1px solid var(--ink);
}
.btn-read:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--ink); border: 0; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(201, 163, 90, .4); }
.hero-alt {
    color: var(--ink-2); font-size: .8rem; letter-spacing: .08em;
    border-bottom: 1px solid var(--divider); padding-bottom: 2px;
}
.hero-alt:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- giant kinetic marquee (motion-site scale) ---------- */
.marquee {
    background: var(--bg);
    border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
    overflow: hidden; white-space: nowrap; padding: 26px 0;
}
.marquee-track { display: block; white-space: nowrap; width: max-content; animation: marquee 38s linear infinite; will-change: transform; }
.marquee-track.rev {
    animation: marquee 30s linear infinite reverse;
    margin-top: 10px;
}
.marquee-track.rev span { font-size: clamp(1.2rem, 2.6vw, 2rem); color: var(--ink-2); }
.marquee span {
    font-family: var(--serif); font-style: italic;
    font-size: clamp(1.7rem, 3.8vw, 3rem); line-height: 1.1;
    margin: 0 38px; color: var(--ink);
}
.marquee span em {
    font-style: italic; color: transparent;
    -webkit-text-stroke: 1px var(--gold);
}
.marquee b { color: var(--gold); font-weight: 400; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- sections ---------- */
.section { padding: 110px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 70px; }
.section-head .eyebrow {
    color: var(--gold); font-size: .7rem; font-weight: 700;
    letter-spacing: .32em; text-transform: uppercase; display: block; margin-bottom: 14px;
}
.section-head h2 {
    font-family: var(--serif); font-weight: 400;
    font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.18;
}
.section-head p { color: var(--ink-2); margin-top: 12px; font-size: .95rem; }

/* ---------- issue archive — editorial rows with hairline rules ---------- */
.issues { background: var(--bg); }
.issue-list { display: flex; flex-direction: column; }
.issue-card {
    display: grid; grid-template-columns: 300px 1fr; gap: 70px; align-items: center;
    cursor: pointer; padding: 64px 0;
    border-top: 1px solid var(--divider);
}
.issue-card:last-child { border-bottom: 1px solid var(--divider); }
.issue-card:nth-child(even) { grid-template-columns: 1fr 300px; }
.issue-card:nth-child(even) .issue-visual { order: 2; }
.issue-visual { perspective: 1100px; display: flex; justify-content: center; }
.issue-cover-wrap {
    position: relative; width: 100%; max-width: 260px;
    transform-style: preserve-3d;
    /* transform + opacity are scroll-scrubbed per-frame by motion.js */
    will-change: transform, opacity;
}
.issue-info { will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) {
    .issue-cover-wrap, .issue-info { transform: none !important; opacity: 1 !important; }
}
.issue-cover-wrap img {
    width: 100%; border-radius: 3px;
    box-shadow:
        0 1px 2px rgba(26, 26, 26, .12),
        0 10px 24px rgba(26, 26, 26, .14),
        0 26px 60px rgba(26, 26, 26, .14);
    transition: box-shadow .45s ease;
}
.issue-card:hover .issue-cover-wrap img {
    box-shadow:
        0 2px 4px rgba(26, 26, 26, .12),
        0 16px 36px rgba(26, 26, 26, .18),
        0 44px 90px rgba(26, 26, 26, .2);
}
.issue-cover-wrap::after { /* page edge */
    content: ''; position: absolute; top: 1.5%; bottom: 1.5%; right: -6px; width: 6px;
    background: repeating-linear-gradient(180deg, #f2ede2 0 2px, #ddd6c6 2px 3px);
    border-radius: 0 2px 2px 0; transform: translateZ(-6px);
}
.issue-info { max-width: 480px; }
.issue-card:nth-child(odd) .issue-info { justify-self: start; text-align: left; }
.issue-card:nth-child(even) .issue-info { justify-self: end; text-align: right; }
.issue-folio {
    font-family: var(--serif); font-size: .95rem; color: var(--muted);
    display: block; margin-bottom: 14px;
}
.issue-label {
    color: var(--gold); font-size: .68rem; font-weight: 700;
    letter-spacing: .28em; text-transform: uppercase; display: block; margin-bottom: 10px;
}
.issue-info h3 {
    font-family: var(--serif); font-weight: 400;
    font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 10px; line-height: 1.2;
}
.issue-info .issue-meta { color: var(--muted); font-size: .82rem; margin-bottom: 20px; }
.issue-open {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--palm); font-size: .74rem; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase;
    border-bottom: 1px solid var(--palm); padding-bottom: 4px;
    transition: gap .25s ease, color .25s ease;
}
.issue-card:hover .issue-open { gap: 18px; color: var(--ink); }
@media (max-width: 860px) {
    .issue-card, .issue-card:nth-child(even) { grid-template-columns: 1fr; gap: 30px; padding: 48px 0; }
    .issue-card:nth-child(even) .issue-visual { order: 0; }
    .issue-card:nth-child(odd) .issue-info,
    .issue-card:nth-child(even) .issue-info { justify-self: center; text-align: center; }
    .issue-cover-wrap { max-width: 220px; }
}

/* ---------- instagram ---------- */
.ig-section { background: var(--elevated); }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fit, 172px); gap: 14px; justify-content: center; }
.ig-item { border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--surface); }
.ig-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.22,1,.36,1); }
.ig-item:hover img { transform: scale(1.06); }
.ig-fallback { grid-column: 1 / -1; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.1rem; padding: 30px 0; }
@media (max-width: 900px) { .ig-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- subscribe — brand palm green, not black ---------- */
.subscribe { background: var(--palm); color: #fff; }
.subscribe .section-head { margin-bottom: 40px; }
.subscribe .section-head .eyebrow { color: var(--gold); }
.subscribe .section-head h2 { color: #fff; }
.subscribe .section-head p { color: rgba(255, 255, 255, .72); }
.sub-form {
    display: flex; gap: 12px; max-width: 560px; margin: 0 auto;
    flex-wrap: wrap; justify-content: center;
}
.sub-form input[type="email"] {
    flex: 1 1 260px; padding: 15px 22px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .1); color: #fff; font-size: .95rem; font-family: var(--sans);
}
.sub-form input[type="email"]::placeholder { color: rgba(255, 255, 255, .55); }
.sub-form input[type="email"]:focus { outline: none; border-color: var(--gold); }
.consent {
    display: flex; gap: 10px; align-items: flex-start; max-width: 560px;
    margin: 18px auto 0; color: rgba(255, 255, 255, .65); font-size: .78rem; text-align: left;
}
.consent input { margin-top: 3px; accent-color: var(--gold); }
.form-msg { margin-top: 14px; font-size: .85rem; min-height: 1.2em; text-align: center; }
.form-msg.ok { color: var(--gold); }
.form-msg.err { color: #f3c4ad; }

/* ---------- contact / footer ---------- */
.contact { background: var(--bg); text-align: center; }
.contact .big-mail {
    font-family: var(--serif); font-size: clamp(1.3rem, 3.2vw, 2.1rem);
    color: var(--ink); border-bottom: 2px solid var(--gold); padding-bottom: 6px;
}
.contact .big-mail:hover { color: var(--palm); }
.contact-links { margin-top: 30px; display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; }
.contact-links a { font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
footer {
    background: var(--bg); color: var(--muted);
    border-top: 1px solid var(--divider);
    padding: 44px 24px; text-align: center; font-size: .78rem;
}
footer .foot-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }
footer a:hover { color: var(--ink); }

/* ---------- subscribe popup ---------- */
.sub-popup {
    position: fixed; inset: 0; z-index: 800; display: none;
    align-items: center; justify-content: center;
    background: rgba(26, 26, 26, .55); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .3s ease; padding: 20px;
}
.sub-popup.open { display: flex; }
.sub-popup.visible { opacity: 1; }
.sub-popup-card {
    background: var(--surface); border-radius: 14px; max-width: 470px; width: 100%;
    padding: 44px 40px; position: relative; text-align: center;
    transform: translateY(24px) scale(.97); transition: transform .35s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, .35);
}
.sub-popup.visible .sub-popup-card { transform: none; }
.sub-popup-close {
    position: absolute; top: 14px; right: 18px; border: 0; background: none;
    font-size: 1.7rem; color: var(--muted); cursor: pointer; line-height: 1;
}
.sub-popup-card .eyebrow { color: var(--gold); font-size: .66rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; }
.sub-popup-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 12px 0 10px; }
.sub-popup-card p { color: var(--ink-2); font-size: .92rem; margin-bottom: 24px; }
.sub-popup-card .sub-form input[type="email"] {
    background: var(--elevated); border-color: var(--hairline); color: var(--ink);
}
.sub-popup-card .sub-form input[type="email"]::placeholder { color: var(--muted); }
.sub-popup-card .consent { color: var(--ink-2); }
.sub-popup-card .form-msg.err { color: var(--sunset); }

/* ============================================================
   Flipbook 3D reader (dark reading room — unchanged palette)
   ============================================================ */
.fb3d-overlay {
    position: fixed; inset: 0; z-index: 900; display: none; flex-direction: column;
    background: rgba(16, 16, 16, .97); opacity: 0; transition: opacity .35s ease;
}
.fb3d-overlay.open { display: flex; }
.fb3d-overlay.visible { opacity: 1; }
.fb3d-chrome {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 26px; color: #fff;
}
.fb3d-title { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: rgba(255, 255, 255, .85); }
.fb3d-close {
    border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 42px; height: 42px;
    border-radius: 50%; font-size: 1.5rem; cursor: pointer; line-height: 1;
    transition: background .25s ease, transform .25s ease;
}
.fb3d-close:hover { background: var(--sunset); transform: rotate(90deg); }
.fb3d-stage { flex: 1; display: flex; align-items: center; justify-content: center; perspective: 2400px; min-height: 0; }
.fb3d-book { position: relative; transform-style: preserve-3d; }

.fb3d-sheet {
    position: absolute; top: 0; right: 0; width: var(--pw); height: 100%;
    transform-style: preserve-3d; transform-origin: left center;
    transition: transform .65s cubic-bezier(.35, .1, .25, 1);
    cursor: pointer;
}
.fb3d-sheet.turned { transform: rotateY(-180deg); }
.fb3d-face {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    background: #fff; overflow: hidden; border-radius: 2px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}
.fb3d-face img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.fb3d-back { transform: rotateY(180deg); }
.fb3d-front::after { /* spine shading */
    content: ''; position: absolute; inset: 0 auto 0 0; width: 26px;
    background: linear-gradient(90deg, rgba(0, 0, 0, .16), transparent); pointer-events: none;
}
.fb3d-back::after {
    content: ''; position: absolute; inset: 0 0 0 auto; width: 26px;
    background: linear-gradient(-90deg, rgba(0, 0, 0, .16), transparent); pointer-events: none;
}
/* mobile single-page mode */
.fb3d-single .fb3d-sheet { right: auto; left: 0; width: 100%; transform-origin: left center; }
.fb3d-single .fb3d-sheet.turned { transform: rotateY(-100deg); opacity: 0; transition: transform .5s ease, opacity .45s ease; }

.fb3d-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 950;
    border: 0; background: rgba(255, 255, 255, .08); color: #fff;
    width: 52px; height: 52px; border-radius: 50%; font-size: 1.3rem; cursor: pointer;
    transition: background .25s ease;
}
.fb3d-arrow:hover { background: var(--gold); color: var(--ink); }
.fb3d-arrow:disabled { opacity: .25; cursor: default; }
.fb3d-arrow:disabled:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.fb3d-prev { left: 22px; }
.fb3d-next { right: 22px; }
@media (max-width: 640px) {
    .fb3d-prev { left: 8px; }
    .fb3d-next { right: 8px; }
    .fb3d-arrow { width: 42px; height: 42px; }
}
.fb3d-footer { text-align: center; padding: 14px 0 20px; color: rgba(255, 255, 255, .6); font-size: .8rem; letter-spacing: .1em; }
