// Those Days — homepage. Full-bleed cover + serious editorial sections.
// Sections: I Those Days · II Intro · III What we do · IV Who we are · V Contact.

function BarcelonaMark() {
  return (
    <div className="bcn-mark" style={{ display: 'flex', flexDirection: 'column', gap: 18, color: TD.ink, width: '100%', maxWidth: 260 }}>
      <svg viewBox="0 0 200 200" style={{ width: '100%', height: 'auto', display: 'block' }} aria-hidden="true">
        {/* globe outer */}
        <circle cx="100" cy="100" r="84" fill="none" stroke={TD.ink} strokeWidth="1" />
        {/* equator & prime meridian */}
        <line x1="16" y1="100" x2="184" y2="100" stroke={TD.ink} strokeWidth="0.6" opacity="0.4" />
        <line x1="100" y1="16" x2="100" y2="184" stroke={TD.ink} strokeWidth="0.6" opacity="0.4" />
        {/* latitude rings */}
        <ellipse cx="100" cy="100" rx="84" ry="32" fill="none" stroke={TD.ink} strokeWidth="0.4" opacity="0.28" />
        <ellipse cx="100" cy="100" rx="84" ry="60" fill="none" stroke={TD.ink} strokeWidth="0.4" opacity="0.28" />
        {/* longitude rings */}
        <ellipse cx="100" cy="100" rx="32" ry="84" fill="none" stroke={TD.ink} strokeWidth="0.4" opacity="0.28" />
        <ellipse cx="100" cy="100" rx="60" ry="84" fill="none" stroke={TD.ink} strokeWidth="0.4" opacity="0.28" />
        {/* tick at top */}
        <line x1="100" y1="16" x2="100" y2="8" stroke={TD.ink} strokeWidth="0.8" />
        <text x="100" y="6" textAnchor="middle" fontFamily={TD.mono} fontSize="7" fill={TD.mid} letterSpacing="1">N</text>
        {/* Barcelona marker — upper-right quadrant, 41°N 2°E */}
        <circle cx="108" cy="65" r="4.5" fill={TD.accent} />
        <circle cx="108" cy="65" r="11" fill="none" stroke={TD.accent} strokeWidth="0.75" opacity="0.5" />
        {/* annotation line outward to the right edge */}
        <line x1="118" y1="65" x2="172" y2="48" stroke={TD.ink} strokeWidth="0.5" opacity="0.55" />
        <line x1="172" y1="48" x2="194" y2="48" stroke={TD.ink} strokeWidth="0.5" opacity="0.55" />
      </svg>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
        <span style={{ fontFamily: TD.mono, fontSize: 11, letterSpacing: '0.18em', textTransform: 'uppercase', color: TD.ink }}>
          Barcelona
        </span>
        <span style={{ fontFamily: TD.mono, fontSize: 10, letterSpacing: '0.16em', textTransform: 'uppercase', color: TD.mid }}>
          41.39° N · 2.16° E
        </span>
      </div>
    </div>
  );
}

const Homepage = () => {
  const root = React.useRef(null);
  const { brand, intro, whatWeDo, founders, contact } = window.SITE;
  useScrollReveals(root);

  // Toggle .over-cover on the root while the dark cover is still in view,
  // so the sticky nav switches to paper-on-dark only over the hero.
  React.useEffect(() => {
    const el = root.current;
    if (!el) return;
    const onScroll = () => {
      const threshold = window.innerHeight - 80; // approx nav height
      el.classList.toggle('over-cover', window.scrollY < threshold);
    };
    onScroll();
    window.addEventListener('scroll', onScroll, { passive: true });
    window.addEventListener('resize', onScroll);
    return () => {
      window.removeEventListener('scroll', onScroll);
      window.removeEventListener('resize', onScroll);
    };
  }, []);

  // Team carousel — prev/next buttons + click-and-drag panning
  React.useEffect(() => {
    const rail = document.querySelector('.team-rail');
    if (!rail) return;

    const card = rail.querySelector('article');
    const step = () => (card ? card.getBoundingClientRect().width + 28 : 360);

    const prev = document.querySelector('[data-team-nav="prev"]');
    const next = document.querySelector('[data-team-nav="next"]');
    const onPrev = () => rail.scrollBy({ left: -step(), behavior: 'smooth' });
    const onNext = () => rail.scrollBy({ left: step(), behavior: 'smooth' });
    prev && prev.addEventListener('click', onPrev);
    next && next.addEventListener('click', onNext);

    // Pointer drag-to-scroll
    let isDown = false, startX = 0, startScroll = 0, moved = 0;
    const onDown = (e) => {
      if (e.target.closest('a,button')) return;
      isDown = true; moved = 0;
      startX = e.clientX; startScroll = rail.scrollLeft;
      rail.classList.add('is-dragging');
      rail.setPointerCapture && rail.setPointerCapture(e.pointerId);
    };
    const onMove = (e) => {
      if (!isDown) return;
      const dx = e.clientX - startX;
      moved = Math.max(moved, Math.abs(dx));
      rail.scrollLeft = startScroll - dx;
    };
    const onUp = () => {
      isDown = false;
      rail.classList.remove('is-dragging');
    };
    rail.addEventListener('pointerdown', onDown);
    rail.addEventListener('pointermove', onMove);
    rail.addEventListener('pointerup', onUp);
    rail.addEventListener('pointercancel', onUp);
    rail.addEventListener('pointerleave', onUp);
    // Swallow clicks that happen at the end of a drag so links don't fire
    const onClickCapture = (e) => { if (moved > 6) { e.preventDefault(); e.stopPropagation(); } };
    rail.addEventListener('click', onClickCapture, true);

    return () => {
      prev && prev.removeEventListener('click', onPrev);
      next && next.removeEventListener('click', onNext);
      rail.removeEventListener('pointerdown', onDown);
      rail.removeEventListener('pointermove', onMove);
      rail.removeEventListener('pointerup', onUp);
      rail.removeEventListener('pointercancel', onUp);
      rail.removeEventListener('pointerleave', onUp);
      rail.removeEventListener('click', onClickCapture, true);
    };
  }, []);

  const indicatorItems = [
    { id: 'cover-story', label: 'I · Those Days' },
    { id: 'what-we-do', label: 'II · What we do' },
    { id: 'we-work-with', label: 'III · We work with' },
    { id: 'founders', label: 'IV · Our team' },
    { id: 'contact', label: 'V · Contact' },
  ];

  // Real partner / client logos + a few placeholders to fill the grid.
  // All marks are forced to black via `filter: brightness(0)` for a unified look.
  const logos = [
    { name: 'A Day\u2019s March', src: 'assets/partners/a-days-march.png', maxH: 26 },
    { name: 'Drumelia Real Estate', src: 'assets/partners/drumelia.png', maxH: 104 },
    { name: 'Moyagi', src: 'assets/partners/moyagi.png', maxH: 38 },
    { name: 'Warner Music', src: 'assets/partners/warner.webp', maxH: 90 },
    { name: 'Dorchester Collection', src: 'assets/partners/dorchester.png', maxH: 96 },
    { name: 'Vanbruun', src: 'assets/partners/vanbruun.png', maxH: 32 },
    { name: 'Universal Music Group', src: 'assets/partners/universal.png', maxH: 100 },
    { name: 'Alo', src: 'assets/partners/alo.png', maxH: 58 },
    { name: '\u2014', placeholder: true },
  ];

  return (
    <div ref={root} className="td-site" style={{ position: 'relative', width: '100%' }}>
      <PageCursor />
      <ScrollProgress />

      {/* ========== NAV (transparent over cover) ========== */}
      <nav style={{
        display: 'grid', gridTemplateColumns: '1fr auto',
        alignItems: 'center', padding: '20px 56px',
        position: 'sticky', top: 0,
        background: 'rgba(247,244,236,0.0)',
        zIndex: 50,
      }}>
        <a href="#" data-hot style={{ display: 'inline-flex', alignItems: 'center' }}>
          <Wordmark size={40} />
        </a>
        <div style={{ display: 'flex', gap: 28, justifySelf: 'end' }}>
          {[
            { name: 'Those Days', id: 'cover-story' },
            { name: 'What we do', id: 'what-we-do' },
            { name: 'Partners', id: 'we-work-with' },
            { name: 'Team', id: 'founders' },
            { name: 'Contact', id: 'contact' },
          ].map((n) => (
            <a key={n.id} href={`#${n.id}`} data-hot className="nav-link">{n.name}</a>
          ))}
        </div>
      </nav>

      {/* ========== COVER — full viewport ========== */}
      <section className="cover-page" style={{ marginTop: -80 /* tuck under transparent nav */ }}>
        {/* Animated placeholder until a real video file is provided */}
        <div className="cover-bg" aria-hidden="true" />
        {/* Drop assets/cover-video.mp4 into the project — it will fade in over the placeholder. */}
        <video
          className="cover-video"
          autoPlay muted loop playsInline preload="auto"
          aria-hidden="true"
          ref={(el) => {
            if (!el) return;
            // Belt-and-suspenders: some browsers don't honour autoPlay reliably
            // when the element is constructed via React. Kick it ourselves.
            const tryPlay = () => { el.play().catch(() => {}); };
            tryPlay();
            el.addEventListener('loadeddata', () => {
              el.classList.add('is-ready');
              tryPlay();
            }, { once: true });
          }}
          onCanPlay={(e) => e.currentTarget.classList.add('is-ready')}
        >
          <source src="assets/cover-video.mp4?v=webreel" type="video/mp4" />
        </video>
        {/* white overlay + slight blur */}
        <div className="cover-veil" aria-hidden="true" />

        <div className="cover-meta-row" style={{ paddingTop: 68 }} />

        <div className="cover-mark">
          <img src="assets/logo-those-days-brush5.png" alt="Those Days" className="cover-wm" />
          <p className="cover-tag">
            A creative studio and cultural partner for brands and artists shaping culture. Based in Barcelona.
          </p>
          <a href="#contact" data-hot className="cover-cta">
            <span>Contact us</span>
            <span className="cover-cta-arrow" aria-hidden="true">↗</span>
          </a>
        </div>

        <div className="cover-meta-row" style={{ alignItems: 'center', display: 'grid', gridTemplateColumns: '1fr auto 1fr' }}>
          <span className="eyebrow" style={{ visibility: 'hidden' }}>.</span>
          <div className="cover-scroll">
            <span className="eyebrow">Scroll</span>
            <span className="cover-scroll-line" />
          </div>
          <span className="eyebrow" style={{ justifySelf: 'end' }}>©{brand.year}</span>
        </div>
      </section>

      {/* ========== I — THOSE DAYS (cover-story + intro merged) ========== */}
      <section id="cover-story" className="reveal" style={{ padding: '120px 56px 120px' }}>
        <div className="rule-thick" />
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', padding: '14px 0 48px' }}>
          <span className="eyebrow sec-head-l">Those Days</span>
          <span className="eyebrow" style={{ color: TD.mid }}>I · Intro</span>
        </div>

        <h2 className="hl-stagger display-tight" style={{ fontSize: 'clamp(72px, 10vw, 184px)', margin: 0, maxWidth: 1640 }}>
          <span style={{ display: 'block' }}>For brands</span>
          <span style={{ display: 'block' }}>and artists</span>
          <span style={{ display: 'block' }}><span className="display-italic">shaping</span> culture.</span>
        </h2>

        {/* Manifesto-as-heading — full-width, light weight for editorial calm */}
        <p className="reveal" style={{
          fontFamily: TD.display,
          fontSize: 'clamp(30px, 3.4vw, 60px)',
          fontStyle: 'normal',
          fontWeight: 300,
          lineHeight: 1.18,
          margin: '120px 0 56px',
          maxWidth: 1340,
          color: TD.ink,
          letterSpacing: '-0.022em',
          textWrap: 'pretty',
        }}>
          {intro.body[1]}
        </p>

        <div className="reveal" style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 64, maxWidth: 1400, alignItems: 'start' }}>
          <p style={{ fontSize: 'clamp(18px, 1.5vw, 22px)', lineHeight: 1.55, margin: 0, color: TD.ink, fontWeight: 400 }}>
            {intro.body[0]}
          </p>
          <p style={{ fontSize: 'clamp(18px, 1.5vw, 22px)', lineHeight: 1.55, margin: 0, color: TD.mid, fontWeight: 400 }}>
            {intro.body[2]}
          </p>
        </div>

        <div className="reveal" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'baseline', marginTop: 56, gap: 24, flexWrap: 'wrap' }}>
          <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
            {brand.ctas.map((c) => (
              <a key={c.label} href={c.href} data-hot className={`btn ${c.primary ? 'btn-primary' : 'btn-ghost'}`}>
                {c.label} <span>{c.primary ? '↗' : '→'}</span>
              </a>
            ))}
          </div>
        </div>
      </section>

      {/* ========== III · WHAT WE DO ========== */}
      <section id="what-we-do" style={{ padding: '32px 56px 96px' }}>
        <div className="rule-thick" />
        <div className="reveal" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', padding: '14px 0 20px' }}>
          <span className="eyebrow sec-head-l">What we do</span>
        </div>
        <h3 className="reveal hl-stagger display-tight" style={{ fontSize: 'clamp(56px, 7vw, 112px)', margin: '0 0 120px', maxWidth: 1200 }}>
          <span style={{ display: 'block' }}>Two units,</span>
          <span style={{ display: 'block' }}><span className="display-italic">one</span> roof.</span>
        </h3>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 48, maxWidth: 1240, margin: '0 auto' }}>
          {whatWeDo.pods.map((pod, i) => (
            <div key={pod.id} className="reveal" style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
              <div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginTop: 4 }}>
                <h4 className="display" style={{ fontSize: 'clamp(40px, 4.5vw, 64px)', margin: 0, letterSpacing: '-0.03em' }}>{pod.name}</h4>
                <span className="eyebrow">{pod.lede}</span>
              </div>
              <div className="rule-hair" />
              <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>
                {pod.services.map((s, idx) => (
                  <li key={s} style={{
                    display: 'grid', gridTemplateColumns: '52px 1fr',
                    alignItems: 'baseline', gap: 16,
                    padding: '16px 0',
                    borderBottom: `1px solid ${TD.hair}`,
                  }}>
                    <span className="eyebrow">{String(idx + 1).padStart(2, '0')}</span>
                    <span style={{ fontFamily: TD.display, fontSize: 22, fontWeight: 500, letterSpacing: '-0.018em', color: TD.ink }}>{s}</span>
                  </li>
                ))}
                {pod.links && pod.links.map((lnk, j) => (
                  <li key={lnk.label} style={{ borderBottom: `1px solid ${TD.hair}` }}>
                    <a
                      href={lnk.href}
                      target="_blank"
                      rel="noreferrer"
                      data-hot
                      style={{
                        display: 'grid', gridTemplateColumns: '52px 1fr auto',
                        alignItems: 'baseline', gap: 16,
                        padding: '16px 0',
                        color: TD.ink,
                        transition: 'color .25s, padding-left .35s cubic-bezier(.2,.7,.3,1)',
                      }}
                      onMouseEnter={(e) => { e.currentTarget.style.color = TD.accent; e.currentTarget.style.paddingLeft = '10px'; }}
                      onMouseLeave={(e) => { e.currentTarget.style.color = TD.ink; e.currentTarget.style.paddingLeft = '0px'; }}
                    >
                      <span className="eyebrow" style={{ color: 'inherit' }}>{String(pod.services.length + j + 1).padStart(2, '0')}</span>
                      <span style={{ fontFamily: TD.display, fontSize: 22, fontWeight: 500, letterSpacing: '-0.018em', color: 'inherit' }}>{lnk.label}</span>
                      <span className="arrow" style={{ fontSize: 16, color: 'inherit' }}>↗</span>
                    </a>
                  </li>
                ))}
              </ul>
              {pod.cta && (
                <div style={{ marginTop: 28, display: 'flex', justifyContent: 'center' }}>
                  <a
                    href={pod.cta.href}
                    target={pod.cta.href.startsWith('http') ? '_blank' : undefined}
                    rel="noreferrer"
                    data-hot
                    style={{
                      display: 'inline-flex', alignItems: 'center', gap: 12,
                      padding: '14px 28px',
                      fontFamily: TD.mono, fontSize: 11, letterSpacing: '0.16em', textTransform: 'uppercase',
                      borderRadius: 999,
                      color: TD.ink,
                      background: 'rgba(255,255,255,0.35)',
                      border: `1px solid ${TD.hairBold}`,
                      backdropFilter: 'blur(10px) saturate(1.1)',
                      WebkitBackdropFilter: 'blur(10px) saturate(1.1)',
                      transition: 'background .3s ease, border-color .3s ease, transform .35s cubic-bezier(.2,.7,.3,1)',
                    }}
                    onMouseEnter={(e) => { e.currentTarget.style.background = 'rgba(255,255,255,0.6)'; e.currentTarget.style.borderColor = TD.ink; e.currentTarget.style.transform = 'translateY(-1px)'; }}
                    onMouseLeave={(e) => { e.currentTarget.style.background = 'rgba(255,255,255,0.35)'; e.currentTarget.style.borderColor = TD.hairBold; e.currentTarget.style.transform = 'translateY(0)'; }}
                  >
                    {pod.cta.label} <span>↗</span>
                  </a>
                </div>
              )}
            </div>
          ))}
        </div>
      </section>

      {/* ========== IV — WE WORK WITH ========== */}
      <section id="we-work-with" style={{ padding: '0 56px 120px' }}>
        <div className="rule-thick" />
        <div className="reveal" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', padding: '14px 0 40px' }}>
          <span className="eyebrow sec-head-l">Partners</span>
        </div>
        <h3 className="reveal display-tight" style={{ fontSize: 'clamp(48px, 5.5vw, 88px)', margin: '0 0 24px', maxWidth: 1200 }}>
          Clients &amp; <span className="display-italic">partners.</span>
        </h3>
        <p className="reveal eyebrow" style={{ margin: '0 0 56px', color: TD.mid }}>A selection of clients we've worked with.</p>

        <div className="reveal" style={{
          display: 'grid',
          gridTemplateColumns: 'repeat(4, 1fr)',
          borderTop: `1px solid ${TD.hair}`,
          borderLeft: `1px solid ${TD.hair}`,
        }}>
          {logos.map((l, i) => (
            <div key={i} title={l.placeholder ? 'More to come' : l.name} style={{
              display: 'flex', alignItems: 'center', justifyContent: 'center',
              aspectRatio: '16/9',
              borderRight: `1px solid ${TD.hair}`,
              borderBottom: `1px solid ${TD.hair}`,
              padding: '20px 24px',
              opacity: l.placeholder ? 0.18 : 0.62,
              transition: 'opacity .35s ease, background .35s ease',
            }}
              onMouseEnter={(e) => { if (l.placeholder) return; e.currentTarget.style.opacity = 1; e.currentTarget.style.background = TD.paperWarm; }}
              onMouseLeave={(e) => { if (l.placeholder) return; e.currentTarget.style.opacity = 0.62; e.currentTarget.style.background = 'transparent'; }}
            >
              {l.placeholder ? (
                <span className="eyebrow" style={{ color: TD.mid }}>Coming soon</span>
              ) : (
                <img
                  src={l.src}
                  alt={l.name}
                  style={{ maxHeight: l.maxH, maxWidth: '100%', width: 'auto', height: 'auto', objectFit: 'contain', display: 'block', filter: 'brightness(0)' }}
                />
              )}
            </div>
          ))}
        </div>
      </section>

      {/* ========== V — OUR TEAM ========== */}
      <section id="founders" style={{ padding: '0 0 96px', background: TD.paperWarm }}>
        <div style={{ padding: '64px 0 0' }}>
          <div className="rule-thick team-rule" style={{ marginLeft: 56, marginRight: 56 }} />
          <div className="reveal team-head" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', padding: '14px 56px 32px' }}>
            <span className="eyebrow sec-head-l">Our team</span>
            <div className="team-drag-hint" style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
              <span className="eyebrow" style={{ color: TD.mid }}>Drag or scroll</span>
              <div style={{ display: 'flex', gap: 6 }}>
                <button
                  type="button"
                  data-team-nav="prev"
                  aria-label="Previous team member"
                  className="team-nav-btn"
                >‹</button>
                <button
                  type="button"
                  data-team-nav="next"
                  aria-label="Next team member"
                  className="team-nav-btn"
                >›</button>
              </div>
            </div>
          </div>
          <h3 className="reveal display-tight team-heading" style={{ fontSize: 'clamp(36px, 4vw, 64px)', margin: '0 0 40px 0', padding: '0 56px', maxWidth: 1000 }}>
            {founders.heading}
          </h3>

          <div
            ref={(el) => { if (el) window.__teamRail = el; }}
            className="team-rail reveal"
            style={{
              display: 'flex', gap: 28,
              justifyContent: 'flex-start',
              maxWidth: 1352, margin: '0 auto',
              overflowX: 'auto',
              scrollSnapType: 'x mandatory',
              padding: '0 56px 24px',
              scrollPaddingLeft: 56,
              scrollbarWidth: 'thin',
            }}
          >
            {founders.people.map((f, i) => (
              <article key={f.id} style={{
                flex: '0 0 420px',
                scrollSnapAlign: 'start',
                display: 'flex', flexDirection: 'column',
                background: TD.paper,
                color: TD.ink,
                border: `1px solid ${TD.hair}`,
                overflow: 'hidden',
                opacity: 1,
              }}>
                {/* Portrait — full-width top of card */}
                <div style={{
                  width: '100%',
                  aspectRatio: '3/4',
                  borderBottom: `1px solid ${TD.hair}`,
                  position: 'relative',
                  background: f.photoBg || undefined,
                  overflow: 'hidden',
                }}>
                  {f.photo ? (
                    <img
                      src={f.photo}
                      alt={f.name}
                      style={{
                        position: 'absolute', inset: 0,
                        width: '100%', height: '100%',
                        objectFit: 'cover', objectPosition: 'center top',
                        transform: f.photoScale ? `scale(${f.photoScale})` : undefined,
                        transformOrigin: 'center center',
                        display: 'block',
                      }}
                    />
                  ) : (
                    <ImageSlot fill />
                  )}
                </div>

                {/* Body */}
                <div style={{
                  display: 'flex', flexDirection: 'column', gap: 16,
                  padding: '28px 28px 26px',
                  flex: 1,
                }}>
                  <header style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
                    <h4 className="display" style={{
                      fontSize: 26, margin: 0, letterSpacing: '-0.024em', lineHeight: 1.05,
                      color: (f.upcoming && !f.joinUs) ? TD.mid : TD.ink,
                      fontStyle: f.joinUs ? 'italic' : 'normal',
                    }}>{f.name}</h4>
                    <span className="eyebrow" style={{ color: f.joinUs ? TD.accent : TD.mid }}>{f.role}</span>
                  </header>

                  <div style={{ height: 1, background: TD.hair }} />

                  <p style={{
                    fontSize: 13.5, lineHeight: 1.6, margin: 0,
                    color: f.joinUs ? TD.ink : ((f.placeholder || f.upcoming) ? TD.mid : TD.ink),
                    fontStyle: (f.placeholder || f.upcoming) ? 'italic' : 'normal',
                  }}>{f.bio}</p>

                  <div style={{ flex: 1, minHeight: 12 }} />

                  {f.joinUs ? (
                    <footer style={{
                      paddingTop: 16,
                      borderTop: `1px solid ${TD.hair}`,
                    }}>
                      <a href="mailto:hello@thosedays.co?subject=Open%20application" data-hot className="founder-link" style={{
                        fontFamily: TD.mono, fontSize: 12, letterSpacing: '0.1em',
                        color: TD.ink, fontWeight: 500,
                        display: 'inline-flex', alignItems: 'center', gap: 8,
                        textTransform: 'uppercase',
                      }}>
                        Send your work <span aria-hidden="true">↗</span>
                      </a>
                    </footer>
                  ) : !f.upcoming && (
                    <footer style={{
                      display: 'flex', flexDirection: 'column', gap: 12,
                      paddingTop: 16,
                      borderTop: `1px solid ${TD.hair}`,
                    }}>
                      <a href={`mailto:${f.email}`} data-hot className="founder-link" style={{
                        fontFamily: TD.mono, fontSize: 12, letterSpacing: '0.1em',
                        color: TD.ink, fontWeight: 500,
                      }}>
                        {f.email}
                      </a>
                      <div style={{ display: 'flex', gap: 20 }}>
                        <a href={`https://instagram.com/${f.instagram}`} target="_blank" rel="noreferrer" data-hot className="eyebrow founder-link" style={{ color: TD.mid }}>
                          Instagram <span style={{ opacity: 0.5 }}>↗</span>
                        </a>
                        <a href={`https://linkedin.com/in/${f.linkedin}`} target="_blank" rel="noreferrer" data-hot className="eyebrow founder-link" style={{ color: TD.mid }}>
                          LinkedIn <span style={{ opacity: 0.5 }}>↗</span>
                        </a>
                      </div>
                    </footer>
                  )}
                </div>
              </article>
            ))}

            {/* trailing flex spacer so the last card can snap-align flush */}
            <div style={{ flex: '0 0 28px' }} aria-hidden="true" />
          </div>
        </div>
      </section>

      {/* ========== VI — CONTACT ========== */}
      <section id="contact" style={{ padding: '72px 56px 72px' }}>
        <div className="rule-thick" />
        <div className="reveal" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', padding: '14px 0 24px' }}>
          <span className="eyebrow sec-head-l">Contact</span>
        </div>
        <h3 className="reveal hl-stagger display-xl" style={{
          fontSize: 'clamp(56px, 7.5vw, 120px)',
          margin: '0 0 40px',
          maxWidth: 1400,
          textWrap: 'balance',
          fontWeight: 800,
        }}>
          <span style={{ display: 'block' }}>Let’s <span className="display-italic" style={{ fontWeight: 800 }}>talk.</span></span>
        </h3>

        <div className="reveal" style={{ display: 'flex', flexDirection: 'column', borderTop: `1px solid ${TD.hairBold}` }}>
          {contact.lines.map((l) => (
            <a key={l.label} href={`mailto:${l.email}`} data-hot
              style={{
                display: 'grid', gridTemplateColumns: '280px 1fr auto',
                alignItems: 'baseline', gap: 40,
                padding: '28px 0',
                borderBottom: `1px solid ${TD.hairBold}`,
                color: TD.ink,
                transition: 'color .3s, padding-left .35s cubic-bezier(.2,.7,.3,1)',
              }}
              onMouseEnter={(e) => { e.currentTarget.style.color = TD.accent; e.currentTarget.style.paddingLeft = '16px'; }}
              onMouseLeave={(e) => { e.currentTarget.style.color = TD.ink; e.currentTarget.style.paddingLeft = '0px'; }}
            >
              <span className="eyebrow" style={{ color: 'inherit' }}>{l.label}</span>
              <span className="display" style={{ fontSize: 'clamp(26px, 3.2vw, 44px)', fontWeight: 500, color: 'inherit', letterSpacing: '-0.022em' }}>{l.email}</span>
              <span className="eyebrow" style={{ color: 'inherit' }}>Write <span className="arrow">↗</span></span>
            </a>
          ))}
        </div>

        <div className="reveal" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginTop: 40, gap: 24, flexWrap: 'wrap' }}>
          <span className="eyebrow">{brand.city}</span>
          <div style={{ display: 'flex', gap: 28 }}>
            {brand.socials.map((s) => (
              <a key={s} href="#" data-hot className="link eyebrow">{s}</a>
            ))}
          </div>
        </div>
      </section>

      {/* ========== FOOTER ========== */}
      <footer style={{ padding: '24px 56px 44px' }}>
        <div className="rule" />
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '18px 0 0', gap: 24, flexWrap: 'wrap' }}>
          <span className="eyebrow">Those Days · {brand.city} · ©{brand.year}</span>
        </div>
      </footer>
    </div>
  );
};

window.Homepage = Homepage;
window.LayoutA = Homepage;
