/* Team page layout and motion. Colours, fonts and radii come from theme-landing.css or theme-deck.css. */
@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); line-height: 1.1; letter-spacing: var(--display-tracking); text-wrap: balance; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; flex: none; }
[dir="rtl"] .flip-rtl { scale: -1 1; }
:root { --start-edge: left; --end-edge: right; }
[dir="rtl"] { --start-edge: right; --end-edge: left; }

/* Background: three slow colour fields and a faint grid of nodes, so the page feels alive without moving the content. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; width: 46vmax; aspect-ratio: 1; border-radius: 50%; filter: blur(70px); opacity: var(--blob-opacity); animation: drift 26s ease-in-out infinite alternate; }
.backdrop i:nth-child(1) { background: var(--blob-1); inset-block-start: -18vmax; inset-inline-start: -12vmax; }
.backdrop i:nth-child(2) { background: var(--blob-2); inset-block-start: 30vh; inset-inline-end: -20vmax; animation-duration: 32s; animation-delay: -8s; }
.backdrop i:nth-child(3) { background: var(--blob-3); inset-block-end: -24vmax; inset-inline-start: 20vw; animation-duration: 38s; animation-delay: -14s; }
.backdrop::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.4px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 70%); }
@keyframes drift { to { translate: 6vmax 8vmax; rotate: 25deg; } }

/* Top bar */
.top { width: min(1120px, 100% - 32px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px 8px; animation: drop 0.7s var(--ease) both; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.25rem; }
.brand img { width: 34px; height: 34px; transition: rotate 0.8s var(--ease); }
.brand:hover img { rotate: 360deg; }
.switches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.switch { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 500; transition: border-color 0.2s, translate 0.2s var(--ease), background 0.2s; }
.switch:hover { border-color: var(--brand); translate: 0 -2px; }
.switch .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--switch-dot); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
@keyframes drop { from { opacity: 0; translate: 0 -12px; } }

.page { width: min(1120px, 100% - 32px); margin: 0 auto; display: grid; gap: clamp(12px, 2vw, 20px); padding-block: 8px 28px; }

/* Reveal on scroll. team.js adds .is-in; without JavaScript everything shows. */
.js [data-reveal] { opacity: 0; translate: 0 28px; transition: opacity 0.8s var(--ease), translate 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* Hero */
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 8px; padding: clamp(20px, 3.4vw, 40px); border-radius: var(--r-lg); background: var(--hero-bg); color: var(--hero-ink); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-glow); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--hero-line); color: var(--hero-muted); font-size: 0.9rem; font-weight: 500; }
.eyebrow b { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.hero h1 { margin-top: 16px; font-size: clamp(2.3rem, 5.6vw, 4.2rem); }
.hero h1 .hl { position: relative; isolation: isolate; white-space: nowrap; }
.hl-en { color: var(--hero-hl); }
.hl-mark { position: absolute; inset-inline: -2%; inset-block-end: -0.2em; width: 104%; height: 0.32em; overflow: visible; }
.hl-mark path { fill: none; stroke: var(--hl-stroke); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s 0.6s var(--ease) forwards; }
.hl-ar { padding-inline: 0.12em; }
.hl-ar::before { content: ""; position: absolute; z-index: -1; inset: 0.3em -0.04em 0.12em; border-radius: 0.18em 0.5em 0.22em 0.45em; background: var(--hl-fill); rotate: -1.5deg; transform-origin: var(--start-edge) center; animation: swipe 0.8s 0.6s var(--ease) both; }
.lead { margin-top: 12px; max-width: 34ch; color: var(--hero-muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes swipe { from { scale: 0 1; } }
@keyframes pulse { 50% { scale: 1.6; opacity: 0.5; } }

.hero-yqn { position: relative; min-height: 200px; display: grid; place-items: center; }
.net { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.net line { stroke: var(--net-line); stroke-width: 1.5; stroke-dasharray: 5 7; animation: flow 3s linear infinite; }
.net circle { fill: var(--net-node); transform-box: fill-box; transform-origin: center; animation: node 3.2s ease-in-out infinite; animation-delay: calc(var(--n) * -0.6s); }
@keyframes flow { to { stroke-dashoffset: -48; } }
@keyframes node { 50% { scale: 1.45; opacity: 0.55; } }

.yqn { user-select: none; -webkit-user-drag: none; }
.yqn-wrap { position: relative; display: block; width: min(60%, 240px); animation: enter 1.1s 0.2s var(--ease-bounce) both, bob 4s 1.3s ease-in-out infinite; }
.yqn-hero { width: 100%; filter: drop-shadow(0 18px 30px var(--yqn-shadow)); }
.bubble { position: absolute; right: 80%; bottom: 70%; padding: 8px 14px; border-radius: 16px 16px 6px 16px; background: var(--bubble-bg); color: var(--bubble-ink); font-weight: 600; font-size: 0.95rem; white-space: nowrap; box-shadow: 0 10px 24px var(--yqn-shadow); transform-origin: right bottom; animation: pop 0.6s 1.2s var(--ease-bounce) both, sway 5s 2s ease-in-out infinite; }
.bubble::after { content: ""; position: absolute; right: 2px; top: 100%; translate: 0 -1px; border: 8px solid transparent; border-top-color: var(--bubble-bg); border-bottom-width: 0; }
@keyframes enter { from { opacity: 0; translate: -40% 30px; rotate: -12deg; } }
@keyframes bob { 50% { translate: 0 -12px; rotate: 2deg; } }
@keyframes pop { from { opacity: 0; scale: 0.3; } }
@keyframes sway { 50% { rotate: -3deg; } }

@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; min-height: 360px; }
  .hero-yqn { min-height: 290px; }
}

/* Cards */
.card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: clamp(16px, 2.6vw, 28px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.card-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; }
.step { grid-row: span 2; font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600; color: var(--step-ink); background: var(--step-bg); padding: 4px 10px; border-radius: var(--r-sm); align-self: start; }
.card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.card-head p { color: var(--muted); }
.links { display: grid; gap: clamp(16px, 2.4vw, 24px); }
@media (min-width: 900px) { .links { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }

/* Demo video */
.video { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--video-bg); aspect-ratio: 1440 / 900; border: 1px solid var(--line); }
.video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgb(0 0 0 / 0.45), transparent 40%); }
.video-bar { position: absolute; z-index: 1; inset-inline: 12px; inset-block-end: 12px; display: flex; justify-content: space-between; gap: 8px; }
.vbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 0; border-radius: var(--r-pill); background: rgb(255 255 255 / 0.92); color: #0f1720; font: 600 0.92rem/1 var(--font-body); cursor: pointer; transition: scale 0.2s var(--ease), background 0.2s; backdrop-filter: blur(6px); }
.vbtn:hover { scale: 1.05; background: #fff; }
.vbtn .when-on, .vbtn[aria-pressed="true"] .when-off { display: none; }
.vbtn[aria-pressed="true"] .when-on { display: inline; }
.vbtn .ring { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); }
.vbtn[aria-pressed="false"] .ring::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--accent-strong); animation: ripple 1.6s ease-out infinite; }
@keyframes ripple { from { scale: 0.6; opacity: 1; } to { scale: 1.8; opacity: 0; } }

.promo { overflow: hidden; border-radius: var(--r-md); background: var(--video-bg); aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.promo video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

/* QR */
.qr-card { align-items: stretch; }
.qr-tile { position: relative; align-self: center; width: min(100%, 250px); padding: 14px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--qr-border); box-shadow: var(--qr-shadow); transition: rotate 0.4s var(--ease), translate 0.4s var(--ease); transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.qr-frame { display: block; position: relative; overflow: hidden; border-radius: 6px; }
.qr-code { width: 100%; height: auto; }
.qr-dots circle { fill: var(--qr-ink); }
.qr-ring { fill: var(--qr-ink); }
.qr-pupil { fill: var(--qr-pupil); }
.js .qr-dots circle { transform-box: fill-box; transform-origin: center; scale: 0; transition: scale 0.5s var(--ease-bounce); transition-delay: calc(var(--d) * 700ms + 200ms); }
.js .is-in .qr-dots circle { scale: 1; }
.js .qr-eyes path { transform-box: fill-box; transform-origin: center; opacity: 0; scale: 0.4; transition: opacity 0.5s, scale 0.6s var(--ease-bounce); transition-delay: 0.1s; }
.js .is-in .qr-eyes path { opacity: 1; scale: 1; }
.qr-head { display: block; position: absolute; inset: 0; margin: auto; width: 28%; height: 28%; }
.qr-head img { width: 100%; animation: peek 4.5s ease-in-out infinite; }
.js .qr-head { opacity: 0; scale: 0.2; transition: opacity 0.4s 1.1s, scale 0.7s 1.1s var(--ease-bounce); }
.js .is-in .qr-head { opacity: 1; scale: 1; }
@keyframes peek { 0%, 100% { translate: 0 0; rotate: 0deg; } 30% { translate: 0 -4%; rotate: -5deg; } 60% { translate: 0 2%; rotate: 4deg; } }
.qr-scan { position: absolute; inset-inline: 0; height: 26%; inset-block-start: -30%; background: linear-gradient(to bottom, transparent, var(--scan) 85%, transparent); mix-blend-mode: multiply; animation: scan 3.6s 2s ease-in-out infinite; pointer-events: none; }
@keyframes scan { 0% { inset-block-start: -30%; } 55%, 100% { inset-block-start: 110%; } }
.qr-actions { display: grid; gap: 10px; }
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 20px; border-radius: var(--r-btn); background: var(--btn-bg); color: var(--btn-ink); font-weight: 600; font-size: 1.05rem; text-decoration: none; transition: background 0.25s, translate 0.25s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%); translate: -120% 0; transition: translate 0.7s var(--ease); }
.btn:hover { background: var(--btn-hover); translate: 0 -2px; }
.btn:hover::before { translate: 120% 0; }
.btn .icon { transition: translate 0.25s var(--ease); }
.btn:hover .icon { translate: 3px -3px; }
[dir="rtl"] .btn .icon { scale: -1 1; }
[dir="rtl"] .btn:hover .icon { translate: -3px -3px; }
.btn-url { font-family: var(--font-mono); font-size: 0.95em; }

/* Team */
.team { display: grid; gap: 14px; }
@media (min-width: 640px) { .team { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .team { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.member { --tilt: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px; padding-inline-end: 16px; border-radius: var(--r-md); background: var(--member-bg); border: 1px solid var(--line); color: inherit; text-decoration: none; transform: var(--tilt); transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.3s var(--ease); }
a.member:hover { border-color: var(--c); box-shadow: 0 18px 40px -18px var(--c); }
.stage { position: relative; isolation: isolate; aspect-ratio: 1; }
.stage::before { content: ""; position: absolute; inset: 20% 12% 0; z-index: -1; border-radius: 50%; background: var(--c); opacity: 0; filter: blur(26px); transition: opacity 0.5s, scale 0.5s var(--ease); }
a.member:hover .stage::before { opacity: 0.45; scale: 1.1; }
.stage .yqn { position: absolute; inset-block-end: 2%; inset-inline: 0; margin-inline: auto; width: 88%; filter: drop-shadow(0 8px 10px var(--yqn-shadow)); transition: translate 0.5s var(--ease-bounce), rotate 0.5s var(--ease-bounce); }
[dir="rtl"] .stage .yqn { scale: -1 1; }
.js .member .stage .yqn { translate: 0 40%; opacity: 0; }
.js .member.is-in .stage .yqn { translate: 0 0; opacity: 1; transition: translate 0.8s calc(var(--i) * 90ms + 250ms) var(--ease-bounce), opacity 0.4s calc(var(--i) * 90ms + 250ms), rotate 0.5s var(--ease-bounce); }
a.member:hover .stage .yqn { rotate: -4deg; animation: hop 0.6s var(--ease); }
@keyframes hop { 40% { translate: 0 -8%; } }
.badge { position: absolute; z-index: 2; inset-block-end: 6px; inset-inline-end: 6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--badge-bg); color: var(--badge-ink); border: 2px solid var(--c); transition: rotate 0.6s var(--ease-bounce); }
.badge .icon { width: 16px; height: 16px; }
a.member:hover .badge { rotate: 360deg; }
.props { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.props > * { position: absolute; animation: float 3.6s ease-in-out infinite; animation-delay: calc(var(--k) * -1.2s); }
@keyframes float { 50% { translate: 0 -6px; rotate: 8deg; } }
.spark { width: 14px; height: 14px; color: var(--c); }
.spark svg, .chart svg { width: 100%; height: 100%; }
.spark { animation-name: twinkle !important; }
@keyframes twinkle { 50% { scale: 0.4; opacity: 0.4; rotate: 45deg; } }
.code { font: 700 11px/1 var(--font-mono); color: var(--c); padding: 3px 5px; border-radius: 6px; background: var(--badge-bg); }
.chart { width: 26px; height: 22px; color: var(--c); }
.chart rect { transform-box: fill-box; transform-origin: bottom; animation: grow 2.4s ease-in-out infinite alternate; animation-delay: calc(var(--b) * 0.3s); }
@keyframes grow { from { scale: 1 0.35; } }
.paint { width: 11px; height: 11px; border-radius: 50%; background: var(--p); box-shadow: 0 0 0 2px var(--badge-bg); }
.who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.15rem; line-height: 1.25; }
.who span { color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.in { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--in-bg); color: var(--in-ink); transition: background 0.25s, scale 0.25s var(--ease-bounce); }
.in .icon { width: 20px; height: 20px; }
a.member:hover .in { background: #0a66c2; color: #fff; scale: 1.08; }

@media (min-width: 640px) {
  .member { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; padding: 12px 14px 14px; }
  .stage { grid-column: 1 / -1; }
  .stage { aspect-ratio: 1.25; }
  .stage .yqn { width: 64%; }
  .badge { width: 40px; height: 40px; inset-block-end: 10px; inset-inline-end: 10px; }
  .badge .icon { width: 20px; height: 20px; }
  .spark { width: 20px; height: 20px; }
  .code { font-size: 13px; padding: 4px 7px; }
  .chart { width: 36px; height: 30px; }
  .paint { width: 15px; height: 15px; }
  .who strong { font-size: 1.25rem; }
  .in { width: 40px; height: 40px; }
}

/* Footer */
.foot { width: min(1120px, 100% - 32px); margin: 0 auto; padding-block: 4px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 0.92rem; }
.foot strong { color: var(--ink); font-weight: 600; }

@media (max-width: 520px) {
  .top { padding-block-start: 12px; }
  .brand span { display: none; }
  .switch { padding-inline: 12px; }
  .hero { padding: 22px 20px 0; }
  .hero { gap: 0; }
  .hero-yqn { min-height: 170px; padding-top: 30px; }
  .yqn-wrap { width: 132px; }
  .member { grid-template-columns: 84px minmax(0, 1fr) auto; padding-block: 6px; }
  .bubble { font-size: 0.85rem; padding: 6px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js .qr-dots circle, .js .qr-eyes path, .js .qr-head { opacity: 1 !important; scale: 1 !important; translate: none; }
  .js .member .stage .yqn { opacity: 1 !important; translate: none; }
  .qr-scan { display: none; }
  .hl-mark path { stroke-dashoffset: 0; }
}

/* Version picker (index.html) */
.pick { max-width: 720px; padding-block: 10vh; }
.pick-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pick-link { display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: var(--r-md); text-decoration: none; transition: translate 0.25s var(--ease), box-shadow 0.25s; }
.pick-link:hover { translate: 0 -3px; box-shadow: 0 16px 30px -18px rgb(0 0 0 / 0.5); }
.pick-link b { font-family: var(--font-display); font-size: 1.3rem; }
.pick-link[lang="en"] b { font-family: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif; }
.pick-link[lang="en"] { font-family: "Hanken Grotesk", system-ui, sans-serif; }
.pick-landing { background: #0c2238; color: #e6eef4; border-inline-start: 6px solid #19c4b8; }
.pick-deck { background: #a974ff; color: #22053a; border-inline-start: 6px solid #ffd400; }
.pick .card-head { grid-template-columns: 1fr; }

/* Easter egg: falling YQN heads (team.js) */
.hl { cursor: default; user-select: none; -webkit-user-select: none; }
.rain { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.rain img { position: absolute; top: -90px; height: auto; filter: drop-shadow(0 6px 8px rgb(0 0 0 / 0.25)); animation: fall var(--t) var(--d) cubic-bezier(0.35, 0.05, 0.6, 1) forwards; }
@keyframes fall { to { translate: var(--dx) calc(100vh + 120px); rotate: var(--r); } }
.bubble.is-raining { animation: pop 0.5s var(--ease-bounce) both, shake 0.5s 0.5s ease-in-out 3; }
@keyframes shake { 25% { rotate: -6deg; } 75% { rotate: 6deg; } }
@media (prefers-reduced-motion: reduce) {
  .rain img { animation: fade-drop 3s var(--d) ease-out forwards !important; top: auto; bottom: 10vh; opacity: 0; }
  @keyframes fade-drop { 20%, 70% { opacity: 1; } }
}
