:root {
  --bg: #0b0f1a;
  --bg-2: #111727;
  --card: rgba(255, 255, 255, 0.04);
  --card-b: rgba(255, 255, 255, 0.09);
  --text: #e8ecf5;
  --muted: #8f9ab3;
  --a1: #38e1c6;
  --a2: #6c7bff;
  --radius: 18px;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Accent palette follows the visitor's local daypart */
body[data-daypart='dawn']  { --a1: #ff9a8b; --a2: #ffcc70; }
body[data-daypart='day']   { --a1: #38e1c6; --a2: #6c7bff; }
body[data-daypart='dusk']  { --a1: #ffb347; --a2: #c06cff; }
body[data-daypart='night'] { --a1: #8ab4ff; --a2: #b388ff; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; }
.mono { font-family: var(--mono); }
em { font-style: normal; color: var(--a1); }

.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; width: 70vw; height: 70vw; top: -30vw; right: -20vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--a2) 35%, transparent), transparent 65%);
  filter: blur(40px); opacity: .55; pointer-events: none;
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px clamp(16px, 5vw, 64px);
  backdrop-filter: blur(14px);
  background: rgba(11, 15, 26, .7);
  border-bottom: 1px solid var(--card-b);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.25rem; color: var(--a1); }
.brand span { color: var(--text); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: .95rem; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--muted); }
.nav-links a:not(.btn):hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 1rem var(--sans); text-decoration: none; color: #0b0f1a;
  background: linear-gradient(120deg, var(--a1), var(--a2));
  box-shadow: 0 8px 30px -10px var(--a1);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px -8px var(--a1); }
.btn-small { padding: 8px 16px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--card-b); box-shadow: none; }
.btn-ghost:hover { border-color: var(--a1); box-shadow: none; }

/* HERO */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  min-height: min(calc(100vh - 64px), 860px);
  padding: 40px clamp(16px, 5vw, 64px) 60px;
  max-width: 1320px; margin: 0 auto;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 0 0 18px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 0 0 var(--a1); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
h1 { margin: 0; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.greet, #greet-place {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  background: linear-gradient(120deg, var(--a1), var(--a2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.headline { display: block; margin-top: 14px; font-size: clamp(1.6rem, 3.2vw, 2.5rem); font-weight: 600; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 60ch; margin: 22px 0; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: .9rem;
  background: var(--card); border: 1px solid var(--card-b);
  animation: rise .5s both;
}
.chip b { font-family: var(--mono); font-weight: 500; }
.skeleton { width: 120px; background: linear-gradient(90deg, var(--card), rgba(255,255,255,.09), var(--card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-globe { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
#globe { width: 100%; height: 100%; display: block; cursor: grab; }
#globe:active { cursor: grabbing; }
.globe-caption {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  font-size: .8rem; color: var(--muted); white-space: nowrap;
  background: rgba(11,15,26,.75); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--card-b);
}

/* SECTIONS */
.section { max-width: 1200px; margin: 0 auto; padding: 100px clamp(16px, 5vw, 64px); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.kicker { color: var(--a1); font-size: .85rem; margin: 0 0 8px; letter-spacing: .05em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 14px; }
.section-head p:not(.kicker) { color: var(--muted); font-size: 1.05rem; margin: 0; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

/* SIGNALS */
.signal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.signal {
  padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--card-b);
  position: relative; overflow: hidden;
  animation: rise .5s both;
}
.signal::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, var(--a1), var(--a2)); transform-origin: left; animation: grow 1s .3s both;
}
@keyframes grow { from { transform: scaleX(0); } }
.signal .k { font-family: var(--mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.signal .v { font-size: 1.25rem; font-weight: 600; margin-top: 6px; word-break: break-word; }
.signal .s { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.tensor {
  margin-top: 18px; padding: 16px 20px; border-radius: 14px;
  background: #070a12; border: 1px solid var(--card-b);
  font-size: .85rem; overflow-x: auto; white-space: nowrap; color: var(--a1);
}
.tensor-label { color: var(--muted); margin-right: 8px; }
.privacy { color: var(--muted); font-size: .9rem; margin-top: 14px; }

/* RECOMMENDATIONS */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.rec {
  padding: 24px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--card-b);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .25s, border-color .25s;
}
.rec:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--a1) 60%, transparent); }
.rec-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rec-rank { font-family: var(--mono); color: var(--muted); font-size: .8rem; }
.rec h3 { margin: 0; font-size: 1.25rem; }
.rec .icon { font-size: 1.8rem; }
.rec p { margin: 0; color: var(--muted); }
.score { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.score-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--a1), var(--a2)); border-radius: 99px; transition: width 1s; }
.why { display: flex; flex-wrap: wrap; gap: 6px; }
.why span { font-family: var(--mono); font-size: .72rem; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--text); }
.stack { font-family: var(--mono); font-size: .75rem; color: var(--a1); }

/* LAB */
.lab {
  display: grid; grid-template-columns: 320px 1fr; gap: 28px;
  padding: 28px; border-radius: 24px; background: var(--card); border: 1px solid var(--card-b);
}
.lab-controls { display: flex; flex-direction: column; gap: 22px; }
.lab-controls label { display: flex; flex-direction: column; gap: 8px; font-size: .95rem; }
.lab-controls label span { display: flex; justify-content: space-between; }
.lab-controls b { color: var(--a1); font-weight: 500; }
input[type='range'] { accent-color: var(--a1); width: 100%; }
.lab-taste > span { font-size: .95rem; display: block; margin-bottom: 10px; }
.taste-bars { display: grid; gap: 6px; margin-bottom: 14px; }
.taste-row { display: grid; grid-template-columns: 80px 1fr 36px; gap: 8px; align-items: center; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.taste-row .bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.taste-row .bar i { display: block; height: 100%; background: var(--a2); transition: width .4s; }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.item {
  position: relative; padding: 16px 14px 14px; border-radius: 14px; cursor: pointer; user-select: none;
  background: rgba(255,255,255,.03); border: 1px solid var(--card-b);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .2s, background .2s, opacity .4s;
}
.item:hover { border-color: var(--a1); }
.item.liked { background: color-mix(in srgb, var(--a1) 14%, transparent); border-color: var(--a1); }
.item .emoji { font-size: 1.9rem; }
.item .name { font-weight: 600; margin-top: 6px; font-size: .95rem; }
.item .meta { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }
.item .pos { position: absolute; top: 8px; right: 10px; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.item.top3 .pos { color: var(--a1); }
.item.dim { opacity: .45; }
.lab-note { font-size: .8rem; color: var(--muted); margin: 16px 0 0; }

/* PLATFORM */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; position: relative; }
.stage { padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--card-b); position: relative; }
.stage:not(:last-child)::after {
  content: '→'; position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  color: var(--a1); font-weight: 700; z-index: 1;
}
.stage-n { color: var(--a1); font-size: .8rem; }
.stage h3 { margin: 8px 0 6px; }
.stage p { margin: 0; font-size: .9rem; color: var(--muted); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.pillars article {
  padding: 26px; border-radius: var(--radius);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a2) 14%, transparent), transparent);
  border: 1px solid var(--card-b);
}
.pillars h3 { margin: 0 0 8px; font-size: 1.4rem; color: var(--a1); }
.pillars p { margin: 0; color: var(--muted); }
.edge {
  margin-top: 18px; padding: 20px 24px; border-radius: var(--radius);
  border: 1px dashed var(--card-b); color: var(--muted); font-size: .95rem;
}
.edge b { color: var(--text); }
.edge:empty { display: none; }

/* CONTACT */
.contact-card {
  padding: clamp(28px, 5vw, 56px); border-radius: 28px;
  background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--a1) 22%, transparent), transparent 55%),
              radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--a2) 22%, transparent), transparent 55%),
              var(--bg-2);
  border: 1px solid var(--card-b);
}
.contact-card > p:not(.kicker) { color: var(--muted); font-size: 1.05rem; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; max-width: 720px; }
.contact-form textarea, .contact-form button { grid-column: 1 / -1; }
.contact-form button { justify-self: start; }
.contact-form input, .contact-form textarea {
  font: 1rem var(--sans); color: var(--text);
  background: rgba(0,0,0,.3); border: 1px solid var(--card-b); border-radius: 12px; padding: 14px 16px; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--a1); }
.mail { margin-top: 18px; color: var(--muted); font-size: .9rem; }
.mail a { color: var(--a1); }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 28px clamp(16px, 5vw, 64px); border-top: 1px solid var(--card-b);
  color: var(--muted); font-size: .8rem;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 24px; }
  .hero-globe { max-width: 420px; order: -1; }
  .lab { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .stage::after { display: none; }
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  .section { padding: 70px 16px; }
  .hero { padding: 16px 16px 40px; }
  .rec-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: 1fr; }
  .lab { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* keep grid children from growing past the viewport (canvas has a large intrinsic width) */
.hero > *, .lab > *, .section { min-width: 0; }
#globe { max-width: 100%; }
