/* ============================================================
   lightinbit — stylesheet
   palette: deep space + cyan / violet glow
   ============================================================ */

:root {
  --bg:           #07070c;
  --bg-2:         #0d0d18;
  --ink:          #f4f4ff;
  --ink-dim:      #9898b8;
  --ink-low:      #5a5a78;
  --line:         rgba(255,255,255,0.08);
  --line-strong:  rgba(255,255,255,0.16);
  --cyan:         #00f0ff;
  --cyan-2:       #7df9ff;
  --mint:         #34e3a4;
  --accent:       #ffd479;

  --grad-light:   linear-gradient(135deg, #00f0ff 0%, #34e3a4 55%, var(--accent) 100%);
  --grad-soft:    linear-gradient(135deg, rgba(0,240,255,0.12), rgba(255,212,121,0.12));

  --max-w:        1280px;
  --pad-x:        clamp(20px, 4vw, 56px);

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}


a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ===== Loader ===== */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  transition: opacity .6s var(--ease-out), visibility .6s;
}
.loader.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
  width: 56px; height: 56px;
  border: 1px solid var(--line);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.3em;
  color: var(--ink-dim);
}
.loader-dots span { display: inline-block; animation: blink 1.4s infinite; }
.loader-dots span:nth-child(2) { animation-delay: .2s; }
.loader-dots span:nth-child(3) { animation-delay: .4s; }

/* ===== Reusable ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }

.gradient-text {
  background: var(--grad-light);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head { margin-bottom: clamp(48px, 6vw, 80px); }
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.3em;
  color: var(--cyan-2);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.section-num::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--cyan);
}
.section-title {
  font-size: clamp(38px, 6vw, 80px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad-x);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  background: rgba(7,7,12,0.55);
  border-bottom: 1px solid var(--line);
  transition: padding .3s var(--ease-out);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-logo svg { filter: drop-shadow(0 0 8px rgba(125,249,255,0.6)); }
.nav-links {
  display: flex; gap: 32px;
  font-size: 13px;
  /* Auto margins absorb the free space so the links stay optically
     centred now that the right side holds two items, not one. */
  margin: 0 auto;
}
.nav-links a {
  position: relative;
  color: var(--ink-dim);
  transition: color .2s;
}
.nav-links a::before {
  content: attr(data-num);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-low);
  margin-right: 6px;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-size: 13px;
  transition: background .2s, border-color .2s;
}
.nav-cta:hover { background: rgba(255,255,255,0.04); border-color: var(--cyan); color: var(--cyan-2); }

/* ===== Language switcher ===== */
.lang-switch { position: relative; margin-right: 12px; }
.lang-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  transition: background .2s, border-color .2s, color .2s;
}
.lang-btn:hover,
.lang-btn[aria-expanded="true"] { background: rgba(255,255,255,0.04); border-color: var(--cyan); color: var(--cyan-2); }
.lang-caret { font-size: 9px; transition: transform .2s var(--ease-out); }
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 148px;
  list-style: none;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(7,7,12,0.9);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  /* Kept in the box tree (not display:none) so the transition can run. */
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px);
  /* visibility flips instantly when opening and only lingers on close, so
     the menu is interactive the moment it is asked for — never gated on the
     transition clock — while the fade-out stays visible. */
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), visibility 0s linear .2s;
}
.lang-btn[aria-expanded="true"] + .lang-menu,
/* Fallback for keyboard users before main.js has loaded. */
.lang-switch:focus-within .lang-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), visibility 0s;
}
.lang-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink-dim);
  transition: background .2s, color .2s;
}
.lang-menu a:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.lang-menu a[aria-current] { color: var(--cyan-2); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  /* .nav-cta is hidden this narrow, so the switcher is the only way
     to change language — it must stay visible at every width. */
  .lang-switch { margin-right: 0; }
  .lang-btn { padding: 8px 10px; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--pad-x) 80px;
  overflow: hidden;
}
#hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 90%);
  z-index: 2;
  pointer-events: none;
}
.hero-noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.05;
  z-index: 3;
  pointer-events: none;
  /* mix-blend-mode: overlay was removed — it forces a per-frame
     compositor pass over the live WebGL canvas for very little
     visual return at 0.05 opacity. `normal` is significantly
     cheaper for the GPU. */
}

.hero-content {
  position: relative;
  z-index: 4;
  max-width: 1100px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  margin-bottom: 32px;
  background: rgba(255,255,255,0.02);
}
.tag-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
.hero-title {
  font-size: clamp(56px, 11vw, 168px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .line > span {
  display: inline-block;
  transform: translateY(110%);
  animation: revealUp 1s var(--ease-out) forwards;
}
.hero-title .line:nth-child(1) > span { animation-delay: 0.1s; }
.hero-title .line:nth-child(2) > span { animation-delay: 0.25s; }
.hero-title .line:nth-child(3) > span { animation-delay: 0.4s; }

.hero-title .accent em {
  font-style: italic;
  font-weight: 400;
  background: var(--grad-light);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 32px rgba(181,55,242,0.4));
}
.cursor-blink {
  display: inline-block;
  margin-left: 8px;
  color: var(--cyan);
  animation: blink 1s steps(2) infinite;
  font-weight: 300;
}

.hero-sub {
  max-width: 520px;
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink-dim);
  line-height: 1.65;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.7s forwards;
}

.hero-actions {
  display: flex; gap: 16px; flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.9s forwards;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform .3s var(--ease-out), background .3s, border-color .3s;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--cyan-2); border-color: var(--cyan-2); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--cyan-2); }
.btn-arrow { transition: transform .3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-large { padding: 18px 28px; font-size: 15px; }
.play-icon {
  display: inline-block;
  font-size: 9px;
  color: var(--cyan-2);
  border: 1px solid var(--cyan-2);
  border-radius: 50%;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  padding-left: 2px;
}

/* Hero meta */
.hero-meta {
  position: absolute;
  bottom: 80px;
  left: var(--pad-x);
  right: var(--pad-x);
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 560px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 1.1s forwards;
}
.meta-block {
  display: flex; flex-direction: column; gap: 6px;
}
.meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-low);
  text-transform: uppercase;
}
.meta-value {
  font-size: 13px;
  color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 1.6s ease-in-out infinite;
}

.scroll-hint {
  position: absolute;
  bottom: 80px;
  right: var(--pad-x);
  z-index: 4;
  display: flex; align-items: center; gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-low);
  text-transform: uppercase;
}
.scroll-line {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute; top: 0; left: -20px;
  width: 20px; height: 1px;
  background: var(--cyan);
  animation: scrollDot 2.4s var(--ease-in-out) infinite;
}

@media (max-width: 768px) {
  .hero-meta { position: static; margin-top: 60px; }
  .scroll-hint { display: none; }
}

/* ===== Marquee ===== */
.marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  background: var(--bg-2);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 40px;
  white-space: nowrap;
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
  animation: marquee 40s linear infinite;
  width: max-content;
}
.marquee-track .dot {
  color: var(--cyan-2);
  font-size: 0.7em;
}

/* ===== Vision / cards ===== */
.vision {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0;
}
.vision-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  perspective: 1200px;
}
.vision-card {
  position: relative;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.005));
  transition: transform .5s var(--ease-out), border-color .3s;
  transform-style: preserve-3d;
  overflow: hidden;
}
/* will-change is set only on hover so idle cards don't keep
   a permanent compositor layer promoted. */
.vision-card:hover { will-change: transform; }
.card-glow {
  position: absolute;
  top: -50%; left: -10%;
  width: 60%; height: 200%;
  background: radial-gradient(closest-side, rgba(0,240,255,0.18), transparent 70%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.vision-card:hover { border-color: rgba(125,249,255,0.4); }
.vision-card:hover .card-glow { opacity: 1; }
.card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-low);
  margin-bottom: 28px;
}
.vision-card h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.vision-card p {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 28px;
}
.card-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.card-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .vision-grid { grid-template-columns: 1fr; }
  .vision-card { padding: 28px; }
}

/* ===== Capabilities ===== */
.capabilities {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0;
  overflow: hidden;
}
#wave-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.7;
}
.capabilities .container { position: relative; z-index: 2; }

.cap-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
}
.cap-row {
  display: grid;
  grid-template-columns: 80px 1.4fr 2fr;
  gap: 24px;
  align-items: baseline;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left .4s var(--ease-out);
}
.cap-row::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 4px; height: 0;
  background: var(--cyan);
  transform: translateY(-50%);
  transition: height .4s var(--ease-out);
}
.cap-row:hover { padding-left: 14px; }
.cap-row:hover::before { height: 60%; }
.cap-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--cyan-2);
  letter-spacing: 0.2em;
}
.cap-name {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.cap-desc {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .cap-row { grid-template-columns: 40px 1fr; gap: 16px; }
  .cap-row .cap-desc { grid-column: 1 / -1; padding-left: 56px; }
}

/* ===== Work ===== */
.work {
  padding: clamp(80px, 12vw, 160px) 0;
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.work-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-2);
  transition: transform .5s var(--ease-out), border-color .3s;
}
.work-card:hover { transform: translateY(-4px); border-color: rgba(125,249,255,0.3); }
.work-preview {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}
.work-preview::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7,7,12,0.6));
}
.work-preview-1 {
  background:
    radial-gradient(circle at 30% 40%, rgba(255,212,121,0.55), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(255,212,121,0.45), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(0,240,255,0.5), transparent 50%),
    #0d0d18;
}
.work-preview-2 {
  background:
    radial-gradient(circle at 60% 30%, rgba(0,240,255,0.5), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(52,227,164,0.5), transparent 55%),
    #0d0d18;
}
.work-preview-3 {
  background:
    linear-gradient(135deg, rgba(125,249,255,0.4), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(52,227,164,0.6), transparent 55%),
    #0a0a14;
}
.work-preview-4 {
  background:
    radial-gradient(circle at 50% 50%, rgba(52,227,164,0.5), transparent 60%),
    radial-gradient(circle at 20% 30%, rgba(0,240,255,0.4), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,212,121,0.4), transparent 50%),
    #0d0d18;
  animation: previewShift 8s ease-in-out infinite alternate;
}
.work-info {
  padding: 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.work-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-low);
  text-transform: uppercase;
}
.work-name {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

@media (max-width: 768px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ===== Contact ===== */
.contact {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.contact-stars {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
}
.contact-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
}
.contact-title {
  font-size: clamp(48px, 9vw, 128px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 20px 0 32px;
}
.contact-sub {
  max-width: 520px;
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink-dim);
  line-height: 1.65;
  margin-bottom: 40px;
}
.contact-actions { margin-bottom: 80px; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-low);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.contact-value {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}
.contact-value a:hover { color: var(--cyan-2); }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  background: #050509;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
}
.footer-logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.footer-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-low);
  margin-top: 4px;
  text-transform: uppercase;
}
.footer-meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-low);
  letter-spacing: 0.1em;
}

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Keyframes ===== */
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes blink      { 50% { opacity: 0; } }
@keyframes pulse      { 50% { opacity: 0.4; transform: scale(0.85); } }
@keyframes revealUp   { to { transform: translateY(0); } }
@keyframes fadeUp     { to { opacity: 1; transform: translateY(0); } }
@keyframes marquee    { to { transform: translateX(-50%); } }
@keyframes scrollDot  {
  0%   { left: -20px; }
  60%  { left: 60px; }
  100% { left: 60px; }
}
@keyframes previewShift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(40deg); }
}

/* ===== Mobile small fixes ===== */
@media (max-width: 480px) {
  .hero { padding-top: 100px; }
  .hero-actions { width: 100%; }
  .btn { flex: 1; justify-content: center; }
  .nav-cta { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
  /* JS 3D scenes are skipped entirely in main.js when
     [data-rm="reduce"] is set on <html>. */
}
html[data-rm="reduce"] #hero-canvas,
html[data-rm="reduce"] #wave-canvas { display: none; }

/* ============================================================
   CJK adaptation — applies to /zh-hans/ and /zh-hant/ only.
   :lang(zh) prefix-matches both lang="zh-Hans" and lang="zh-Hant",
   so one selector covers the pair; the font stacks below are the
   only place the two scripts need to diverge.
   The English page just parses these rules and never matches them.
   ============================================================ */

/* No CJK webfont is loaded — that would cost megabytes. Han glyphs fall
   back to the OS font while the self-hosted Latin faces stay FIRST in the
   stack, so "lightinbit", "LLM", "RAG" and digits still render in
   Space Grotesk / JetBrains Mono. */
html:lang(zh) body {
  font-family: 'Space Grotesk', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}
html:lang(zh-Hant) body {
  font-family: 'Space Grotesk', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', system-ui, sans-serif;
}
html:lang(zh) .loader-text,
html:lang(zh) .section-num,
html:lang(zh) .hero-tag,
html:lang(zh) .meta-label,
html:lang(zh) .scroll-hint,
html:lang(zh) .card-num,
html:lang(zh) .card-tags span,
html:lang(zh) .cap-key,
html:lang(zh) .work-meta,
html:lang(zh) .contact-label,
html:lang(zh) .footer-tag,
html:lang(zh) .footer-meta,
html:lang(zh) .lang-btn {
  font-family: 'JetBrains Mono', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', monospace;
  /* 0.2em–0.3em tracking is right for Latin small caps and far too airy
     for Han glyphs, which already carry their own side bearings. */
  letter-spacing: 0.08em;
}
html:lang(zh-Hant) .loader-text,
html:lang(zh-Hant) .section-num,
html:lang(zh-Hant) .hero-tag,
html:lang(zh-Hant) .meta-label,
html:lang(zh-Hant) .scroll-hint,
html:lang(zh-Hant) .card-num,
html:lang(zh-Hant) .card-tags span,
html:lang(zh-Hant) .cap-key,
html:lang(zh-Hant) .work-meta,
html:lang(zh-Hant) .contact-label,
html:lang(zh-Hant) .footer-tag,
html:lang(zh-Hant) .footer-meta,
html:lang(zh-Hant) .lang-btn {
  font-family: 'JetBrains Mono', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', monospace;
}

/* Negative tracking is a Latin display-type trick; on Han glyphs it just
   collides the characters. */
html:lang(zh) .hero-title,
html:lang(zh) .section-title,
html:lang(zh) .contact-title,
html:lang(zh) .cap-name,
html:lang(zh) .work-name,
html:lang(zh) .vision-card h3,
html:lang(zh) .nav-logo,
html:lang(zh) .marquee-track { letter-spacing: 0; }

/* Han glyphs fill the em box top to bottom, so line-height: 0.95 gets them
   clipped by `.hero-title .line { overflow: hidden }` (the reveal mask).
   The smaller clamp also keeps the mixed CN/EN title inside the viewport. */
html:lang(zh) .hero-title {
  font-size: clamp(44px, 8vw, 120px);
  line-height: 1.15;
}
html:lang(zh) .section-title { line-height: 1.2; }
html:lang(zh) .contact-title { line-height: 1.1; }

/* Denser text needs more room between lines to stay readable. */
html:lang(zh) .hero-sub,
html:lang(zh) .contact-sub,
html:lang(zh) .vision-card p,
html:lang(zh) .cap-desc { line-height: 1.9; }
