/* aifirst.lu Version 3 — the robot story on top of the v4 design system (tokens from v4.css).
   Default = readable static layout (no JS, reduced motion, crawlers).
   html.enhanced (set by story.js once GSAP + Lenis load) = pinned scroll scenes. */

/* ── hero: the robot instead of the 3D orb ───────────────────────── */
.robot-card picture, .robot-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.robot-card img { animation: robotDrift 18s ease-in-out infinite alternate; transform-origin: 50% 30%; }
/* winking eyes (assets/face.js): same box + same drift as the photo, so the eyes stay on the screen */
.robot-card .face-layer { position: absolute; inset: 0; pointer-events: none; animation: robotDrift 18s ease-in-out infinite alternate; transform-origin: 50% 30%; }
.robot-card .face-canvas { position: absolute; display: block; }
@keyframes robotDrift { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-1.5%); } }
.robot-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,14,11,.35) 0%, transparent 25%, transparent 60%, rgba(15,14,11,.55) 100%); pointer-events: none; }
.robot-card .orb-top, .robot-card .float { z-index: 3; }
.agent-chip { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.92); box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); white-space: nowrap; animation: pop .9s var(--ease) both, chipFloat 6s ease-in-out infinite; }
.agent-chip .i { width: 16px; height: 16px; }
.agent-chip.a1 { left: 6%; top: 18%; animation-delay: .8s, 0s; }
.agent-chip.a2 { right: 6%; top: 14%; animation-delay: .95s, 1.2s; }
.agent-chip.a3 { left: 4%; top: 42%; animation-delay: 1.1s, .6s; }
.agent-chip.a4 { right: 4%; top: 38%; animation-delay: 1.25s, 1.8s; }
.agent-chip.a5 { right: 12%; top: 60%; animation-delay: 1.4s, 2.4s; }
@keyframes chipFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* ── chat band: soft glow instead of the 3D wave ─────────────────── */
.band-glow { position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 20% 60%, rgba(255,95,141,.22), transparent 70%), radial-gradient(45% 55% at 80% 40%, rgba(255,194,75,.18), transparent 70%);
  animation: glowShift 14s ease-in-out infinite alternate; }
@keyframes glowShift { to { transform: translate(4%, -3%) scale(1.08); } }

/* ── final panel: robot close-up instead of the orb ──────────────── */
.final-orb picture, .final-orb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── Lower costs. More money. ─────────────────────────────────────── */
.money-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: clamp(30px, 5vw, 80px); align-items: start; }
.money h2 { font-size: clamp(44px, 6vw, 96px); line-height: .95; }
.money-word { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.4vw, 36px); letter-spacing: -0.04em; color: var(--ink); padding-bottom: 12px; margin-bottom: 6px; border-bottom: 3px solid transparent; border-image: var(--grad-hot) 1; }
.money-col ul { list-style: none; }
.money-col li { padding: 12px 0; border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: clamp(24px, 2.4vw, 38px); letter-spacing: -0.035em; color: var(--ink); }
.money-col:nth-of-type(1) .money-word, .money-col:nth-of-type(1) li { color: #A9A49A; }
.money-col:nth-of-type(1) li { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(22,21,15,.3); }

/* ── the story: static layout ────────────────────────────────────── */
.story { --cw: min(64vw, 1120px, calc((100vh - 280px) * 16 / 9)); --chh: calc(var(--cw) * 9 / 16);
  margin-top: var(--section); background: #0F0E0B; color: #F1ECE3; padding: clamp(64px, 8vw, 110px) var(--gut); }
.story .fly-media, .story .fly-box, .story .ch-box, .story .screen { display: none; }
.story .statement { max-width: 820px; margin: 0 auto 60px; font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3.2vw, 48px); line-height: 1.12; letter-spacing: -0.03em; color: #fff; }
.story .statement em { font-family: var(--serif); font-weight: 400; color: #E6DFD2; }
.story .split { font-family: var(--display); font-weight: 600; letter-spacing: -0.045em; line-height: .95; font-size: clamp(36px, 4.4vw, 68px); color: #fff; }
.story .split .w-a, .story .split .w-b { display: block; }
.story .split .w-b { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: #F1ECE3; }
.story .pain .split, .story .pain .split .w-b { color: #A9A49A; }
.story .ch-text { color: #CFC8BB; font-size: 17px; max-width: 42ch; }
.story .pain .ch-text { font-style: italic; color: #A9A49A; }
.story .ch-img { margin: 18px 0; border-radius: 14px; overflow: hidden; }
.story .pain .ch-img { filter: saturate(.6); }
.story .ch-intro { max-width: 1180px; margin: 0 auto 70px; }
.story .ch-list { list-style: none; max-width: 1180px; margin: 0 auto; display: grid; gap: 80px; }
.story .ch { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.chip-proof { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: rgba(241,236,227,.1); border: 1px solid rgba(241,236,227,.18); color: #F1ECE3; font-weight: 600; font-size: 13.5px; }
.chip-proof::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad-hot); }
.chip-proof b { color: #FFC24B; font-weight: 700; padding-right: 10px; border-right: 1px solid rgba(241,236,227,.25); }
.chip-proof b:last-child { border-right: 0; padding-right: 0; }

/* ── the story: pinned scenes ────────────────────────────────────── */
.enhanced .story { padding: 0; }
.enhanced .story .stage { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.enhanced .story .media { display: block; position: absolute; top: var(--ct, 0); right: var(--cr, 0); bottom: var(--cb, 0); left: var(--cl, 0); border-radius: var(--cround, 0); overflow: hidden; }
.enhanced .story .media video, .enhanced .story .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.enhanced .story .scrim { position: absolute; inset: 0; background: rgba(12,11,8,.62); opacity: 0; }
.enhanced .story .fly-box, .enhanced .story .ch-box { display: block; position: absolute; left: 50%; top: 50%; width: var(--cw); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); pointer-events: none; }
.enhanced .story .statement { position: absolute; z-index: 4; left: 50%; top: 50%; width: min(1000px, 86vw); margin: 0; transform: translate(-50%, -50%); text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.enhanced .story .statement .wd { display: inline-block; opacity: .12; filter: blur(8px); }
.enhanced .story .screen { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 140px -20px rgba(255,122,61,.45), 0 60px 120px -40px rgba(0,0,0,.9); }
.enhanced .story .scan { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: multiply;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px), radial-gradient(120% 100% at 50% 50%, transparent 60%, rgba(0,0,0,.45) 100%); }
.enhanced .story .frames .layer { position: absolute; inset: 0; opacity: 0; }
.enhanced .story .frames .layer video { opacity: 0; transition: opacity .3s ease; }
.enhanced .story .frames .layer.has-video video { opacity: 1; }
.enhanced .story .scanline { display: block; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 2; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, #FFC24B 20%, #FF7A3D 50%, #FF5F8D 80%, transparent); box-shadow: 0 0 22px 6px rgba(255,122,61,.55), 0 0 60px 18px rgba(255,95,141,.25); }
.story .scanline { display: none; }
.enhanced .story .ch-list, .enhanced .story .ch, .enhanced .story .ch .side, .enhanced .story .ch-intro { position: absolute; inset: 0; display: block; margin: 0; padding: 0; max-width: none; pointer-events: none; }
.enhanced .story .ch-img { display: none; }
.enhanced .story .split { position: absolute; inset: 0; z-index: 3; font-size: clamp(44px, 6.4vw, 118px); }
.enhanced .story .split .w-a, .enhanced .story .split .w-b { position: absolute; will-change: transform, opacity, filter; }
.enhanced .story .split .w-a { left: var(--gut); top: calc(50% - var(--chh) / 2 + .1em); transform: translateY(-100%); }
.enhanced .story .split .w-b { right: var(--gut); top: calc(50% + var(--chh) / 2 - .08em); text-align: right; }
.enhanced .story .ch-text { position: absolute; z-index: 3; left: var(--gut); top: calc(50% + var(--chh) / 2 + 26px); max-width: min(34ch, 30vw); font-size: 16px; }
.enhanced .story .chip-proof { position: absolute; z-index: 4; margin: 0; left: calc(50% - var(--cw) / 2 + 18px); top: calc(50% + var(--chh) / 2 - 58px); background: rgba(15,14,11,.72); backdrop-filter: blur(8px); }
.enhanced .story .ch .w-a, .enhanced .story .ch .w-b, .enhanced .story .ch .ch-text, .enhanced .story .ch .chip-proof,
.enhanced .story .ch-intro .w-a, .enhanced .story .ch-intro .w-b { opacity: 0; }

/* ── responsive ─────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .money-grid { grid-template-columns: 1fr; }
  .agent-chip.a3, .agent-chip.a5 { display: none; }
}
@media (max-width: 700px) {
  .story { --cw: 92vw; }
  .story .ch { grid-template-columns: 1fr; }
  .enhanced .story .ch-box { top: 40%; }
  .enhanced .story .split { font-size: clamp(36px, 10.5vw, 56px); }
  .enhanced .story .split .w-a { top: calc(40% - var(--chh) / 2 - 14px); }
  .enhanced .story .split .w-b { top: calc(40% + var(--chh) / 2 + 56px); }
  .enhanced .story .ch-intro .split .w-b { top: calc(40% + var(--chh) / 2 + 16px); }
  .enhanced .story .chip-proof { left: 50%; top: calc(40% + var(--chh) / 2 + 12px); transform: translateX(-50%); font-size: 12px; white-space: normal; max-width: calc(100vw - 2 * var(--gut)); justify-content: center; text-align: center; }
  .enhanced .story .ch-text { top: calc(40% + var(--chh) / 2 + 118px); max-width: none; right: var(--gut); font-size: 14.5px; }
  .agent-chip { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .robot-card img, .robot-card .face-layer, .agent-chip, .band-glow { animation: none !important; }
}

/* layers: each picture fills the screen (clip-path needs a real box) */
.enhanced .story .frames picture { position: absolute; inset: 0; }

/* header turns dark while it floats over the story */
header.on-dark { background: rgba(15,14,11,.72) !important; box-shadow: none !important; }
header.on-dark .logo, header.on-dark .nav-links a { color: #F1ECE3; }
header.on-dark .logo-mark { background: #F1ECE3; }
header.on-dark .logo-mark .i { color: var(--ink); }
header.on-dark .cta { background: #F1ECE3; color: var(--ink); }
header { transition: background-color .3s ease; }
@media (max-width: 700px) {
  .enhanced .story .chip-proof { white-space: nowrap; font-size: 11.5px; gap: 8px; padding: 6px 12px; }
  .enhanced .story .chip-proof b { padding-right: 8px; }
}

/* ══ fast story (v8d): 5 jobs, big title, one big state line ═════ */
/* static */
.story .ch { grid-template-columns: 1fr 1fr; }
.story .ch-title { grid-column: 1 / -1; font-family: var(--display); font-weight: 600; font-size: clamp(40px, 5.4vw, 88px); letter-spacing: -0.045em; line-height: .95; color: #fff; }
.ch-num { display: inline-block; margin-right: .35em; font-family: var(--mono); font-size: .22em; font-weight: 400; letter-spacing: .08em; color: #FFC24B; vertical-align: .9em; }
.state { font-size: clamp(19px, 1.9vw, 28px); line-height: 1.3; letter-spacing: -0.015em; color: #fff; }
.state b { display: inline-block; margin-right: 12px; padding: 5px 12px; border-radius: 999px; font-family: var(--mono); font-size: .5em; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; vertical-align: .35em; background: rgba(241,236,227,.14); color: #CFC8BB; }
.auto .state b { background: var(--grad-hot); color: var(--ink); font-weight: 600; }
.state i { font-style: normal; font-size: .6em; color: #FFC24B; white-space: nowrap; }
.story .pain .state { color: #BDB6A9; }

/* enhanced */
.enhanced .story .ch-title { position: absolute; z-index: 3; left: calc(50% - var(--cw) / 2); top: calc(50% - var(--chh) / 2 - 18px); transform: translateY(-100%); margin: 0; font-size: clamp(44px, 6vw, 104px); opacity: 0; text-shadow: 0 4px 40px rgba(0,0,0,.5); }
.enhanced .story .state { position: absolute; z-index: 3; left: calc(50% - var(--cw) / 2); right: calc(50% - var(--cw) / 2); top: calc(50% + var(--chh) / 2 + 22px); margin: 0; opacity: 0; }
.enhanced .story .pain .state { color: #CFC8BB; }
@media (max-width: 700px) {
  .story .ch { grid-template-columns: 1fr; }
  .enhanced .story .ch-title { top: calc(40% - var(--chh) / 2 - 14px); font-size: clamp(34px, 10vw, 52px); }
  .enhanced .story .state { top: calc(40% + var(--chh) / 2 + 18px); font-size: 19px; }
}
/* title anchored from below (GSAP owns transform) */
.enhanced .story .ch-title { transform: none; top: auto; bottom: calc(50% + var(--chh) / 2 + 16px); }
/* no dead black screen between the flight and the first job: the jobs stage starts on top of the flight's last screen */
.enhanced .story .ch-stage { margin-top: -100vh; margin-top: -100svh; z-index: 2; }
@media (max-width: 700px) { .enhanced .story .ch-title { top: auto; bottom: calc(60% + var(--chh) / 2 + 12px); } }

/* ══ v8f: wink, flight headline, titles clear of the menu ════════ */
/* the robot winks every few seconds (hero card + final panel) */
.robot-card .wink img { animation: robotDrift 18s ease-in-out infinite alternate; }
.wink { position: absolute; inset: 0; z-index: 1; opacity: 0; animation: wink 4.8s steps(1, end) infinite 1.6s; }
.robot-card .wink { z-index: 1; }
.robot-card.face-on .wink { display: none; }
.final-orb .wink { animation-duration: 5.6s; }
@keyframes wink { 0% { opacity: 0; } 86% { opacity: 1; } 93% { opacity: 0; } }
.fly-wink { position: absolute; inset: 0; z-index: 1; opacity: 0; }
.fly-wink img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story .fly-media .scrim { z-index: 2; }

/* flight headline */
.fly-head { display: none; }
.enhanced .story .fly-head { display: block; position: absolute; inset: 0; z-index: 3; margin: 0; pointer-events: none; font-family: var(--display); font-weight: 600; letter-spacing: -0.045em; line-height: .95; font-size: clamp(48px, 7vw, 120px); color: #fff; }
.enhanced .story .fly-head span { position: absolute; will-change: transform, opacity; text-shadow: 0 4px 40px rgba(0,0,0,.45); }
.enhanced .story .fly-head .w-a { left: var(--gut); bottom: calc(50% + var(--chh) / 2 + 14px); }
.enhanced .story .fly-head .w-b { right: var(--gut); top: calc(50% + var(--chh) / 2 + 6px); }
.enhanced .story .fly-head em { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }

/* job titles never slide under the menu bar: smaller screen box, pushed a little down */
.story { --cw: min(64vw, 1120px, calc((100vh - 400px) * 16 / 9)); --cy: 40px; }
.enhanced .story .ch-box { top: calc(50% + var(--cy)); }
.enhanced .story .ch-title { bottom: calc(50% - var(--cy) + var(--chh) / 2 + 16px); font-size: clamp(40px, 5.2vw, 92px); }
.enhanced .story .state { top: calc(50% + var(--cy) + var(--chh) / 2 + 22px); }
@media (max-width: 700px) {
  .story { --cw: 92vw; --cy: 0px; }
  .enhanced .story .ch-box { top: 40%; }
  .enhanced .story .ch-title { bottom: calc(60% + var(--chh) / 2 + 12px); }
  .enhanced .story .state { top: calc(40% + var(--chh) / 2 + 18px); }
  .enhanced .story .fly-head { font-size: clamp(38px, 11vw, 60px); }
  .enhanced .story .fly-head .w-a { bottom: calc(50% + var(--chh) / 2 + 10px); }
}
@media (prefers-reduced-motion: reduce) { .wink { animation: none; } }
.robot-card::after { z-index: 2; }

/* ── What it saves (v8k, replaces the Löffler results block) ───────── */
.save-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 64px); padding: clamp(24px, 4vw, 56px); align-items: center; }
.save h2 { font-size: clamp(34px, 4.2vw, 62px); line-height: 1; margin: 16px 0 16px; }
.save-lead > p { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; color: var(--text); max-width: 34ch; }
.save-lead .save-num { display: flex; align-items: center; gap: 18px; max-width: none; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.save-num strong { position: relative; font-family: var(--display); font-weight: 700; font-size: clamp(64px, 7vw, 108px); line-height: .9; letter-spacing: -0.03em; color: var(--ink); white-space: nowrap; }
.save-num strong::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -8px; height: 5px; border-radius: 3px; background: var(--grad-hot); }
.save-num span { font-size: 16px; line-height: 1.35; color: var(--text); max-width: 20ch; }
.save-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.save-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-content: start; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.66); border: 1px solid var(--line); transition: transform .35s var(--ease), background .25s, box-shadow .35s var(--ease); }
.save-list .i { grid-row: span 2; width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--ink); color: #fff; transition: background .25s, color .25s, transform .35s var(--ease); }
.save-list b { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); transition: color .25s; }
.save-list span { font-size: 14.5px; line-height: 1.4; color: var(--text); transition: color .25s; }
.save-list li:hover { transform: translateY(-4px); background: var(--ink); box-shadow: 0 30px 60px -28px rgba(22,21,15,.6); }
.save-list li:hover b { color: #fff; }
.save-list li:hover span { color: rgba(255,255,255,.68); }
.save-list li:hover .i { background: var(--grad-hot); color: var(--ink); transform: rotate(-6deg) scale(1.06); }
@media (max-width: 900px) { .save-card { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .save-list { grid-template-columns: 1fr; gap: 10px; }
  .save-list li { padding: 14px; }
  .save-lead .save-num { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .save-list li, .save-list .i { transition: none; } .save-list li:hover { transform: none; } }

/* small phones: a bare 1fr column has a min-content floor, so the table pushed the card 14px off a 320px screen */
@media (max-width: 1000px) { .define { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) {
  .define-table table { font-size: 13px; }
  .define-table th, .define-table td { overflow-wrap: anywhere; padding: 10px 4px; }
}
