/* aislan.foina.com: personal site styles (layouts/me.blade.php).
   One file, no framework. Motion lives here and in site.js; everything
   animated is disabled under prefers-reduced-motion. */

:root {
   --bg: #07090f;
   --bg-2: #0b0f19;
   --surface: #101624;
   --surface-2: #151c2d;
   --line: rgba(255, 255, 255, .09);
   --line-strong: rgba(255, 255, 255, .18);
   --text: #e9edf5;
   --muted: #8f9ab0;
   /* Palette: three accent colours as "r g b", so glows can set their own
      alpha with rgb(var(--c1) / .2). --c1 is the main accent, the gradient runs
      c1 -> c2 -> c3. The hues feed the hero canvas (site.js). */
   --c1: 34 211 238;
   --c2: 59 130 246;
   --c3: 99 102 241;
   --hue-1: 188;
   --hue-2: 222;
   --cyan: rgb(var(--c1));
   --violet: rgb(var(--c2));
   --amber: #ffb547;
   --lime: #b6f23c;
   --grad: linear-gradient(100deg, rgb(var(--c1)), rgb(var(--c2)) 55%, rgb(var(--c3)));
   --radius: 20px;
   --radius-sm: 12px;
   --display: "Space Grotesk", "Inter", system-ui, sans-serif;
   --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
   --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
   --ease: cubic-bezier(.2, .7, .2, 1);
   --wrap: 1200px;
}

/* Palettes to compare while choosing (?palette=terminal|amber|original); the
   default above is "signal". Remove the ones not kept. */
html[data-palette="terminal"] { --c1: 52 227 160; --c2: 20 184 166; --c3: 34 211 238; --hue-1: 155; --hue-2: 180; }
html[data-palette="amber"] { --c1: 255 181 71; --c2: 255 122 26; --c3: 255 214 138; --hue-1: 38; --hue-2: 22; --amber: #7dd3fc; }
html[data-palette="original"] { --c1: 61 224 255; --c2: 138 107 255; --c3: 255 107 208; --hue-1: 190; --hue-2: 255; }

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
   margin: 0;
   background: var(--bg);
   color: var(--text);
   font: 400 16px/1.65 var(--body);
   -webkit-font-smoothing: antialiased;
   overflow-x: hidden;
}

/* Soft colour wash behind every page. */
body::before {
   content: "";
   position: fixed;
   inset: 0;
   z-index: -1;
   background:
      radial-gradient(60vw 50vh at 85% -10%, rgb(var(--c2) / .16), transparent 60%),
      radial-gradient(50vw 45vh at -5% 30%, rgb(var(--c1) / .10), transparent 60%),
      var(--bg);
}

img, video, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgb(var(--c1) / .3); }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.eyebrow {
   font: 500 .75rem/1 var(--mono);
   letter-spacing: .18em;
   text-transform: uppercase;
   color: var(--cyan);
   margin: 0 0 18px;
   display: flex;
   align-items: center;
   gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }

/* ---------- Buttons ---------- */
.btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 10px;
   padding: 13px 22px;
   border-radius: 999px;
   border: 1px solid var(--line-strong);
   background: transparent;
   font: 600 .95rem/1 var(--body);
   white-space: nowrap;
   transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text); }
.btn--primary { background: var(--text); color: #05070c; border-color: var(--text); }
.btn--primary:hover { box-shadow: 0 10px 40px -10px rgb(var(--c1) / .7); }
.btn--ghost { background: rgba(255, 255, 255, .04); }
.btn--sm { padding: 10px 16px; font-size: .85rem; }
.btn--glow {
   border-color: transparent;
   background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--grad) border-box;
}
.btn--glow:hover { border-color: transparent; box-shadow: 0 0 34px -6px rgb(var(--c2) / .8); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.pulse-dot {
   width: 8px; height: 8px; border-radius: 50%;
   background: var(--lime);
   box-shadow: 0 0 0 0 rgba(182, 242, 60, .6);
   animation: pulse 2s infinite;
}
@keyframes pulse { to { box-shadow: 0 0 0 10px rgba(182, 242, 60, 0); } }

/* ---------- Scroll progress + nav ---------- */
.scroll-progress {
   position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
   background: var(--grad);
   transform-origin: 0 50%;
   transform: scaleX(var(--progress, 0));
}

.nav {
   position: fixed; top: 14px; left: 50%; z-index: 50;
   translate: -50% 0;
   width: min(var(--wrap), 100% - 24px);
   display: flex; align-items: center; gap: 18px;
   padding: 9px 10px 9px 16px;
   border: 1px solid var(--line);
   border-radius: 999px;
   background: rgba(9, 12, 20, .55);
   backdrop-filter: blur(16px) saturate(140%);
   -webkit-backdrop-filter: blur(16px) saturate(140%);
   transition: background .3s, border-color .3s, transform .4s var(--ease);
}
.nav.is-scrolled { background: rgba(9, 12, 20, .82); border-color: var(--line-strong); }
.nav.is-hidden { transform: translateY(-140%); }
.nav__brand { display: flex; align-items: center; gap: 10px; font: 600 1rem var(--display); }
.nav__mark {
   width: 34px; height: 34px; border-radius: 50%;
   display: grid; place-items: center;
   font: 700 .8rem var(--display); color: #05070c;
   background: var(--grad);
}
.nav__name small { font: 500 .65rem var(--mono); color: var(--muted); margin-left: 6px; letter-spacing: .1em; }
.nav__links { display: flex; gap: 2px; margin-left: auto; }
.nav__links a {
   padding: 8px 13px; border-radius: 999px;
   font-size: .9rem; color: var(--muted);
   transition: color .2s, background .2s;
}
.nav__links a:hover, .nav__links a[aria-current] { color: var(--text); background: rgba(255, 255, 255, .07); }
.nav__ask { padding: 10px 16px; font-size: .85rem; }
.nav__toggle { display: none; width: 40px; height: 40px; border: 0; background: none; position: relative; }
.nav__toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); transition: transform .3s var(--ease), top .3s var(--ease); }
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 23px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 980px) {
   .nav { border-radius: 26px; flex-wrap: wrap; }
   .nav__toggle { display: block; }
   .nav__ask { margin-left: auto; }
   .nav__links {
      order: 5; width: 100%; margin: 0;
      flex-direction: column; gap: 0;
      max-height: 0; overflow: hidden;
      transition: max-height .4s var(--ease);
   }
   .nav__links.is-open { max-height: 420px; padding: 8px 0 6px; }
   .nav__links a { padding: 12px 14px; font-size: 1rem; }
}
@media (max-width: 520px) {
   .nav__name { display: none; }
   .nav__ask { padding: 9px 12px; }
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
   opacity: 0;
   transform: translateY(26px);
   transition: opacity .8s var(--ease), transform .8s var(--ease);
   transition-delay: calc(var(--i, 0) * 80ms);
}
[data-reveal="left"] { transform: translateX(-34px); }
[data-reveal="right"] { transform: translateX(34px); }
[data-reveal="zoom"] { transform: scale(.94); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.section--tight { padding: clamp(48px, 6vw, 80px) 0; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 5vw, 56px); }
.section__title { font-size: clamp(2rem, 4.6vw, 3.6rem); max-width: 16ch; }
.section__lede { color: var(--muted); max-width: 46ch; font-size: 1.05rem; margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 130px 0 90px; overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; }
.hero::after {
   content: ""; position: absolute; inset: auto 0 0 0; height: 180px; z-index: 1;
   background: linear-gradient(transparent, var(--bg));
   pointer-events: none;
}
.hero__grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero__title { font-size: clamp(2.6rem, 6.6vw, 5.6rem); white-space: nowrap; font-weight: 700; letter-spacing: -.04em; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; animation: rise 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }
@keyframes rise { from { transform: translateY(110%); } }

.rotator { display: inline-grid; vertical-align: bottom; }
.rotator > span {
   grid-area: 1 / 1;
   background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
   opacity: 0; transform: translateY(.5em) rotateX(-50deg); transform-origin: 50% 100%;
   transition: opacity .5s var(--ease), transform .6s var(--ease);
   padding-bottom: .12em;
}
.rotator > span.is-on { opacity: 1; transform: none; }
.rotator > span.is-off { opacity: 0; transform: translateY(-.5em) rotateX(50deg); }

.hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 52ch; margin: 28px 0 34px; }
.hero__lede b { color: var(--text); font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 38px; font: 500 .75rem var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.hero__meta span::before { content: "◆"; color: var(--cyan); margin-right: 8px; font-size: .6rem; }

.portrait { position: relative; aspect-ratio: 1; max-width: 420px; margin-inline: auto; width: 100%; }
.portrait__img { position: absolute; inset: 7%; border-radius: 50%; overflow: hidden; background: var(--surface); }
.portrait__img img { width: 100%; height: 100%; object-fit: cover; }
.portrait__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--line-strong); animation: spin 40s linear infinite; }
.portrait__ring--2 { inset: -7%; border-style: solid; border-color: transparent; border-top-color: var(--cyan); border-right-color: var(--violet); animation-duration: 14s; animation-direction: reverse; }
.portrait__ring i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); top: 50%; left: -5px; box-shadow: 0 0 18px var(--amber); }
.portrait__tag {
   position: absolute; padding: 8px 14px; border-radius: 999px;
   background: rgba(16, 22, 36, .85); border: 1px solid var(--line-strong);
   font: 500 .72rem var(--mono); letter-spacing: .05em; white-space: nowrap;
   backdrop-filter: blur(8px);
   animation: float 6s ease-in-out infinite;
}
.portrait__tag:nth-of-type(1) { top: 6%; left: -6%; }
.portrait__tag:nth-of-type(2) { top: 44%; right: -12%; animation-delay: -2s; }
.portrait__tag:nth-of-type(3) { bottom: 5%; left: 2%; animation-delay: -4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-10px); } }

.scroll-cue { position: absolute; left: 50%; bottom: 26px; z-index: 3; translate: -50% 0; width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 12px; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 70%, 100% { transform: translateY(13px); opacity: 0; } }

@media (max-width: 860px) {
   .hero__grid { grid-template-columns: 1fr; }
   .portrait { max-width: 250px; order: -1; margin: 0; }
   .portrait__tag:nth-of-type(1) { left: 0; }
   .portrait__tag:nth-of-type(2) { right: -30%; }
   .hero { padding-top: 110px; }
}

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); padding: 20px 0; overflow: hidden; display: flex; gap: 56px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; gap: 56px; flex-shrink: 0; align-items: center; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span, .marquee__track a { font: 600 clamp(1.1rem, 2vw, 1.5rem) var(--display); color: var(--muted); white-space: nowrap; }
.marquee__track a { text-decoration: none; transition: color .2s; }
.marquee__track a:hover, .marquee__track a:focus-visible { color: var(--text); }
.marquee__track span.label { font: 500 .72rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.marquee__track i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
@keyframes marquee { to { transform: translateX(calc(-100% - 56px)); } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg); padding: 30px 26px; }
.stat__num { font: 700 clamp(2.4rem, 5vw, 3.8rem)/1 var(--display); letter-spacing: -.04em; }
.stat__num sup { font-size: .5em; color: var(--cyan); margin-left: 2px; }
.stat__label { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* ---------- Cards with a glow that follows the pointer ---------- */
.card {
   position: relative;
   border: 1px solid var(--line);
   border-radius: var(--radius);
   background: linear-gradient(180deg, var(--surface), var(--bg-2));
   overflow: hidden;
   transition: border-color .3s, transform .5s var(--ease);
   transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.card::before {
   content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
   background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), rgb(var(--c1) / .16), transparent 60%);
   opacity: 0; transition: opacity .4s;
}
.card:hover { border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }

/* ---------- Media (image or clip) ---------- */
.media { position: relative; aspect-ratio: 16 / 10; background: #05070c; overflow: hidden; }
.media img, .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .5s; }
.media--contain img { object-fit: contain; padding: 8%; }
.media--figure { background: radial-gradient(circle at 50% 40%, rgb(var(--c1) / .13), transparent 65%), linear-gradient(rgba(140, 170, 255, .07) 1px, transparent 1px) 0 0 / 100% 28px, linear-gradient(90deg, rgba(140, 170, 255, .07) 1px, transparent 1px) 0 0 / 28px 100%, #070a12; }
.media--figure img { object-fit: contain; padding: 5% 7%; filter: drop-shadow(0 0 10px rgb(var(--c1) / .28)); }
.media--cutout { background: radial-gradient(ellipse at 50% 55%, rgb(var(--c2) / .26), transparent 62%), radial-gradient(ellipse at 50% 100%, rgb(var(--c1) / .14), transparent 55%), #070a12; }
.media--cutout img { object-fit: contain; padding: 6% 8%; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .55)); }
html[data-motion="on"] .media--cutout img { animation: cutout-float 7s ease-in-out infinite; }
html[data-motion="on"] .card:hover .media--cutout img { animation-play-state: paused; }
@keyframes cutout-float { 50% { translate: 0 -5px; } }
.media video { opacity: 0; }
.media video.is-playing { opacity: 1; }
.card:hover .media img, .card:hover .media video { transform: scale(1.05); }
.media__badge {
   position: absolute; left: 12px; top: 12px; z-index: 2;
   display: inline-flex; align-items: center; gap: 6px;
   padding: 5px 10px; border-radius: 999px;
   background: rgba(5, 7, 12, .7); border: 1px solid var(--line);
   font: 500 .65rem var(--mono); letter-spacing: .1em; text-transform: uppercase;
   backdrop-filter: blur(6px);
}
.media__badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.media--empty { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgb(var(--c2) / .35), transparent 55%), radial-gradient(circle at 80% 90%, rgb(var(--c1) / .25), transparent 50%), var(--surface); }
.media--empty span { font: 700 3rem var(--display); opacity: .25; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font: 500 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Work rail (home) ---------- */
.rail { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px max(24px, calc((100vw - var(--wrap)) / 2)) 28px; scrollbar-width: none; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.is-dragging a { pointer-events: none; }
.rail > * { flex: 0 0 min(440px, 82vw); scroll-snap-align: center; }
.rail__nav { display: flex; gap: 8px; }
.rail__nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; transition: background .2s, transform .2s; }
.rail__nav button:hover { background: rgba(255, 255, 255, .08); transform: scale(1.06); }

.work-card { display: block; }
.work-card__body { padding: 22px 24px 26px; position: relative; z-index: 2; }
.work-card__meta { display: flex; justify-content: space-between; font: 500 .72rem var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.work-card__title { font-size: 1.5rem; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.work-card__title .arrow { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: .9rem; transition: background .25s, color .25s, transform .35s var(--ease); }
.work-card:hover .arrow { background: var(--text); color: #05070c; transform: rotate(-45deg); }
.work-card__text { color: var(--muted); font-size: .95rem; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Capability stack (home) ---------- */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack__item { padding: 28px 24px 30px; }
.stack__layer { font: 500 .7rem var(--mono); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; margin-bottom: 44px; }
.stack__icon { width: 54px; height: 54px; margin-bottom: 22px; color: var(--cyan); }
.stack__icon path, .stack__icon circle, .stack__icon rect { stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.6s var(--ease) .2s; }
.is-in .stack__icon path, .is-in .stack__icon circle, .is-in .stack__icon rect { stroke-dashoffset: 0; }
.stack__item h3 { font-size: 1.35rem; margin-bottom: 10px; }
.stack__item p { color: var(--muted); font-size: .95rem; margin: 0; position: relative; z-index: 2; }
.stack__item:nth-child(2) .stack__icon { color: var(--violet); }
.stack__item:nth-child(3) .stack__icon { color: var(--amber); }
.stack__item:nth-child(4) .stack__icon { color: var(--lime); }
@media (max-width: 980px) { .stack { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stack { grid-template-columns: 1fr; } .stack__layer { margin-bottom: 24px; } }

/* ---------- Journey (home) ---------- */
.journey { border-top: 1px solid var(--line); }
.journey__row { display: grid; grid-template-columns: 150px 1fr auto; gap: 20px; align-items: center; padding: 22px 8px; border-bottom: 1px solid var(--line); position: relative; transition: padding .35s var(--ease), background .35s; }
.journey__row::before { content: ""; position: absolute; inset: 0; background: var(--grad); opacity: 0; transition: opacity .35s; z-index: -1; }
.journey__row:hover { padding-inline: 24px; }
.journey__row:hover::before { opacity: .1; }
.journey__years { font: 500 .8rem var(--mono); color: var(--muted); letter-spacing: .06em; }
.journey__org { font: 600 clamp(1.2rem, 2.6vw, 1.9rem) var(--display); letter-spacing: -.02em; }
.journey__org small { display: block; font: 400 .9rem var(--body); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.journey__role { font-size: .9rem; color: var(--muted); text-align: right; }
@media (max-width: 640px) {
   .journey__row { grid-template-columns: 1fr; gap: 4px; }
   .journey__role { text-align: left; }
}

/* ---------- Beyond engineering (home) ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.duo__card { padding: clamp(26px, 4vw, 44px); min-height: 500px; display: flex; flex-direction: column; justify-content: flex-end; }
.duo__card h3 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); margin-bottom: 12px; position: relative; z-index: 2; }
.duo__card p { color: var(--muted); max-width: 40ch; position: relative; z-index: 2; }
.duo__card .btn { align-self: flex-start; position: relative; z-index: 2; margin-top: 8px; }
.duo__art { position: absolute; inset: 0 0 44% 0; display: grid; place-items: center; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }

/* Fan of books */
.fan { position: relative; width: 128px; height: 180px; }
.fan__book { position: absolute; inset: 0; border-radius: 4px 10px 10px 4px; background: linear-gradient(135deg, #1c2540, #0d1222); border: 1px solid var(--line-strong); box-shadow: 0 30px 50px -20px #000; overflow: hidden; transition: transform .7s var(--ease); transform-origin: 50% 120%; }
.fan__book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; background: linear-gradient(90deg, rgba(255, 255, 255, .25), transparent); z-index: 1; }
.fan__book img { width: 100%; height: 100%; object-fit: cover; }
.fan__book:nth-child(1) { transform: rotate(-16deg) translateX(-34px); background: linear-gradient(135deg, #3a2a6b, #151031); }
.fan__book:nth-child(2) { transform: rotate(13deg) translateX(34px); background: linear-gradient(135deg, #0f4a5c, #081c26); }
.fan__book:nth-child(3) { background: linear-gradient(135deg, #5c3a12, #1f1407); }
.duo__card:hover .fan__book:nth-child(1) { transform: rotate(-26deg) translateX(-66px); }
.duo__card:hover .fan__book:nth-child(2) { transform: rotate(24deg) translateX(66px); }
.duo__card:hover .fan__book:nth-child(3) { transform: translateY(-14px); }
.fan__lines { position: absolute; inset: 34px 22px auto 26px; display: grid; gap: 8px; }
.fan__lines i { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.fan__lines i:nth-child(2) { width: 60%; }

/* Equalizer */
.eq { display: flex; align-items: center; gap: 7px; height: 150px; }
.eq i { width: 9px; border-radius: 6px; background: var(--grad); height: 20%; animation: eq 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--n) * -137ms); }
.eq i:nth-child(odd) { animation-duration: .8s; }
.eq i:nth-child(3n) { animation-duration: 1.4s; }
@keyframes eq { to { height: calc(30% + var(--h, 60%)); } }
.vinyl { width: 190px; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, #05070c 0 3px, #161d2e 3px 4px); border: 1px solid var(--line-strong); position: relative; animation: spin 7s linear infinite; }
.vinyl::after { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: var(--grad); box-shadow: inset 0 0 0 9px rgba(5, 7, 12, .35); }

/* ---------- AI twin band ---------- */
.twin { position: relative; border: 1px solid var(--line-strong); border-radius: calc(var(--radius) + 8px); padding: clamp(32px, 6vw, 72px); overflow: hidden; background: var(--surface); }
.twin::before { content: ""; position: absolute; width: 140%; aspect-ratio: 1; left: -20%; top: 30%; background: conic-gradient(from 0deg, rgb(var(--c1) / .35), rgb(var(--c2) / .35), rgba(255, 107, 208, .25), rgb(var(--c1) / .35)); filter: blur(90px); animation: spin 22s linear infinite; }
.twin > * { position: relative; }
.twin h2 { font-size: clamp(2rem, 5.4vw, 4.4rem); max-width: 14ch; margin-bottom: 18px; }
.twin p { max-width: 52ch; color: rgba(233, 237, 245, .8); font-size: 1.05rem; }
.asks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.ask-chip { padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(5, 7, 12, .45); font-size: .92rem; transition: background .25s, transform .25s var(--ease); backdrop-filter: blur(6px); }
.ask-chip:hover { background: var(--text); color: #05070c; transform: translateY(-3px); }
.ask-chip::before { content: "“"; color: var(--cyan); margin-right: 2px; }
.ask-chip::after { content: "”"; color: var(--cyan); margin-left: 2px; }

/* ---------- Inner page head ---------- */
.page-head { padding: clamp(130px, 16vw, 200px) 0 clamp(36px, 5vw, 60px); position: relative; }
.page-head h1 { font-size: clamp(2.6rem, 8vw, 6rem); letter-spacing: -.04em; max-width: 14ch; }
.page-head p.lede { color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 60ch; margin: 24px 0 0; }
.back { display: inline-flex; gap: 8px; align-items: center; font: 500 .78rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; transition: color .2s, gap .25s var(--ease); }
.back:hover { color: var(--text); gap: 14px; }

/* ---------- Filter chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.chip { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: none; font: 500 .8rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); transition: all .25s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--text); color: #05070c; border-color: var(--text); }
.chip sup { margin-left: 5px; opacity: .6; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 22px; }
.grid > [hidden] { display: none; }
.grid > .is-filtering { animation: pop .5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(14px); } }

/* ---------- Publication cards ---------- */
.pub { display: flex; flex-direction: column; }
.pub__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; position: relative; z-index: 2; }
.pub__kind { font: 500 .7rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); display: flex; justify-content: space-between; }
.pub__kind.is-paper { color: var(--cyan); }
.pub__kind span:last-child { color: var(--muted); }
.pub h3 { font-size: 1.25rem; line-height: 1.2; }
.pub__authors { color: var(--muted); font-size: .85rem; margin: 0; }
.pub__abstract { color: var(--muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pub.is-open .pub__abstract { -webkit-line-clamp: unset; }
.pub__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; }
.link { font: 600 .88rem var(--body); display: inline-flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: border-color .2s, gap .25s var(--ease); background: none; border-width: 0 0 1px; }
.link:hover { border-color: var(--cyan); gap: 10px; }

/* ---------- Press ---------- */
.freetime { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; padding: 20px 26px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.freetime__q { font: 600 1.05rem var(--display); margin: 0; }
.freetime__a { color: var(--muted); margin: 0; }

/* Stories: research -> product -> press */
.stories { display: grid; gap: clamp(22px, 3vw, 36px); }
.story { border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)); padding: clamp(20px, 3vw, 38px); }
.story__head { display: grid; grid-template-columns: auto 1fr auto; gap: 8px clamp(14px, 2vw, 26px); align-items: start; margin-bottom: clamp(20px, 3vw, 34px); }
.story__no { font: 700 clamp(2rem, 4vw, 3.2rem)/1 var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.story__title { font-size: clamp(1.4rem, 2.6vw, 2.1rem); margin-bottom: 6px; }
.story__summary { color: var(--muted); max-width: 62ch; margin: 0; }
.story__years { font: 500 .74rem var(--mono); letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.story__flow { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1.15fr) 44px minmax(0, 1fr); align-items: start; }
.story__link { align-self: stretch; position: relative; min-height: 44px; }
.story__link i { position: absolute; left: 4px; right: 4px; top: 13px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--violet)); opacity: .55; }
.story__link i::after { content: ""; position: absolute; right: -2px; top: -4px; width: 8px; height: 8px; border-top: 2px solid var(--violet); border-right: 2px solid var(--violet); transform: rotate(45deg); }
html[data-motion="on"] .story__link i::before { content: ""; position: absolute; top: -2px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 2px var(--cyan); animation: story-flow 2.4s linear infinite; }
@keyframes story-flow { from { left: 0; opacity: 0; } 15%, 85% { opacity: 1; } to { left: calc(100% - 6px); opacity: 0; } }
.story__fork { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 2fr); gap: 10px 22px; margin-top: clamp(20px, 3vw, 30px); padding-top: clamp(18px, 2.5vw, 26px); border-top: 1px dashed var(--line-strong); }
.story__fork-mark { font: 600 1.6rem/1 var(--display); color: var(--amber); }
.story__fork h4 { font-size: 1.1rem; margin-bottom: 6px; }
.story__fork p { color: var(--muted); font-size: .92rem; margin: 0; }
.story__fork-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 4px 18px; align-content: start; }
.story__fork .stage__row small { color: var(--amber); }
@media (max-width: 900px) { .story__fork { grid-template-columns: auto 1fr; } .story__fork-news { grid-column: 1 / -1; } }
.stage { min-width: 0; }
.stage__label { display: flex; align-items: center; gap: 10px; font: 500 .74rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; min-height: 28px; }
.stage__label span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); letter-spacing: 0; }
.stage--research .stage__label span { border-color: var(--cyan); color: var(--cyan); }
.stage--product .stage__label span { border-color: var(--violet); color: rgb(var(--c2)); }
.stage--press .stage__label span { border-color: var(--amber); color: var(--amber); }
.stage__row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: var(--radius-sm); font-size: .92rem; line-height: 1.3; transition: background .25s; }
.stage__row:hover { background: rgba(255, 255, 255, .05); }
.stage__row--press { grid-template-columns: 1fr; border-left: 2px solid var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: 0; padding-left: 14px; }
.stage__row--press:hover { border-left-color: var(--amber); }
.stage__row small { display: block; font: 500 .66rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 3px; }
.stage__row small.is-patent, .stage--press .stage__row small { color: var(--amber); }
.stage__note { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.stage__thumb { width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: #070a12; border: 1px solid var(--line); display: grid; place-items: center; font: 600 .7rem var(--mono); color: var(--muted); }
.stage__thumb img { width: 100%; height: 100%; object-fit: cover; }
.stage__thumb.is-figure img { object-fit: contain; padding: 4px; }
.stage__none { color: var(--muted); font-size: .9rem; font-style: italic; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0; }
.stage__more { display: inline-block; margin-top: 8px; font-size: .85rem; }
.stage__product { display: block; margin-bottom: 8px; }
.stage__product-body { display: block; padding: 16px 18px 18px; position: relative; z-index: 2; }
.stage__product-body small { display: block; font: 500 .68rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stage__product-body strong { display: flex; justify-content: space-between; gap: 10px; font: 600 1.25rem var(--display); margin-bottom: 6px; }
.stage__product-body > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .9rem; }
.stage__product .arrow { transition: transform .35s var(--ease); }
.stage__product:hover .arrow { transform: translateX(4px); }
.project__story { margin-top: clamp(48px, 7vw, 90px); padding: clamp(20px, 3vw, 38px); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)); }
.project__story h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 10px 0 26px; }
.project__story-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 28px 44px; }
@media (max-width: 900px) {
   .story__head { grid-template-columns: auto 1fr; }
   .story__years { grid-column: 2; justify-self: start; }
   .story__flow { grid-template-columns: 1fr; }
   .story__link { min-height: 46px; }
   .story__link i { left: 13px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; background: linear-gradient(180deg, var(--cyan), var(--violet)); }
   .story__link i::after { right: -3px; top: auto; bottom: -1px; transform: rotate(135deg); }
   html[data-motion="on"] .story__link i::before { left: -2px; animation-name: story-flow-down; }
}
@keyframes story-flow-down { from { top: 0; opacity: 0; } 15%, 85% { opacity: 1; } to { top: calc(100% - 6px); opacity: 0; } }

.press { columns: 3 320px; column-gap: 22px; }
.press__item { break-inside: avoid; margin-bottom: 22px; display: block; }
.press__img { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.press__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.press__item:hover .press__img img { transform: scale(1.06); }
.press__embed iframe, .press__embed video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; display: block; }
.press__body { padding: 20px 22px 22px; position: relative; z-index: 2; }
.press__source { display: flex; justify-content: space-between; font: 500 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.press__source time { color: var(--muted); }
.press__body h3 { font-size: 1.2rem; line-height: 1.22; margin-bottom: 10px; }
.press__body p { color: var(--muted); font-size: .92rem; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Project detail ---------- */
.project__hero { border-radius: calc(var(--radius) + 6px); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 8; position: relative; background: #05070c; }
.project__hero video, .project__hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project__hero.is-contain img { object-fit: contain; }
.project__hero.is-cutout { background: radial-gradient(ellipse at 50% 55%, rgb(var(--c2) / .22), transparent 62%), #070a12; }
.project__hero.is-cutout img { padding: 3% 5%; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .55)); }
.project__cols { display: grid; grid-template-columns: 1fr 340px; gap: clamp(28px, 5vw, 72px); margin-top: clamp(32px, 5vw, 60px); align-items: start; }
.project__text { font-size: 1.12rem; line-height: 1.8; color: rgba(233, 237, 245, .86); }
.facts { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; background: var(--surface); position: sticky; top: 96px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.facts div:last-child { border: 0; }
.facts dt { font: 500 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; text-align: right; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.spec { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.spec small { display: block; font: 500 .68rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.gallery a { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #05070c; aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: contain; transition: transform .8s var(--ease); }
.gallery a:hover img { transform: scale(1.06); }
.next-project { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: clamp(28px, 5vw, 56px) 0; border-block: 1px solid var(--line); margin-top: clamp(48px, 8vw, 96px); }
.next-project strong { font: 700 clamp(1.8rem, 5vw, 3.6rem) var(--display); letter-spacing: -.03em; display: block; transition: transform .4s var(--ease); }
.next-project:hover strong { transform: translateX(14px); }
@media (max-width: 860px) { .project__cols { grid-template-columns: 1fr; } .facts { position: static; } }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(3, 4, 8, .92); display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .3s; cursor: zoom-out; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); }

/* ---------- Story / resume ---------- */
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.profile__item { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.profile__item small { display: block; font: 500 .68rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }
.profile__item b { font-weight: 600; }

.timeline { position: relative; padding-left: 34px; max-width: 880px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline__fill { position: absolute; left: 6px; top: 8px; width: 2px; height: calc((100% - 16px) * var(--fill, 0)); background: var(--grad); box-shadow: 0 0 14px var(--cyan); }
.timeline__item { position: relative; padding: 0 0 46px; }
.timeline__item::before { content: ""; position: absolute; left: -34px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: border-color .4s, box-shadow .4s, background .4s; }
.timeline__item.is-in::before { border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 0 6px rgb(var(--c1) / .15); }
.timeline__years { font: 500 .78rem var(--mono); letter-spacing: .1em; color: var(--cyan); }
.timeline__item h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 8px 0 4px; }
.timeline__org { color: var(--muted); font-size: .95rem; margin-bottom: 12px; }
.timeline__org a { border-bottom: 1px solid var(--line-strong); }
.timeline__item p { color: rgba(233, 237, 245, .8); max-width: 62ch; margin: 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; max-width: 640px; }
.field label { display: block; font: 500 .7rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field input, .field textarea, .newsletter input {
   width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
   border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03);
   color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .newsletter input:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 4px rgb(var(--c1) / .14); }
.field textarea { min-height: 170px; resize: vertical; }
.alert { padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 22px; max-width: 640px; }
.alert--ok { border-color: rgba(182, 242, 60, .5); background: rgba(182, 242, 60, .08); }
.alert--err { border-color: rgba(255, 77, 109, .5); background: rgba(255, 77, 109, .08); }
.alert ul { list-style: disc; padding-left: 18px; }
.contact-grid { display: grid; grid-template-columns: 1fr 320px; gap: clamp(28px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Library ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 26px; }
.book { display: grid; grid-template-columns: 170px 1fr; gap: 26px; padding: 28px; align-items: center; }
.book__cover { perspective: 900px; }
.book__cover div { aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; overflow: hidden; background: var(--surface-2); box-shadow: 18px 22px 40px -18px #000; transform: rotateY(-22deg); transition: transform .7s var(--ease); position: relative; }
.book__cover div::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, .3), transparent); }
.book:hover .book__cover div { transform: rotateY(-4deg) scale(1.03); }
.book__cover img { width: 100%; height: 100%; object-fit: cover; }
.book__body { position: relative; z-index: 2; }
.book__body h3 { font-size: 1.6rem; margin-bottom: 6px; }
.book__body .muted { font-size: .92rem; }
.book__desc { color: var(--muted); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 12px 0 16px; }
.book__actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .book { grid-template-columns: 1fr; } .book__cover { max-width: 170px; } }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: clamp(36px, 8vw, 90px) 24px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 1.8rem; margin-bottom: 10px; }

/* Reader */
.reader-page { background: #05070c; }
.reader-page .footer, .reader-page #ai-chat-widget { display: none; }
.reader { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding-top: 84px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.reader__bar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; flex-wrap: wrap; }
.reader__title { font: 600 1rem var(--display); margin-right: auto; }
.reader__title small { color: var(--muted); font: 400 .82rem var(--body); margin-left: 8px; }
.reader__tools { display: flex; align-items: center; gap: 6px; }
.reader__tools button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; transition: background .2s; }
.reader__tools button:hover { background: rgba(255, 255, 255, .08); }
.reader__tools output { font: 500 .8rem var(--mono); min-width: 84px; text-align: center; color: var(--muted); }
.reader__stage { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 8px 12px 20px; overflow: hidden; touch-action: pan-y; }
.reader__leaf { position: relative; height: min(calc(100svh - 210px), 1100px); aspect-ratio: var(--ratio, .7); max-width: 100%; background: #f4f1ea; box-shadow: 0 30px 80px -30px #000; overflow: hidden; }
.reader__leaf canvas { width: 100%; height: 100%; pointer-events: none; }
.reader__leaf.is-turning { animation: turn .45s var(--ease); }
@keyframes turn { from { opacity: .2; transform: translateX(var(--dir, 20px)); } }
.reader__leaf[hidden] { display: none; }
.reader__leaf::after { content: ""; position: absolute; inset: 0; }
.reader__edge { position: absolute; top: 0; bottom: 0; width: 22%; border: 0; background: none; z-index: 3; }
.reader__edge--prev { left: 0; cursor: w-resize; }
.reader__edge--next { right: 0; cursor: e-resize; }
.reader__progress { height: 3px; background: var(--line); }
.reader__progress i { display: block; height: 100%; width: calc(var(--read, 0) * 100%); background: var(--grad); transition: width .3s; }
.reader__note { text-align: center; font-size: .75rem; color: var(--muted); padding: 10px 16px 16px; margin: 0; }
.reader.is-shielded .reader__stage { filter: blur(26px); }
@media print { .reader-page main, .reader-page .nav { display: none !important; } .reader-page::after { content: "This book is available to read online only."; color: #000; } }

/* ---------- Music ---------- */
.music-hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.music-art { position: relative; display: grid; place-items: center; min-height: 340px; }
.music-art .vinyl { width: min(340px, 70vw); }
.music-art .eq { position: absolute; bottom: 0; height: 110px; opacity: .8; }
.spotify { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.spotify iframe { display: block; width: 100%; border: 0; }
.linkrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (max-width: 820px) { .music-hero { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: clamp(60px, 10vw, 120px); padding: clamp(48px, 8vw, 90px) 0 28px; background: linear-gradient(transparent, rgb(var(--c2) / .06)); }
.footer__grid { display: grid; grid-template-columns: 1.7fr .7fr .9fr 1.2fr; gap: 36px; }
.footer__title { font-size: clamp(1.6rem, 3vw, 2.4rem); max-width: 18ch; margin-bottom: 24px; }
.footer__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.footer__h { font: 500 .7rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer__list li { margin-bottom: 9px; }
.footer__list a { color: rgba(233, 237, 245, .8); transition: color .2s; }
.footer__list a:hover { color: var(--cyan); }
.newsletter { display: flex; gap: 8px; margin-top: 12px; }
.newsletter input { padding: 10px 14px; border-radius: 999px; min-width: 0; }
.footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.footer__base a { margin-left: 18px; }
.footer__base a:hover { color: var(--text); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__lead { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- AI chat launcher: match the new look ---------- */
#ai-chat-fab { background: var(--grad) !important; box-shadow: 0 10px 40px -8px rgb(var(--c2) / .8) !important; width: 62px !important; height: 62px !important; bottom: 24px !important; right: 24px !important; }
#ai-chat-fab .fab-text { font-family: var(--display) !important; font-size: 22px !important; color: #05070c; }

/* ---------- Motion off ----------
   <html data-motion> is set before first paint by the layout: it follows the
   OS "reduce motion" setting unless the visitor used the footer switch. */
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
   animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
}
html[data-motion="off"] [data-reveal] { opacity: 1; transform: none; }
html[data-motion="off"] .hero__canvas { display: none; }

.motion-switch { background: none; border: 0; padding: 0; color: inherit; font: inherit; margin-left: 18px; }
.motion-switch:hover { color: var(--text); }
.motion-switch b { color: var(--cyan); font-weight: 500; }
.press__gone, .press__archive { display: inline-block; margin-left: 12px; font-size: .8rem; color: var(--muted); }
.press__gone:first-child { margin-left: 0; }
.press__archive { text-decoration: underline; text-underline-offset: 3px; }
.press__archive:hover { color: var(--text, #fff); }

/* Peek: an article or a publication in a window of the site */
html.has-peek { overflow: hidden; }
.peek { width: min(1100px, calc(100vw - 24px)); max-width: none; height: min(860px, calc(100dvh - 24px)); max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-2); color: var(--text); overflow: hidden; }
.peek[open] { display: flex; flex-direction: column; }
.peek:not(.peek--framed) { height: auto; max-height: calc(100dvh - 24px); width: min(760px, calc(100vw - 24px)); }
.peek::backdrop { background: rgba(3, 5, 10, .78); backdrop-filter: blur(6px); }
.peek__bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.peek__head { flex: 1; min-width: 0; }
.peek__head small { display: block; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin-bottom: 3px; }
.peek__head strong { display: block; font: 600 1.05rem/1.25 var(--display); }
.peek--framed .peek__head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek__open, .peek__video { flex: none; padding: 9px 16px; font-size: .85rem; white-space: nowrap; }
.peek__video[hidden] { display: none; }
.peek__close { flex: none; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 50%; background: none; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.peek__close:hover { background: rgba(255, 255, 255, .08); }
.peek__note { margin: 0; padding: 8px 22px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.peek__body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.peek__summary { padding: 22px; }
.peek__summary img { display: block; max-width: 100%; max-height: 340px; margin: 0 auto 20px; object-fit: contain; }
.peek__summary p { margin: 0 0 12px; color: var(--muted); line-height: 1.65; }
.peek__summary .peek__by { color: var(--text); font-size: .9rem; }
.peek--framed .peek__summary { display: none; }
.peek__frame { display: none; position: relative; flex: 1; min-height: 0; background: #fff; }
.peek--framed .peek__frame { display: block; }
.peek__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.peek__frame span { position: absolute; inset: 0; display: none; place-items: center; color: #55607a; font-size: .95rem; }
.peek__frame.is-loading span { display: grid; }
@media (max-width: 640px) { .peek__open span { display: none; } .peek__bar { padding-left: 16px; } }
.section__more { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Project videos: a poster with a play button; the player replaces it on play. */
.videos { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.video { margin: 0; }
.video__play, .video iframe { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid rgb(var(--c1) / .16); border-radius: 16px; overflow: hidden; background: #000; }
.video__play img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .3s, transform .6s; }
.video__play:hover img, .video__play:focus-visible img { opacity: 1; transform: scale(1.03); }
.video__button { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; background: rgb(7 9 15 / .72); border: 1px solid rgb(var(--c1) / .6); box-shadow: 0 0 32px rgb(var(--c1) / .35); }
.video__button::after { content: ""; position: absolute; left: 27px; top: 21px; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent rgb(var(--c1)); }
.video figcaption { margin-top: 10px; font-size: .92rem; color: var(--muted, #9aa7bd); }
html[data-motion="off"] .video__play img { transition: none; }
