@import url("./fonts.css?v=202609081607");

/* Breathing room between the text and the edges of the screen, shared by the header,
   the chapters, the contact section and its footer so that they all line up. */
:root {
    --gutter: clamp(80px, 8vw, 160px);      /* left and right */
    --baseline: clamp(96px, 18vh, 200px);   /* below the chapter text */
}

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

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #000000;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    cursor: none;
}

* { cursor: none !important; }

::-webkit-scrollbar { display: none; width: 0; }

#webgl {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    outline: none;
}

/* ---- The pointer: a blue light, brighter than the fireflies it draws ----
   Positioned by app.js through transform; the glow breathes on its own layer. */
.cursor-inner {
    position: fixed; top: 0; left: 0;
    width: 12px; height: 12px; border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, #e2f4ff 28%, #5cb2ff 62%, #1f6bff 100%);
    box-shadow: 0 0 6px 2px rgba(150, 210, 255, 0.95), 0 0 26px 5px rgba(60, 140, 255, 0.45);
    transform: translate(-50%, -50%);
    pointer-events: none; z-index: 9999; will-change: transform;   /* no blend mode: it forced the whole page to be re-composited each frame */
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.35s, opacity 0.3s;
}
.cursor-inner::before {
    content: ''; position: absolute; left: 50%; top: 50%; width: 120px; height: 120px;
    margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none;
    /* A bell-shaped fall-off in small steps: a few straight stops would draw rings. */
    background: radial-gradient(circle closest-side, rgba(140, 195, 255, 0.42) 0%, rgba(130, 188, 255, 0.35) 15%,
        rgba(115, 175, 255, 0.21) 30%, rgba(100, 160, 255, 0.09) 45%, rgba(90, 150, 255, 0.03) 60%,
        rgba(80, 140, 255, 0.008) 75%, rgba(70, 130, 255, 0) 100%);
    animation: cursor-breathe 2.6s ease-in-out infinite;
    transition: opacity 0.35s;
}
.cursor-inner::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px;
    margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
    border: 1.5px solid rgba(170, 225, 255, 0.9); opacity: 0;
}
@keyframes cursor-breathe {
    0%, 100% { transform: scale(0.85); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}
@keyframes cursor-ring {
    from { transform: scale(0.3); opacity: 1; }
    to { transform: scale(2.6); opacity: 0; }
}
body.cursor-press .cursor-inner::after { animation: cursor-ring 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
body.cursor-hover .cursor-inner { width: 20px; height: 20px; }
body.cursor-text .cursor-inner { width: 3px; height: 22px; border-radius: 2px; }
body.cursor-text .cursor-inner::before { opacity: 0.35; }
body.cursor-hidden .cursor-inner { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .cursor-inner::before { animation: none; } }
@media (hover: none), (pointer: coarse) {
    .cursor-inner { display: none; }
    * { cursor: auto !important; }
}

.cinematic-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;          /* clicks pass through to canvas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 var(--gutter) 40px var(--gutter);
    box-sizing: border-box;
}

/* ---- Header: quiet, editorial, one typeface ---- */
.main-header {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; height: 70px; z-index: 20;
    pointer-events: auto;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}
/* The contact chapter is a screen of its own: the header lifts away (back on scrolling up). */
body.contact-open .main-header {
    opacity: 0; transform: translateY(-12px); visibility: hidden; pointer-events: none;
    transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.8s;
}
.brand {
    display: inline-flex; align-items: center; gap: 12px; color: #ffffff; text-decoration: none;
    transition: visibility 0s linear 0s;
}
/* On the home chapter the large logo is the title, and the contact chapter signs with it:
   there the header one steps aside. It stays focusable only while shown (visibility flips
   after its exit has played). */
body.on-home .brand, body.on-contact .brand { visibility: hidden; transition: visibility 0s linear 1.15s; }
/* Read by screen readers and search engines, not shown. */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* The home title is the logo itself, about the size of the words it replaces, revealed the
   same way (it rises out of the title's mask). */
.hero-logo { display: block; height: 0.82em; width: auto; aspect-ratio: 1013.9 / 129.5; margin-bottom: 0.12em; }
/* The logo is one line (7.8:1): its height steps down on small screens.
   (assets/brand/mark-digitalstudio.svg keeps the longer "digitalstudio" version.) */
.brand-mark { display: block; width: 157px; height: 20px; flex: 0 0 auto; overflow: hidden; }
/* The titles' reveal, upside down: the logo comes down out of its mask (the titles rise),
   with the same curves and timings; the blur is scaled to the logo's height. */
.brand-mark svg {
    display: block; width: 100%; height: 100%;
    transition: transform 1.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease-out,
                filter 1.05s cubic-bezier(0.16, 1, 0.3, 1);
}
body.on-home .brand-mark svg, body.on-contact .brand-mark svg { transform: translateY(-112%); opacity: 0; filter: blur(4px); }
.brand-text {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.header-nav { display: flex; align-items: center; gap: 34px; }
.nav-link {
    position: relative; padding: 6px 0;
    font-size: 12px; font-weight: 400; letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55); text-decoration: none; transition: color 0.4s;
}
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: #ffffff; transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-link:hover, .nav-link.is-active { color: #ffffff; }
.nav-link.is-active::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 26px; }
.header-counter {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 400; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45);
}
.header-counter #brand-chapter { color: #ffffff; }
.counter-sep { width: 14px; height: 1px; background: rgba(255, 255, 255, 0.3); }
.contact-btn {
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    padding: 9px 18px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px;
    color: #ffffff; text-decoration: none; background: transparent;
    font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
    transition: border-color 0.4s, background 0.4s;
}
.contact-btn:hover { border-color: rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.06); }
/* Sound toggle: four bars, flat while silent, softly moving once the night is heard. */
.sound-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 36px; height: 36px; padding: 0; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22); background: transparent; color: #ffffff;
    transition: border-color 0.4s, background 0.4s;
}
.sound-btn:hover { border-color: rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.06); }
.sound-bars { display: flex; align-items: center; gap: 2px; height: 12px; }
.sound-bars i {
    display: block; width: 2px; height: 5px; border-radius: 1px; background: currentColor;
    opacity: 0.55; transition: height 0.4s, opacity 0.4s;
}
.sound-bars i:nth-child(2) { height: 9px; }
.sound-bars i:nth-child(3) { height: 6px; }
.sound-bars i:nth-child(4) { height: 3px; }
.sound-btn[aria-pressed="true"] .sound-bars i { opacity: 1; }
.sound-btn[aria-pressed="true"] .sound-bars i { animation: sound-bar 1.2s ease-in-out infinite; }
.sound-btn[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -0.45s; }
.sound-btn[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -0.8s; }
.sound-btn[aria-pressed="true"] .sound-bars i:nth-child(4) { animation-delay: -0.2s; }
@keyframes sound-bar { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@media (prefers-reduced-motion: reduce) {
    .sound-btn[aria-pressed="true"] .sound-bars i { animation: none; height: 8px; }
}
.header-progress { position: fixed; top: 70px; left: 0; right: 0; height: 1px; z-index: 6; pointer-events: none; transition: opacity 0.6s; }
body.contact-open .header-progress { opacity: 0; }
.header-progress span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.15));
}

.slide { position: absolute; bottom: var(--baseline); pointer-events: none; }

#slide-1 { left: 0; width: 100%; bottom: var(--baseline); }
#slide-1 .slide-title, #slide-1 .slide-eyebrow { margin-left: var(--gutter); }
/* Small label above a chapter title, in the voice of the contact chapter's. */
.slide-eyebrow {
    display: flex; align-items: center; gap: 12px; margin-bottom: 26px;
    font: 500 11px/1 'Space Grotesk', sans-serif; letter-spacing: 0.22em; text-transform: uppercase; color: #cfd6e6;
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide.active .slide-eyebrow { opacity: 1; transform: none; }
#slide-1 .desc-row { position: relative; display: flex; width: 100%; }
#slide-1 .col-1 {
    margin-left: var(--gutter);
    width: calc(42vw - var(--gutter));
    max-width: calc(42vw - var(--gutter));
}
#slide-1 .col-2 { display: none; }

#slide-2 { left: calc(50vw + 20px); right: var(--gutter); width: auto; }
#slide-2 .slide-desc { max-width: min(60ch, 100%); }   /* the paragraph runs almost as wide as its title */

/* Slide 2: four benefits, icon first */
.benefits { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 26px 40px; margin-top: 10px; }
.benefit {
    display: flex; align-items: flex-start; gap: 14px;
    opacity: 0; transform: translateY(14px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.benefit:nth-child(1) { transition-delay: 0.28s; }
.benefit:nth-child(2) { transition-delay: 0.36s; }
.benefit:nth-child(3) { transition-delay: 0.44s; }
.benefit:nth-child(4) { transition-delay: 0.52s; }
.slide.active .benefit { opacity: 1; transform: none; }
.benefit-icon {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.35); color: #ffffff;
    display: grid; place-items: center;
}
.benefit-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.benefit p { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 300; color: #d1d5db; }

/* Slide 4: key figures */
.figures { display: flex; gap: clamp(28px, 4vw, 64px); margin: 28px 0 0; }
.figure {
    opacity: 0; transform: translateY(14px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.figure:nth-child(1) { transition-delay: 0.45s; }
.figure:nth-child(2) { transition-delay: 0.53s; }
.figure:nth-child(3) { transition-delay: 0.61s; }
.slide.active .figure { opacity: 1; transform: none; }
.figure dt { font-size: clamp(36px, 3.4vw, 52px); font-weight: 400; line-height: 1; letter-spacing: -0.03em; color: #f2f7ff; font-variant-numeric: tabular-nums; }
.figure dd { margin: 10px 0 0; font-size: 12px; line-height: 1.5; font-weight: 400; color: #aeb6c4; }

#slide-3 { left: var(--gutter); width: min(620px, 46vw); }

#slide-4 { left: var(--gutter); max-width: 640px; }
#slide-4 .slide-desc { max-width: 44ch; }

.slide-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(44px, 5.4vw, 80px);
    line-height: 1.0;
    font-weight: 400;
    letter-spacing: -0.035em;
    margin-bottom: 22px;
    color: #f2f7ff;
}
.nowrap { white-space: nowrap; }   /* place names stay whole: never "L'Isle-sur-la- / Sorgue" */
.slide-desc {
    font-size: 16px; line-height: 1.7; font-weight: 300;
    color: #d1d5db; letter-spacing: 0.3px; text-wrap: pretty;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;   /* leaving: quick, never over the next chapter */
}
/* Arriving: every paragraph fades in slowly, once its title has begun to rise. */
.slide.active .slide-desc {
    opacity: 1; transform: translateY(0);
    transition: opacity 2.4s cubic-bezier(0.45, 0, 0.55, 1) 0.5s, transform 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

/* Title reveal: each line rises out of its own mask with a long exponential ease.
   Transform and opacity only, so it stays on the compositor and silky. */
.slide-title .line, .contact-title .line {
    display: block; overflow: hidden; white-space: nowrap;   /* two lines, never three: see fitTitles() */
    padding: 0.06em 0 0.16em; margin: -0.06em 0 -0.16em;
}
.line-inner {
    display: block; transform: translateY(112%); opacity: 0; filter: blur(12px);
    transition: transform 1.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease-out,
                filter 1.05s cubic-bezier(0.16, 1, 0.3, 1);
}
.line.muted .line-inner { transition-delay: 0.09s; }
.slide.active .slide-title .line-inner, .contact.is-visible .contact-title .line-inner {
    transform: none; opacity: 1; filter: blur(0);
}
.slide-title .line.muted, .contact-title .line.muted { color: #b9c1d1; }
.slide.active { pointer-events: auto; }

.story-progress {
    position: fixed; top: 50%; right: 40px; transform: translateY(-50%);
    z-index: 5; pointer-events: none; transition: opacity 0.6s;
}
.story-dashes { display: flex; flex-direction: column; gap: 12px; }
.story-dash { width: 2px; height: 40px; background: rgba(255, 255, 255, 0.15); border-radius: 2px; }
.story-dash-fill { width: 100%; height: 0%; background: #ffffff; border-radius: 2px; }

.grid-horizontal-line {
    position: fixed; top: 70px; left: 0; right: 0;
    width: 100%; height: 1px;
    background: rgba(255, 255, 255, 0.065);
    z-index: 5; pointer-events: none;
}

/* ---- Scroll cue, home chapter only: a pulse of light runs down a hairline, the way a
   firefly drifts, and lands softly. It invites the first gesture (a click turns the page). ---- */
.scroll-cue {
    position: absolute; left: 50%; bottom: 26px; z-index: 11;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 10px 18px; transform: translateX(-50%);
    font: 500 9px/1 'Space Grotesk', sans-serif; letter-spacing: 0.36em; text-transform: uppercase;
    color: rgba(207, 214, 230, 0.7); text-decoration: none;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.5s ease, color 0.3s ease, visibility 0s linear 0.5s;
}
/* It shows once the loader has gone and the home title has settled. */
body.on-home:not(.is-loading) .scroll-cue {
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity 1.4s ease 1.6s, color 0.3s ease, visibility 0s linear 0s;
}
.scroll-cue:hover { color: #ffffff; }
.scroll-cue-label {
    padding-left: 0.36em;   /* centred despite the tracking */
    animation: scroll-cue-blink 2.8s ease-in-out infinite paused;   /* one slow blink per pulse, in step */
}
.scroll-cue-track {
    position: relative; width: 1px; height: 56px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%,
        rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
}
/* The pulse: a short trail of the fireflies' blue with a bright head, eased like the page glide. */
.scroll-cue-track i {
    position: absolute; left: 0; top: 0; width: 1px; height: 24px;
    background: linear-gradient(180deg, rgba(143, 211, 255, 0) 0%, rgba(143, 211, 255, 0.9) 100%);
    opacity: 0; transform: translateY(-24px);
    animation: scroll-cue-pulse 2.8s cubic-bezier(0.65, 0, 0.35, 1) infinite paused;
}
.scroll-cue-track i::after {
    content: ''; position: absolute; left: 50%; bottom: -2px; width: 4px; height: 4px; margin-left: -2px;
    border-radius: 50%; background: #ffffff; box-shadow: 0 0 6px 2px rgba(143, 211, 255, 0.85);
}
/* Where it lands, a soft glow (no ring) brightens for a moment. */
.scroll-cue-track::after {
    content: ''; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; margin-left: -9px;
    border-radius: 50%; pointer-events: none; opacity: 0;
    background: radial-gradient(circle closest-side, rgba(143, 211, 255, 0.55) 0%, rgba(112, 185, 255, 0.2) 40%,
        rgba(80, 150, 255, 0.05) 70%, rgba(60, 120, 255, 0) 100%);
    animation: scroll-cue-land 2.8s ease-out infinite paused;
}
body.on-home:not(.is-loading) .scroll-cue-label,
body.on-home:not(.is-loading) .scroll-cue-track i,
body.on-home:not(.is-loading) .scroll-cue-track::after { animation-play-state: running; }
@keyframes scroll-cue-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}
@keyframes scroll-cue-pulse {
    0% { opacity: 0; transform: translateY(-24px); }
    20%, 60% { opacity: 1; }
    82%, 100% { opacity: 0; transform: translateY(44px); }
}
@keyframes scroll-cue-land {
    0%, 62% { opacity: 0; transform: scale(0.5); }
    74% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
    .scroll-cue-label { animation: none; }
    .scroll-cue-track i { animation: none; opacity: 1; transform: translateY(16px); }
    .scroll-cue-track::after { animation: none; }
}
@media (max-width: 900px), (max-aspect-ratio: 4/5) {
    .scroll-cue { bottom: 18px; gap: 12px; }
    .scroll-cue-track { height: 44px; }
}

/* ---- Contact chapter: a real section that rises over the fixed 3D stage ---- */
.scroll-stage { height: 900vh; pointer-events: none; }
.grid-horizontal-line { transition: opacity 0.6s; }
body.contact-open .story-progress, body.contact-open .grid-horizontal-line { opacity: 0; }

.contact {
    position: relative; z-index: 8;
    min-height: 100vh;
    display: flex; align-items: center;
    padding: clamp(56px, 10vh, 120px) var(--gutter) clamp(90px, 10vh, 120px);   /* no header; room for the footer */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.22) 20%, rgba(0, 0, 0, 0.30) 100%);
}
.contact-inner {
    width: 100%; max-width: 1760px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 600px);
    justify-content: space-between; gap: clamp(40px, 6vw, 130px); align-items: center;
}
/* Without the form, the contact chapter is a single centred column. */
.contact-inner:not(:has(.contact-card)) {
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.contact-inner:not(:has(.contact-card)) .contact-eyebrow { justify-content: center; }
.contact-inner:not(:has(.contact-card)) .contact-lead { max-width: 34em; text-wrap: balance; }
.contact-eyebrow {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
    padding-left: 0.22em;   /* the tracking after the last letter would push the label off-centre */
    font: 500 11px/1 'Space Grotesk', sans-serif; letter-spacing: 0.22em; text-transform: uppercase; color: #cfd6e6;
}
/* The dot before each label is a small light, in the fireflies' blue: its halo breathes
   and its core pulses, on two periods that never line up. */
.eyebrow-dot {
    position: relative; flex: 0 0 auto;
    width: 6px; height: 6px; border-radius: 50%; background: #fff;
    box-shadow: 0 0 8px 2px rgba(190, 230, 255, 0.9);
    animation: dot-core 1.9s ease-in-out infinite;   /* opacity only: no repaint per frame */
}
.eyebrow-dot::before {
    content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle closest-side, rgba(143, 211, 255, 0.6) 0%, rgba(130, 200, 255, 0.46) 15%,
        rgba(112, 185, 255, 0.26) 30%, rgba(95, 168, 255, 0.11) 45%, rgba(80, 150, 255, 0.035) 60%,
        rgba(70, 135, 255, 0.008) 75%, rgba(60, 120, 255, 0) 100%);
    animation: dot-halo 2.8s ease-in-out infinite;
}
@keyframes dot-core {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}
@keyframes dot-halo {
    0%, 100% { transform: scale(0.55); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .eyebrow-dot, .eyebrow-dot::before { animation: none; }
}
.contact-title {
    font-size: clamp(48px, 5.8vw, 92px); line-height: 0.9; letter-spacing: -0.035em; font-weight: 400;
    color: #f2f7ff; margin-bottom: 40px;
}

.contact-lead { font-size: 17px; line-height: 1.7; font-weight: 300; color: #d1d5db; margin-bottom: clamp(36px, 6vh, 60px); }
.contact-mail {
    display: inline-flex; align-items: center; justify-content: center; text-align: center; padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff; text-decoration: none; font-size: 18px; font-weight: 400; transition: border-color 0.35s;
}
.contact-mail:hover { border-color: #ffffff; }
/* The logo signs the chapter, under its "Studio digital" label. It rises out of its mask like
   the titles (same curves and timings, blur scaled to its height). */
.contact-logo {
    display: block; height: clamp(22px, 2.2vw, 30px); aspect-ratio: 1013.9 / 129.5;
    margin: 0 auto clamp(28px, 5vh, 48px); overflow: hidden; color: #ffffff;
}
.contact-logo svg {
    display: block; width: 100%; height: 100%;
    transform: translateY(112%); opacity: 0; filter: blur(6px);
    transition: transform 1.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease-out,
                filter 1.05s cubic-bezier(0.16, 1, 0.3, 1);
}
.contact.is-visible .contact-logo svg { transform: none; opacity: 1; filter: blur(0); }
.arrow { font-size: 1.15em; line-height: 1; }
.contact-lead, .contact-mail, .contact-card {
    opacity: 0; transform: translateY(34px);
    transition: opacity 0.6s ease, transform 0.6s ease;   /* leaving: quick */
}
/* Arriving: the paragraph fades in slowly, like the chapters' ones, and the e-mail after it. */
.contact.is-visible .contact-lead, .contact.is-visible .contact-mail, .contact.is-visible .contact-card {
    opacity: 1; transform: none;
    transition: opacity 2.4s cubic-bezier(0.45, 0, 0.55, 1) 0.5s, transform 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}
.contact.is-visible .contact-mail, .contact.is-visible .contact-card { transition-delay: 1s; }

/* The card. By default a CSS glass; when the 3D slab is active (body.has-glass-card)
   the CSS body turns transparent and the WebGL glass shows through behind the fields. */
.contact-card {
    position: relative; width: 100%; max-width: 600px; justify-self: end;
    border-radius: 30px; padding: 40px 44px 38px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
body.has-glass-card .contact-card {
    border-color: transparent; background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: none;
}
/* Specular rim on top of the 3D glass: a bright hairline that fades along the edge. */
body.has-glass-card .contact-card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    padding: 1px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 28%,
                                rgba(255, 255, 255, 0.04) 60%, rgba(255, 255, 255, 0.35) 100%);
}
body.has-glass-card .contact-card::after {
    content: ''; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none;
    background: radial-gradient(120% 80% at 18% 0%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 55%);
}
.contact-card > * { position: relative; z-index: 1; }
.card-head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px;
    font: 500 11px/1 'Space Grotesk', sans-serif; letter-spacing: 0.22em; text-transform: uppercase; color: #d7deea;
}
.card-head .arrow { font-size: 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 32px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field-wide { grid-column: 1 / -1; }
.field-label { font: 500 12px/1 'Space Grotesk', sans-serif; letter-spacing: 0.04em; color: #dfe6f3; }
.field-label em { font-style: normal; color: #ff9ab8; }
.field-label small { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #8d97ab; margin-left: 8px; }
.field input, .field textarea {
    width: 100%; background: transparent; border: 0; border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.20);
    padding: 6px 0 12px; color: #ffffff; outline: none; -webkit-appearance: none; appearance: none;
    font: 300 16px/1.4 'Space Grotesk', sans-serif; transition: border-color 0.3s;
    user-select: text; -webkit-user-select: text;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8b94a6; }
.field input:focus, .field textarea:focus { border-bottom-color: #ffffff; }
.field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #0b0b10 inset; -webkit-text-fill-color: #ffffff; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 34px; }
.card-note { font-size: 10.5px; line-height: 1.7; color: #b3bccb; letter-spacing: 0.3px; }
.pill-btn {
    display: inline-flex; align-items: center; gap: 18px; padding: 16px 26px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.04); color: #ffffff;
    font: 500 13px/1 'Space Grotesk', sans-serif; letter-spacing: 0.2px;
    transition: background 0.3s, color 0.3s, transform 0.3s, border-color 0.3s;
}
.pill-btn .arrow { font-size: 16px; }
.pill-btn:hover { background: #ffffff; color: #000000; border-color: #ffffff; transform: translateY(-2px); }
@media (max-width: 1000px) {
    .contact-inner { grid-template-columns: 1fr; gap: 56px; }
    .contact-card { justify-self: stretch; max-width: none; padding: 32px 26px; }
    .contact-title { letter-spacing: -3px; }
    .field-grid { grid-template-columns: 1fr; gap: 24px; }
    .card-foot { flex-direction: column; align-items: flex-start; }
}

/* ---- Mini footer: hairline, quiet, technical ---- */
.contact-footer {
    position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    padding: 18px 0 20px; border-top: 1px solid rgba(255, 255, 255, 0.06);
    font: 400 10px/1 'Space Grotesk', sans-serif; letter-spacing: 0.14em; text-transform: uppercase;
    color: #ffffff;
    opacity: 0; transition: opacity 1s ease 0.6s;
}
.contact.is-visible .contact-footer { opacity: 1; }
.contact-footer a { color: inherit; text-decoration: none; transition: opacity 0.3s; }
.contact-footer a:hover { opacity: 0.7; }
.footer-spec { color: inherit; }
@media (max-width: 1000px) {
    .contact-footer { flex-wrap: wrap; justify-content: center; text-align: center; gap: 10px 24px; }
    .footer-spec { display: none; }
}

/* ============================================================================
   Portrait / narrow screens: stacked composition. Text on top with the 3D
   object below on slides 1 and 3; object on top, text below on slides 2 and 4
   (the camera framing in cameraFrame() follows the same alternation).
   ============================================================================ */
@media (max-width: 900px), (max-aspect-ratio: 4/5) {
    :root { --gutter: 30px; }
    .cinematic-container { padding: 0 var(--gutter) 24px; }
    .story-progress { right: 12px; }
    .slide, #slide-1, #slide-2, #slide-3, #slide-4 { left: var(--gutter); right: var(--gutter); width: auto; max-width: none; bottom: auto; }
    #slide-1, #slide-3 { top: 106px; bottom: auto; }
    #slide-2, #slide-4 { bottom: 9%; top: auto; }
    #slide-1 .slide-title, #slide-2 .slide-title, .slide-title {
        margin-left: 0; margin-bottom: 14px;
        font-size: clamp(34px, 10vw, 64px); letter-spacing: -0.035em; line-height: 1.0;
    }
    .slide-eyebrow, #slide-1 .slide-eyebrow { margin-left: 0; margin-bottom: 18px; }
    #slide-1 .desc-row { flex-direction: column; }
    #slide-1 .col-1, #slide-1 .col-2 { position: static; margin-left: 0; width: 100%; max-width: 36ch; }
    #slide-1 .col-2 { display: none; }
    .benefits { grid-template-columns: 1fr 1fr; gap: 16px 14px; }
    .benefit { gap: 10px; }
    .benefit-icon { flex-basis: 26px; width: 26px; height: 26px; border-radius: 6px; }
    .benefit-icon svg { width: 14px; height: 14px; }
    .benefit p { font-size: 13px; line-height: 1.45; }
    .figures { gap: 22px; margin-top: 20px; }
    .figure dt { font-size: 34px; }
    .figure dd { font-size: 11px; }
    #slide-3, #slide-4 { left: var(--gutter); width: auto; max-width: none; }
    .slide-desc { font-size: 15px; line-height: 1.6; max-width: 36ch; }
    .contact-title { font-size: clamp(40px, 10.5vw, 120px); letter-spacing: -0.035em; }
    .contact-footer { display: none; }   /* on phones the contact chapter ends on the e-mail */
    .contact-lead { margin-bottom: clamp(32px, 5vh, 40px); }
}
/* Header compaction */
@media (max-width: 1240px) {
    .header-nav { gap: 24px; }
    .header-actions { gap: 20px; }
}
@media (max-width: 1100px) { .header-counter { display: none; } }
@media (max-width: 980px) { .header-nav { display: none; } }
@media (max-width: 900px) {   /* where the chapters stack, the menu gives way */
    .header-nav { display: none; }
    .brand-mark { width: 133px; height: 17px; }
    .contact-btn { padding: 8px 14px; font-size: 11px; }
}
@media (max-width: 420px) {
    .brand-mark { width: 117px; height: 15px; }
    .slide-eyebrow, .contact-eyebrow { letter-spacing: 0.15em; }   /* labels stay on one line */
}

/* ---- Preloader: a firefly's light gathering itself ----
   A wide blue halo narrows to a single point as the page loads (its scale is set by the
   inline script in index.html). Then the loader fades and its point stays: it is the first
   firefly, which lights the logo's full stop, then joins the swarm (ARRIVAL in js/app.js). */
.loader {
    position: fixed; inset: 0; z-index: 9990; background: #000000;
    display: grid; place-items: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.8s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* The site's own backdrop, painted by the inline script in index.html (black until then). */
.loader-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.loader-light { position: relative; width: 0; height: 0; }
.loader-halo, .loader-core { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; }
.loader-halo {
    --size: min(70vmin, 520px);
    width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
    /* Neon in the site's own range: electric blue at the heart, through indigo, to the
       violet of the backdrop's corner; saturated beyond the backdrop so it glows. */
    background: radial-gradient(circle closest-side, rgba(125, 160, 255, 0.95) 0%, rgba(77, 107, 255, 0.82) 12%,
        rgba(98, 88, 255, 0.55) 26%, rgba(128, 72, 245, 0.28) 42%, rgba(150, 60, 225, 0.1) 58%,
        rgba(155, 55, 210, 0.025) 75%, rgba(155, 50, 205, 0) 100%);
    mix-blend-mode: screen;   /* light added to the blue backdrop, as it is on the site (loader only) */
    will-change: transform;
    animation: loader-breathe 1.7s ease-in-out infinite, loader-hue 4.6s ease-in-out infinite;
}
.loader-core {
    width: 10px; height: 10px; margin: -5px 0 0 -5px;
    background: radial-gradient(circle, #ffffff 0%, #eef0ff 40%, rgba(120, 140, 255, 0) 100%);
    box-shadow: 0 0 6px 2px rgba(225, 232, 255, 0.95), 0 0 14px 5px rgba(80, 110, 255, 0.9),
                0 0 32px 10px rgba(125, 70, 235, 0.55);
    animation: loader-flicker 1.3s ease-in-out infinite;
}
.loader-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@keyframes loader-breathe {
    0%, 100% { opacity: 0.8; }
    40% { opacity: 1; }
    70% { opacity: 0.65; }
}
@keyframes loader-hue {   /* drifts from blue toward violet and back, as the backdrop does */
    0%, 100% { filter: hue-rotate(-6deg); }
    50% { filter: hue-rotate(26deg); }
}
@keyframes loader-flicker {
    0%, 100% { opacity: 0.85; }
    25% { opacity: 1; }
    50% { opacity: 0.7; }
    80% { opacity: 0.95; }
}
@media (prefers-reduced-motion: reduce) { .loader-halo, .loader-core { animation: none; } }
body.is-loading { overflow: hidden; }
