/* Lumivo Lab homepage. Dark theme is locked on purpose (brand decision).
   Shape rule: 6px radius everywhere. One accent: amber. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0c0f;
  --bg-tint: #0e1115;
  --surface: #12161b;
  --line: rgb(233 237 241 / 0.1);
  --line-strong: rgb(233 237 241 / 0.2);
  --text: #e9edf1;
  --muted: #9aa4af;
  --accent: #f0b44a;
  --accent-ink: #17120a;
  --radius: 6px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* z-index scale: content 1, nav 10, skip link 20 */
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
canvas { display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 32px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Logo ---------- */
.logo-mark { flex: none; overflow: visible; }
.logo-mark__ring {
  fill: none;
  stroke: var(--text);
  stroke-width: 5.5;
}
.logo-mark__light { fill: var(--accent); }
.logo-mark--draw .logo-mark__ring { stroke-width: 4.5; }
.logo-mark--draw .logo-mark__light { fill: url(#lumi-light); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand__lab {
  margin-left: 0.28em;
  font-weight: 300;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #f6c467; }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: rgb(10 12 15 / 0.5); }
.btn--ghost:hover { border-color: var(--text); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--nav-h);
  background: rgb(10 12 15 / 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__links {
  display: flex;
  gap: 32px;
  font-size: 0.9375rem;
  color: var(--muted);
  white-space: nowrap;
}
.nav__links a { transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 72px;
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 24%, #000 62%);
  mask-image: linear-gradient(to right, transparent 24%, #000 62%);
}
.hero__inner { position: relative; z-index: 1; }
.hero__title {
  max-width: 13.5em;
  font-size: clamp(2.375rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero__sub {
  max-width: 34rem;
  margin-top: 28px;
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  color: var(--muted);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ---------- Sections ---------- */
.section { padding: 128px 0; }
.section--tint {
  background: var(--bg-tint);
  border-block: 1px solid var(--line);
}
.head { max-width: 46rem; margin-bottom: 64px; }
h2 {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.head p,
.services__head p,
.company__text > p,
.contact__inner > p {
  margin-top: 20px;
  max-width: 40rem;
  font-size: 1.125rem;
  color: var(--muted);
}
h3 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* ---------- Tools bento: 3 items, 3 cells ---------- */
.bento {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}
.cell:hover { border-color: var(--line-strong); }
.cell--image { grid-row: 1 / span 2; min-height: 560px; }
.cell__visual { flex: 1 1 auto; width: 100%; min-height: 150px; }
.cell__body { padding: 24px 28px 28px; border-top: 1px solid var(--line); }
.cell__body p { margin-top: 8px; color: var(--muted); max-width: 32rem; }

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 80px;
  align-items: start;
}
.services__head { position: sticky; top: calc(var(--nav-h) + 48px); }
.services__list li {
  padding: 32px 0;
  border-top: 1px solid var(--line-strong);
}
.services__list li:first-child { padding-top: 0; border-top: 0; }
.services__list li:last-child { padding-bottom: 0; }
.services__list h3 { font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -0.025em; }
.services__list p { margin-top: 10px; color: var(--muted); max-width: 34rem; }

/* ---------- Why AI ----------
   Default (no JS, or phone): four panels stacked, each complete on its own.
   Desktop with JS: topic list on the left, one panel at a time on the right. */
.flow__tabs { display: none; }
.flow__panels { display: grid; gap: 16px; }
.flow__panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.flow__visual { width: 100%; height: 220px; border-bottom: 1px solid var(--line); }
.flow__body { padding: 28px; }
.flow__panel-title { margin-bottom: 12px; font-size: 1.625rem; letter-spacing: -0.02em; }
.flow__text { max-width: 36rem; font-size: 1.125rem; color: var(--text); }
.flow__label { margin-top: 28px; font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
.flow__gets { display: grid; gap: 10px; margin-top: 12px; }
.flow__gets li { position: relative; padding-left: 22px; color: var(--muted); }
.flow__gets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 2px;
  background: var(--accent);
}

@media (min-width: 768px) {
  .js .flow {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 56px;
    align-items: start;
  }
  .js .flow__tabs { display: grid; }
  .js .flow__tab {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 22px 0 22px 28px;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 0.3s;
  }
  .js .flow__tab::before,
  .js .flow__tab::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--line-strong);
  }
  .js .flow__tab::after { background: var(--accent); transform: scaleY(0); transform-origin: center top; }
  .js .flow__tab.is-active::after { transform: scaleY(1); }
  .js .flow__tab:hover,
  .js .flow__tab.is-active { color: var(--text); }
  .js .flow__tab-title { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
  .js .flow__tab-hint { font-size: 1rem; color: var(--muted); }
  .js .flow__panel { display: none; }
  .js .flow__panel.is-active { display: flex; }
  .js .flow__panel-title { display: none; }
  .js .flow__visual { height: 300px; }
  .js .flow__body { padding: 36px 40px 40px; }
}

/* ---------- Company ---------- */
.company {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 80px;
  align-items: center;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 40px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line-strong);
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.facts dd { margin-top: 6px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.company__mark { display: flex; justify-content: center; }
.company__mark .logo-mark { width: min(100%, 320px); height: auto; }

/* ---------- Contact ---------- */
.contact { padding: 144px 0; }
.contact__inner h2 { font-size: clamp(2.375rem, 4.5vw, 4rem); }
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  margin-top: 40px;
}
.contact__mail {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.contact__mail:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Legal pages ---------- */
.legal { padding: calc(var(--nav-h) + 72px) 0 120px; }
.legal__inner { max-width: 820px; }
.legal h1 {
  font-size: clamp(2.375rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.legal__date { margin-top: 16px; font-family: var(--mono); font-size: 0.875rem; color: var(--muted); }
.legal h2 { margin-top: 48px; font-size: 1.5rem; letter-spacing: -0.015em; line-height: 1.25; }
.legal p { margin-top: 14px; max-width: 65ch; color: #c3cad2; }
.legal__date + p { margin-top: 40px; font-size: 1.1875rem; color: var(--text); }
.legal__address { margin-top: 16px; font-style: normal; line-height: 1.9; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 72px 0 40px; }
.footer .brand { font-size: 1.125rem; }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 2fr)) minmax(0, 3fr);
  gap: 48px;
}
.footer__brand p { margin-top: 18px; max-width: 22rem; color: var(--muted); }
.footer__col { display: grid; gap: 12px; align-content: start; justify-items: start; font-size: 0.9375rem; color: var(--muted); }
.footer__col h2 {
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--text);
}
.footer__col a { transition: color 0.2s; }
.footer__col a:hover { color: var(--text); }
.footer__col a[href^="mailto:"] { color: var(--text); border-bottom: 1px solid var(--line-strong); }
.footer__col a[href^="mailto:"]:hover { color: var(--accent); border-color: var(--accent); }
.footer__col address { font-style: normal; line-height: 1.7; }
.footer__legal { font-size: 0.875rem; color: var(--muted); }
.footer__grid + .footer__legal { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.footer--slim { padding: 32px 0; }
.footer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px; }

/* ---------- Motion (only when the visitor allows it and JS is running) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .bento .cell:nth-child(2) { transition-delay: 0.08s; }
  .js .bento .cell:nth-child(3) { transition-delay: 0.16s; }

  .js .hero__title,
  .js .hero__sub,
  .js .hero__cta { animation: rise 0.9s var(--ease) both; }
  .js .hero__sub { animation-delay: 0.1s; }
  .js .hero__cta { animation-delay: 0.2s; }

  /* Why AI: the active topic's bar fills while its panel is on screen, then the next topic opens */
  .js .flow.is-auto .flow__tab.is-active::after { animation: fill-down 7s linear both; }
  .js .flow.is-paused .flow__tab.is-active::after { animation-play-state: paused; }
  .js .flow__panel.is-active .flow__body { animation: rise 0.6s var(--ease) both; }

  /* Logo: the ring draws itself once, then the light appears inside it */
  .js .logo-mark--draw .logo-mark__ring {
    stroke-dasharray: 1.03;
    stroke-dashoffset: 1.03;
    transition: stroke-dashoffset 1.4s var(--ease);
  }
  .js .logo-mark--draw .logo-mark__light {
    opacity: 0;
    transform: scale(0.5);
    transform-origin: 25.5px 38.5px;
    transition: opacity 0.7s 0.7s, transform 0.9s var(--ease) 0.7s;
  }
  .js .is-in .logo-mark--draw .logo-mark__ring { stroke-dashoffset: 0; }
  .js .is-in .logo-mark--draw .logo-mark__light { opacity: 1; transform: none; }
}
@keyframes fill-down {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .services, .company { grid-template-columns: 1fr; gap: 56px; }
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
  .services__head { position: static; }
  .company__mark { justify-content: flex-start; }
  .company__mark .logo-mark { width: 180px; }
}
@media (max-width: 767px) {
  .wrap { padding-inline: 20px; }
  .nav__links { display: none; }
  .section { padding: 80px 0; }
  .contact { padding: 96px 0; }
  .head { margin-bottom: 40px; }
  .hero { align-items: flex-start; padding-top: calc(var(--nav-h) + 56px); }
  .hero__canvas {
    top: auto;
    bottom: 0;
    height: 55%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 60%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 60%);
  }
  .bento { grid-template-columns: 1fr; grid-template-rows: none; }
  .cell--image { grid-row: auto; min-height: 380px; }
  .cell { min-height: 300px; }
  .facts { gap: 24px; }
  .footer { padding-top: 56px; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
  .footer__brand, .footer__grid > .footer__col:last-child { grid-column: 1 / -1; }
  .footer__grid + .footer__legal { margin-top: 48px; }
  .legal { padding: calc(var(--nav-h) + 40px) 0 80px; }
}
@media (max-width: 420px) {
  .nav__inner { gap: 12px; }
  .facts { grid-template-columns: 1fr; }
}
