/* Page styles for the parallax homepage. Tokens only; load after tokens.css and bundle.css.
   The page is a complete static layout by default. js/scroll.js adds the 'scrub' class to <html> to switch the hero
   to the sticky, scroll-scrubbed stage, so a failed script, small screen or reduced motion never leaves a broken page. */

:root { --dim: 0.45; }   /* brightness of the scene behind the headline (read by scroll.js) */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; overflow-x: hidden; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.skip-link { position: absolute; left: var(--space-16); top: -4rem; z-index: 100; padding: 0.6rem 1rem; border-radius: var(--radius-pill); background: var(--on-accent); color: var(--nav-btn-text); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--space-16); }

.site-nav { position: fixed; top: 0; left: 0; z-index: 50; }
.xs-logo img { width: auto; height: 50px; }   /* logo source is 512x540, keep its ratio */
.xs-nav-links a:not(.nav-btn) { padding: 0.7rem 0.25rem; }

/* ---------- Hero (static by default) ---------- */
.stage { position: relative; }
.stage-sticky { position: relative; min-height: 100svh; overflow: hidden; background: var(--bg); }
.stage-poster, .stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-canvas { display: none; opacity: 0; transition: opacity 0.6s ease; }
.stage-canvas.is-ready { opacity: 1; }
.stage-shade { position: absolute; inset: 0; z-index: 1; background: var(--bg); opacity: calc(1 - var(--dim)); pointer-events: none; }

.stage-sticky .glow-bg { top: 26%; z-index: 2; }
.stage-hero {
    position: relative; z-index: 3; min-height: 100svh;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 8rem var(--gutter) 6rem;
}
.stage-hero h1 { font-size: clamp(2.75rem, 6vw, var(--h1)); text-wrap: balance; }
.stage-hero p { color: var(--text-primary); text-shadow: 0 2px 4px var(--bg), 0 0 24px var(--bg); text-wrap: balance; }
.stage-hero .hero-actions { margin-top: 0.5rem; }

.holo, .scroll-hint { display: none; }

/* ---------- Hero (scroll-scrubbed stage) ---------- */
.scrub .stage { height: 400vh; }
.scrub .stage-sticky {
    position: sticky; top: 0; height: 100vh; min-height: 0;
    /* inset shadows give the edge fades without adding a gradient */
    box-shadow: inset 0 -140px 120px -80px var(--bg), inset 0 110px 90px -70px var(--bg);
}
.scrub .stage-canvas { display: block; }
.scrub .stage-hero { position: absolute; inset: 0; min-height: 0; justify-content: flex-start; padding: 17vh var(--gutter) 0; }

/* Story text pinned onto the hologram screen. scroll.js maps this fixed-size layer onto the screen with a matrix3d,
   so only a compositor transform changes while scrolling. */
.scrub .holo { display: block; position: absolute; left: 0; top: 0; z-index: 3; width: 400px; height: 296px; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.holo-msg {
    position: absolute; inset: 0; opacity: 0;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px 24px 18px;
    background: color-mix(in srgb, var(--bg) 14%, transparent);
    border: 1px solid var(--accent-hover); border-radius: 4px;
    box-shadow: var(--shadow-featured), inset 0 0 40px var(--accent-glow);
}
.holo-top { text-align: left; }
.holo-msg h2 { margin: 2px 0 0; font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; text-shadow: 0 2px 10px var(--bg), 0 0 26px var(--accent-glow); }
.holo-msg .caption-step { font-size: 22px; color: var(--text-muted); text-shadow: 0 1px 6px var(--bg); }
.holo-msg p {
    margin: 0; padding: 10px 14px; border-radius: 3px;
    font-size: 17px; line-height: 1.4; color: var(--text-primary); text-wrap: balance;
    background: color-mix(in srgb, var(--bg) 62%, transparent);
}
.caption-step { display: inline-block; color: var(--accent); font-weight: 800; font-size: 1.25rem; letter-spacing: 0.1em; margin-bottom: 0.4rem; }

.scrub .scroll-hint {
    display: block; position: absolute; left: 50%; bottom: 2.5rem; z-index: 3; transform: translateX(-50%);
    color: var(--text-muted); font-size: 1.25rem; animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- Carousel ---------- */
.carousel-section { padding: var(--space-64) 0; border-bottom: 1px solid var(--border); }
.carousel-head { display: flex; align-items: center; justify-content: center; gap: var(--space-16); margin-bottom: var(--space-32); padding: 0 var(--gutter); }
.carousel-label { text-align: center; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.marquee-toggle {
    flex: none; width: 36px; height: 36px; border-radius: var(--radius-round); cursor: pointer;
    background: transparent; border: 1px solid var(--border); color: var(--text-secondary); transition: var(--transition);
}
.marquee-toggle:hover { border-color: var(--accent); color: var(--text-primary); }
.marquee {
    display: flex; overflow: hidden; user-select: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-around; min-width: 100%; list-style: none; margin: 0; padding: 0; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track, .marquee.is-paused .marquee-track { animation-play-state: paused; }
.marquee-track li {
    display: flex; align-items: center; gap: 0.75rem; padding: 0 var(--space-40);
    font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap;
    color: var(--text-secondary); transition: var(--transition);
}
.marquee-track li i { color: var(--accent); font-size: 1.25rem; }
.marquee-track li:hover { color: var(--text-primary); }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Steps ---------- */
.steps { display: grid; gap: var(--space-24); grid-template-columns: minmax(0, 1fr); max-width: 1100px; margin: 0 auto; padding: var(--space-80) var(--gutter) 0; text-align: center; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-24); }
.step img { display: block; width: 100%; height: auto; border-radius: var(--radius-input); margin-bottom: var(--space-16); }
.step h2 { font-size: var(--h2); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.4rem; }
.step p { color: var(--text-secondary); text-wrap: balance; }
/* with the scrub on, the same text is kept for assistive tech and crawlers but visually hidden (the holo shows it) */
.scrub .steps { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Bento ---------- */
.bento-section { padding: var(--space-128) var(--gutter); max-width: 1320px; margin: 0 auto; }
.bento {
    display: grid; gap: var(--space-20); grid-template-columns: repeat(4, 1fr);
    grid-template-areas: "a a b b" "a a c d" "e e f f";
}
.tile-a { grid-area: a; } .tile-b { grid-area: b; } .tile-c { grid-area: c; }
.tile-d { grid-area: d; } .tile-e { grid-area: e; } .tile-f { grid-area: f; }

.tile {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.tile.is-revealing { transition: none; }

/* Whole-tile links ("stretched link"): one real link per tile, its ::after covers the tile, so the image and text are clickable
   without nesting links. The niche tile keeps its own pill links and has no tile link. */
.tile-link { color: inherit; text-decoration: none; }
.tile-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-card); }
.tile:has(.tile-link) { cursor: pointer; }
.tile-link:focus-visible { outline: none; }
.tile-link:focus-visible::after { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.tile-more { margin-top: auto; padding-top: var(--space-12); font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.tile-more i { margin-left: 0.35rem; color: var(--accent); transition: transform 0.3s; }
.tile:hover .tile-more i, .tile:focus-within .tile-more i { transform: translateX(5px); }
/* the buttons inside linked tiles are labels (the heading is the link), so the tile hover drives their hover look */
.tile-btn { pointer-events: none; }
.tile:hover .btn-primary.tile-btn { transform: translateY(-3px); box-shadow: var(--shadow-btn-hover); }
.tile:hover .btn-secondary.tile-btn { background: var(--surface); border-color: var(--text-secondary); }
.tile:hover { transform: translateY(-6px); border-color: var(--accent); background: var(--surface-accent); }
.tile-media { position: relative; overflow: hidden; flex: 1 1 auto; min-height: 180px; background: var(--bg); }
.tile-media img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.tile-body { padding: var(--space-24); display: flex; flex-direction: column; gap: 0.5rem; }
.tile-body h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.tile-body p { color: var(--text-secondary); line-height: 1.7; }
.tile-icon { color: var(--accent); font-size: 1.5rem; margin-bottom: 0.25rem; }
.tile-btn { margin-top: var(--space-12); align-self: flex-start; }

.tile-d { background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-featured); }
.tile-d:hover { background: var(--accent); border-color: var(--on-accent); }      /* keeps white text at full contrast */
.tile-d h3, .tile-d p, .tile-d .tile-icon { color: var(--on-accent); }
.tile-d .btn-primary { background: var(--on-accent); color: var(--nav-btn-text); box-shadow: none; }
.tile-d .btn-primary:hover { background: var(--on-accent); }

.niche-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-12); margin: var(--space-12) 0 0; padding: 0; }
.niche-list a {
    display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1.1rem;
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    color: var(--text-primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: var(--transition);
}
.niche-list a i { color: var(--accent); }
.niche-list a:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- CTA ---------- */
/* same container as .bento-section so the panel's edges line up with the grid above it */
.cta-section { padding: 0 var(--gutter) var(--space-128); max-width: 1320px; margin: 0 auto; }
.cta-panel {
    text-align: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel); padding: var(--space-80) var(--space-32);
}
.cta-panel h2 { font-size: var(--h2); font-weight: 800; letter-spacing: -0.03em; margin-bottom: var(--space-16); text-wrap: balance; }
.cta-panel p { color: var(--text-secondary); max-width: 560px; margin: 0 auto var(--space-32); }

.footer-col h3 { color: var(--text-primary); margin-bottom: 1rem; font-size: 1rem; }
/* WCAG 1.4.12: with wider user text spacing, long words wrap instead of pushing the page sideways */
h1, h2, h3, .step, .tile-body { overflow-wrap: anywhere; }

/* ---------- Theme toggle ---------- */
/* The hero is a scene of dark video frames, so the stage keeps the dark palette in both themes (light text on dark art);
   only the page around it switches. Values are the dark tokens from tokens.css. */
.stage {
    --bg: #0b0f1a; --surface: #151b27; --surface-accent: #1c2433;
    --text-primary: #f9fafb; --text-secondary: #9ca3af; --text-muted: #cbd5e1;
    --accent: #9333ea; --accent-glow: rgba(147, 51, 234, 0.45); --border: #1f2937;
    --shadow-btn: 0 10px 25px rgba(147, 51, 234, 0.45); --shadow-btn-hover: 0 15px 35px rgba(147, 51, 234, 0.45);
    --shadow-featured: 0 0 40px rgba(147, 51, 234, 0.45); --shadow-focus: 0 0 10px rgba(147, 51, 234, 0.45);
    color: var(--text-primary);
}
/* light theme: the white nav pill from the dark theme would vanish on a light bar */
:root[data-theme="light"] .xs-nav-links a.nav-btn { background: var(--text-primary); color: var(--bg); }
.theme-toggle { flex: none; width: 48px; height: 48px; font-size: 1rem; }

/* ---------- Accessibility: 16px minimum text, 48px minimum touch targets (QA 2026-10-06) ---------- */
/* Homepage-only overrides: bundle.css is shared with the inner pages, so it stays untouched. */
.xs-nav-links a { font-size: 1rem; }
.xs-nav-links a:not(.nav-btn) { display: inline-flex; align-items: center; min-height: 48px; }
.xs-nav-links a.nav-btn { display: inline-flex; align-items: center; min-height: 48px; }
.xs-logo { display: inline-flex; align-items: center; min-height: 48px; }
.carousel-label { font-size: 1rem; }
.marquee-toggle { width: 48px; height: 48px; }
.tile-more { font-size: 1rem; }
.niche-list a { font-size: 1rem; min-height: 48px; }
.footer-col p { font-size: 1rem; }
.footer-col a { font-size: 1rem; padding: 0; min-height: 48px; display: flex; align-items: center; }
.footer-bottom { font-size: 1rem; }

/* ---------- Responsive ---------- */
@media (min-width: 769px) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .bento { grid-template-columns: repeat(2, 1fr); grid-template-areas: "a a" "b b" "c d" "e e" "f f"; }
}
@media (max-width: 768px) {
    .bento { grid-template-columns: 1fr; grid-template-areas: "a" "b" "c" "d" "e" "f"; }
    .xs-nav-links a:not(.nav-btn) { display: none; }
    .xs-nav-links { gap: 0.5rem; flex: none; }
    .xs-nav-links a.nav-btn { white-space: nowrap; padding: 0.6rem 1rem; }
    .xs-logo { min-width: 0; font-size: 1.1rem; }
    .xs-logo img { width: auto; height: 40px; }
    .stage-hero .hero-actions { flex-direction: column; width: 100%; }
    .stage-hero .hero-actions a { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; row-gap: var(--space-16); }
    .marquee { -webkit-mask-image: none; mask-image: none; }
    .marquee-track[aria-hidden="true"], .marquee-track li[aria-hidden="true"] { display: none; }
    .marquee-toggle { display: none; }
    .tile:hover, .niche-list a:hover { transform: none; }
}
