/* ============================================================
   scroll-styles.css — long-scroll homepage styles (index.html)
   Loaded alongside styles.css + work-styles.css. These overrides
   apply only on the homepage, the only page that loads this file.
   ============================================================ */

:root {
    --canvas: #f0f0f0;
    --surface: #ffffff;
    --ink: #333333;
    --ink-soft: #666666;
    --accent: #b34a4a;        /* decorative burgundy */
    --accent-text: #9e3a3a;   /* AA-safe on white for text */
    --hairline: #e6e6e6;
    --radius: 12px;
    --section-pad: clamp(18px, 2vw, 30px);
    --container: 1120px;
}

/* Smooth in-page jumps (e.g. hero -> resume), reduced-motion safe below */
html { scroll-behavior: smooth; }

/* Sticky header + PR monogram now live in styles.css (shared by every page). */

/* ---------- Full-width sections (prototype only) ----------
   styles.css boxes <main> to max-width:1200px + 20px padding, which caps the
   section bands and adds a top gap. Let sections run edge-to-edge; each
   section's own .scroll-container / .scroll-hero-inner re-centers the content. */
main[role="main"] {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* ---------- Scroll affordance: progress bar + fixed cue ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--accent);
    z-index: 200;
    transition: width 0.08s linear;
}
.scroll-cue-fixed {
    position: fixed;
    bottom: clamp(14px, 3vh, 26px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.4s ease;
}
.scroll-cue-fixed.hidden {
    opacity: 0;
    pointer-events: none;
}
.scroll-cue-fixed .scroll-cue-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5em;
    line-height: 1;
    color: var(--ink-soft);
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
    animation: cue-bounce 1.6s ease-in-out infinite;
}
/* Hover: stop oscillating + a solid 50%-opacity circle behind the arrow. */
.scroll-cue-fixed:hover .scroll-cue-arrow {
    animation: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}
@media (max-width: 600px) {
    .scroll-cue-fixed { display: none; } /* mobile scrolls naturally */
}

/* Small-screen header fix: the live header collides at <=400px */
@media (max-width: 420px) {
    .logo { font-size: 1.05em; }
    .navigation { gap: 10px; }
    .navigation a { font-size: 0.8em; }
}
@media (max-width: 360px) {
    .logo { font-size: 0.92em; }
    .navigation { gap: 8px; }
    .navigation a { font-size: 0.72em; }
}

/* Brand mark (PR monogram) now lives in styles.css, unscoped for all pages. */

/* ---------- Section scaffolding ---------- */
.scroll-section {
    padding: var(--section-pad) 20px;
}
.scroll-section.section-alt {
    background: var(--surface);
}
/* Tighten the Trusted-by band: less gray space above/below the marquee */
#trusted.scroll-section {
    padding-top: clamp(14px, 1.6vw, 24px);
    padding-bottom: clamp(14px, 1.6vw, 24px);
}
#trusted .logo-bar {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    margin-bottom: 2px;
}
.scroll-container {
    max-width: var(--container);
    margin: 0 auto;
}
.section-head {
    text-align: center;
    margin-bottom: clamp(16px, 2.5vw, 28px);
}
.section-eyebrow {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 8px;
}
.section-title {
    font-size: clamp(1.5em, 3vw, 2em);
    color: var(--ink);
    margin: 0 0 6px 0;
    line-height: 1.2;
}
.section-sub {
    font-size: 1.05em;
    color: var(--ink-soft);
    margin: 0 auto;
    max-width: 620px;
    line-height: 1.5;
}
.see-all {
    display: inline-block;
    margin-top: 28px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.see-all:hover { color: var(--accent-text); }
.center { text-align: center; }

/* ---------- Scroll-reveal ----------
   An inline <head> script adds .js-reveal to <html> BEFORE paint (no flash).
   scroll-home.js (armReveals) reveals each .reveal as it scrolls into view via
   scroll/resize/load listeners, with a catch-all timeout so nothing stays
   hidden; under reduced motion it removes .js-reveal entirely. If JS never
   runs, .js-reveal is never added, so content stays visible. */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.985);
}
.js-reveal .reveal.in-view {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Hero ---------- */
.scroll-hero {
    box-sizing: border-box;
    /* Compact: sized to its content + modest padding (no tall min-height). This
       kills the big vertical void and lets the real content below fill the
       screen, which itself signals "there's more" better than empty space. */
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 2.2vh, 28px) 20px clamp(20px, 2.5vh, 32px);
    position: relative;
    background: var(--surface);
}
.scroll-hero-inner {
    display: flex;
    align-items: center;
    gap: clamp(28px, 4vw, 56px);
    max-width: 1040px;
    width: 100%;
    text-align: left;
}
.scroll-hero .hero-photo {
    width: clamp(140px, 14vw, 190px);
    height: clamp(140px, 14vw, 190px);
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}
.scroll-hero .hero-text { flex: 1; min-width: 0; }
.scroll-hero h1 {
    font-size: clamp(1.8em, 3.3vw, 2.4em);
    margin: 0 0 12px 0;
    line-height: 1.08;
}
.scroll-hero .hero-lead {
    font-size: clamp(1.0em, 2.0vw, 1.4em);
    font-weight: 600;
    color: var(--ink);
    max-width: 720px;
    margin: 0 0 12px 0;
    line-height: 1.3;
}
.scroll-hero .hero-lead .accent-subtle { color: var(--accent-text); }
.scroll-hero .hero-sub {
    font-size: 1.05em;
    color: var(--ink-soft);
    max-width: 680px;
    margin: 0 0 22px 0;
    line-height: 1.5;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: flex-start;
}
.hero-actions-sep {
    width: 1px;
    height: 28px;
    background: var(--hairline);
    margin: 0 4px;
}
.hero-socials {
    display: flex;
    gap: 10px;
    align-items: center;
}
.hero-socials a { display: inline-flex; padding: 7px; border-radius: 8px; transition: background 0.2s ease; }
.hero-socials a:hover { background: var(--canvas); }
.hero-socials img { height: 26px; width: 26px; object-fit: contain; display: block; }

/* Buttons */
.btn-primary {
    display: inline-block;
    box-sizing: border-box;
    padding: 10px 20px;
    font-size: 0.95em;
    line-height: 1.2;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid var(--ink);
    transition: background 0.2s ease, transform 0.15s ease;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-outline {
    display: inline-block;
    box-sizing: border-box;
    padding: 10px 20px;
    font-size: 0.95em;
    line-height: 1.2;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid var(--ink);
    transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline:hover { background: var(--ink); color: #fff; }

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: clamp(14px, 2.5vh, 26px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--ink-soft);
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}
.scroll-cue:hover { color: var(--ink); }
.scroll-cue-arrow {
    font-size: 1.7em;
    line-height: 1;
    animation: cue-bounce 1.6s ease-in-out infinite;
}

@keyframes cue-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ---------- Featured work (reuses .company-tile from work-styles.css) ---------- */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
}
.featured-grid a.company-tile {
    text-decoration: none;
    color: inherit;
}

/* ---------- Side projects ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 20px;
}
.project-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 18px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}
/* Contrasting brand bar (the project's accent colour) so the light/white logos pop */
.project-head {
    margin: -18px -18px 16px -18px;
    padding: 12px 18px;
    background: var(--card-accent, var(--ink));
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-name {
    margin: 0;
    color: #fff;
    font-size: 1.05em;
}
.project-logo {
    height: 50px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
.project-card .project-blurb {
    font-size: 0.92em;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0 0 10px 0;
    flex: 1;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}
.project-tags .tile-tag { background: var(--canvas); }

/* ---------- Testimonials: featured static quote + reused carousel ---------- */
.featured-quote {
    max-width: 820px;
    margin: 0 auto 36px;
    text-align: center;
}
.featured-quote blockquote {
    font-size: clamp(1.4em, 3vw, 1.9em);
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin: 0 0 16px 0;
}
.featured-quote .quote-mark { color: var(--accent); }
.featured-quote cite {
    font-style: normal;
    font-size: 0.95em;
    color: var(--ink-soft);
}
.featured-quote cite strong { color: var(--ink); display: block; font-size: 1.05em; }

/* Make the reused carousel arrows visible by default + keep them inside */
.scroll-section .carousel-arrow { opacity: 0.55; }
.scroll-section .testimonials:hover .carousel-arrow,
.scroll-section .carousel-arrow:focus-visible { opacity: 1; }
.scroll-section .carousel-prev { left: 0; }
.scroll-section .carousel-next { right: 0; }

/* ---------- Reading teaser ---------- */
.reading-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
}
.mini-book {
    width: 124px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}
.mini-book:hover { transform: translateY(-3px); }
.mini-book img {
    width: 124px;
    height: 186px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    background: #e9ecef;
    display: block;
}
.mini-book .mb-title {
    font-size: 0.82em;
    font-weight: 600;
    margin: 8px 0 2px;
    line-height: 1.25;
}
.mini-book .mb-author {
    font-size: 0.75em;
    color: var(--ink-soft);
    margin: 0;
}

/* ---------- Latest writing (Substack): spotlight + previous ---------- */
.writing-feature {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Spotlight — the latest post */
.writing-spotlight {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.writing-spotlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}
.writing-spot-cover {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 12px 0;
    display: block;
    background: var(--canvas);
}
.writing-spot-body { display: flex; flex-direction: column; flex: 1; }
.writing-spot-title {
    font-size: 1.4em;
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 8px 0;
}
.writing-spot-excerpt {
    font-size: 0.98em;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0 0 10px 0;
    flex: 1;
}

/* Previous — up to 3 compact rows; flex:1 makes them share the spotlight's height */
.writing-previous {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.writing-prev-row {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 12px;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.writing-prev-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}
.writing-prev-cover {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: var(--canvas);
}
.writing-prev-body { min-width: 0; }
.writing-prev-title {
    font-size: 1em;
    color: var(--ink);
    line-height: 1.3;
    margin: 2px 0 0 0;
}
.writing-prev-excerpt {
    font-size: 0.85em;
    color: var(--ink-soft);
    line-height: 1.4;
    margin: 5px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Shared meta bits (spotlight + rows) */
.writing-date {
    font-size: 0.74em;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 6px 0;
}
.writing-readmore {
    font-weight: 600;
    color: var(--accent-text);
    font-size: 0.9em;
}
@media (max-width: 700px) {
    .writing-feature { grid-template-columns: 1fr; }
}

/* ---------- Resume / email-capture ---------- */
.resume-section { text-align: center; }
.resume-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 520px;
    margin: 24px auto 0;
}
.resume-form input[type="email"] {
    flex: 1 1 280px;
    padding: 10px 16px;
    font-size: 0.95em;
    font-family: inherit;
    line-height: 1.2;
    border: 1px solid #ccc;
    border-radius: 8px;
    color: var(--ink);
}
.resume-form input[type="email"].invalid { border-color: #dc2626; background: #fef2f2; }
.resume-message {
    min-height: 1.4em;
    margin: 14px 0 0;
    font-size: 0.95em;
}
.resume-message.ok { color: #15803d; }
.resume-message.err { color: #dc2626; }
.resume-note {
    font-size: 0.82em;
    color: var(--ink-soft);
    margin: 12px 0 0;
}

/* ---------- Contact close ---------- */
.contact-section { text-align: center; }
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

/* ---------- Accessibility helpers + focus ---------- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.scroll-section a:focus-visible,
.scroll-hero a:focus-visible,
.btn-primary:focus-visible,
.btn-outline:focus-visible,
.resume-form input:focus-visible,
.resume-form button:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js-reveal .reveal,
    .js-reveal .reveal.in-view {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .scroll-cue-arrow { animation: none; }
    .scroll-progress { transition: none; }
    .scroll-cue-fixed { transition: none; }
    .pulse { animation: none; }
    /* Suppress hover/interaction motion too. */
    a.writing-spotlight, a.writing-spotlight:hover,
    a.writing-prev-row, a.writing-prev-row:hover,
    .mini-book, .mini-book:hover,
    .company-tile, .company-tile:hover,
    .btn-primary, .btn-primary:hover,
    .btn-outline, .btn-outline:hover,
    a.project-card, a.project-card:hover,
    .hero-socials a, .see-all {
        transform: none !important;
        transition: none !important;
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
    .scroll-hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    .scroll-hero .hero-lead,
    .scroll-hero .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
}
@media (max-width: 600px) {
    .scroll-hero { min-height: auto; padding-top: 36px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn-primary,
    .hero-actions .btn-outline { width: 100%; text-align: center; }
    .hero-actions-sep { display: none; }
    .hero-socials { justify-content: center; }
    .scroll-cue { display: none; }
    .resume-form { flex-direction: column; align-items: stretch; }
}
