/* =========================================================
   LinkUp — System Definition / Header Screen
   Theme: Deep · Glass · Layered
   ========================================================= */

:root {
  --bg-deep:        #07080d;
  --bg-deep-2:      #0b0d14;
  --surface:        #11131c;
  --surface-2:      #161927;
  --line:           rgba(255, 255, 255, 0.08);
  --line-strong:    rgba(255, 255, 255, 0.16);

  --ink:            #eaecf3;
  --ink-soft:       #b3b8c8;
  --ink-mute:       #6d7388;
  --ink-faint:      #3e4256;

  --accent:         #7cf0c4;   /* mint signal */
  --accent-2:       #6aa6ff;   /* electric indigo */
  --accent-warm:    #ffb86b;
  --accent-glow:    rgba(124, 240, 196, 0.45);

  --radius-sm: 6px;
  --radius:    14px;
  --radius-lg: 22px;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* -------- Reset -------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
  overflow-x: hidden;
  min-height: 100vh;
  max-height: 150vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a, button { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }

/* =========================================================
   AMBIENT BACKGROUND
   ========================================================= */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 40%, transparent 100%);
}
.bg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.bg-orb {
  position: fixed; z-index: 0; pointer-events: none;
  width: 620px; height: 620px; border-radius: 50%;
  filter: blur(120px); opacity: .55;
  will-change: transform;
}
.bg-orb-1 { top: -180px; left: -160px;
  background: radial-gradient(circle, rgba(124,240,196,.35), transparent 60%); }
.bg-orb-2 { bottom: -220px; right: -180px;
  background: radial-gradient(circle, rgba(106,166,255,.35), transparent 60%); }
.bg-orb-3 { top: 40%; left: 45%;
  background: radial-gradient(circle, rgba(255,184,107,.18), transparent 60%); }

.cursor-glow {
  position: fixed; z-index: 1; pointer-events: none;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,240,196,.16), transparent 65%);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .4s ease;
  mix-blend-mode: screen;
}
.scanline {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .04;
  background: repeating-linear-gradient(to bottom,
    transparent 0 3px, rgba(255,255,255,.6) 3px 4px);
}

/* =========================================================
   LAYOUT — uses CSS grid, total page ≤ 150vh
   ========================================================= */
body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  z-index: 1;
}

/* -------- Top bar -------- */
.top-bar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid; grid-template-columns: repeat(2, 6px); gap: 3px;
  padding: 6px; border: 1px solid var(--line-strong); border-radius: 6px;
}
.mark-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 1px; }
.mark-dot:nth-child(2) { background: var(--accent-2); }
.mark-dot:nth-child(3) { background: var(--ink-faint); }
.mark-dot:nth-child(4) { background: var(--accent-warm); }
.brand-text { font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-soft); }
.brand-sep { color: var(--ink-faint); margin: 0 6px; }

.top-meta { display: flex; gap: clamp(14px, 2vw, 28px); }
.top-cell {
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
}
.top-cell .k { color: var(--ink-faint); }
.top-cell .v { color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }

.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(124,240,196,.6); }
  70%  { box-shadow: 0 0 0 10px rgba(124,240,196,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,240,196,0); }
}

/* =========================================================
   HERO  (split: title left, index right)
   ========================================================= */
.hero {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(36px, 6vh, 72px) clamp(20px, 4vw, 56px);
  align-items: center;
  min-height: 0;
}

/* ---- left ---- */
.hero-left { display: flex; flex-direction: column; gap: 28px; max-width: 720px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 14px; border: 1px solid var(--line-strong);
  border-radius: 999px; width: max-content;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  color: var(--ink-soft);
  background: rgba(255,255,255,.02);
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
}
.eyebrow-id { color: var(--ink-faint); padding-left: 10px; border-left: 1px solid var(--line); }

.title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.2vw, 104px);
  line-height: .94;
  letter-spacing: -0.035em;
  font-weight: 500;
}
.title-row { display: block; }
.title-row-accent {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 50%, #fff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  position: relative;
}
.title-word {
  display: inline-block;
  opacity: 0; transform: translateY(40%);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  padding-right: .12em;
}
.title.is-visible .title-word { opacity: 1; transform: translateY(0); }
.title.is-visible .title-row:nth-child(1) .title-word:nth-child(1) { transition-delay: .05s; }
.title.is-visible .title-row:nth-child(1) .title-word:nth-child(2) { transition-delay: .15s; }
.title.is-visible .title-row:nth-child(2) .title-word:nth-child(1) { transition-delay: .30s; }
.title.is-visible .title-row:nth-child(2) .title-word:nth-child(2) { transition-delay: .42s; }

.title-cursor {
  display: inline-block; width: .08em; height: .85em;
  background: var(--accent); margin-left: .12em;
  vertical-align: -.05em; animation: blink 1.05s steps(2) infinite;
  box-shadow: 0 0 12px var(--accent-glow);
}
@keyframes blink { 50% { opacity: 0; } }

.lede {
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
}
.lede em { color: var(--accent); font-style: normal; font-weight: 500; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent); color: #061812;
  box-shadow: 0 10px 40px -10px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary .btn-arrow { transition: transform .25s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-ghost {
  border-color: var(--line-strong); color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-key { color: var(--ink-faint); font-size: 10px; padding-right: 6px; border-right: 1px solid var(--line); }

.footnote {
  display: flex; gap: 12px; align-items: flex-start;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--ink-mute); padding-top: 8px; max-width: 560px;
  border-top: 1px dashed var(--line); padding-top: 18px;
}
.footnote strong { color: var(--ink); font-weight: 500; }
.fn-mark { color: var(--accent); }

/* ---- right ---- */
.hero-right {
  display: flex; flex-direction: column; gap: 18px;
  padding: 26px; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.005));
  backdrop-filter: blur(14px);
  position: relative; overflow: hidden;
}
.hero-right::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 100% 0%, rgba(124,240,196,.08), transparent 60%);
  pointer-events: none;
}

.index-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.card-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  color: var(--ink-faint); text-transform: uppercase;
}
.index-counter {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-soft); display: flex; gap: 6px;
}
.idx-sep, .idx-total { color: var(--ink-faint); }
#idx-current { color: var(--accent); }

.section-index { display: flex; flex-direction: column; gap: 2px; }
.idx-item {
  display: grid;
  grid-template-columns: 36px 1fr 48px;
  align-items: center; gap: 14px;
  padding: 12px 8px; border-radius: var(--radius-sm);
  cursor: pointer; position: relative;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.idx-item::before {
  content: ""; position: absolute; left: -26px; top: 50%;
  width: 16px; height: 1px; background: var(--line);
  transform: translateY(-50%); transition: background .25s, width .25s var(--ease);
}
.idx-item:hover { background: rgba(255,255,255,.025); transform: translateX(4px); }
.idx-item:hover::before { background: var(--accent); width: 22px; }
.idx-item.is-active { background: rgba(124,240,196,.05); }
.idx-item.is-active::before { background: var(--accent); width: 26px; }

.idx-n {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: .1em;
}
.idx-item.is-active .idx-n, .idx-item:hover .idx-n { color: var(--accent); }
.idx-t { font-size: 14px; color: var(--ink-soft); }
.idx-item.is-active .idx-t, .idx-item:hover .idx-t { color: var(--ink); }
.idx-bar {
  height: 2px; background: var(--line); border-radius: 1px; overflow: hidden;
}
.idx-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s var(--ease);
}
.idx-item:hover .idx-fill, .idx-item.is-active .idx-fill { width: 100%; }

/* preview pane */
.preview-pane {
  margin-top: 8px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  min-height: 150px;
}
.preview-pane::after {
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.preview-head { display: flex; justify-content: space-between; align-items: center; }
.preview-n {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  color: var(--accent);
}
.preview-tags {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  color: var(--ink-faint); text-transform: uppercase;
}
.preview-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: 22px; letter-spacing: -.01em; color: var(--ink);
}
.preview-desc { font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.preview-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; border-top: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase;
}
.preview-arrow { color: var(--accent); transition: transform .25s var(--ease); }
.preview-pane:hover .preview-arrow { transform: translateX(4px); }

/* fade-in animation on swap */
.preview-pane.is-swapping .preview-title,
.preview-pane.is-swapping .preview-desc,
.preview-pane.is-swapping .preview-n,
.preview-pane.is-swapping .preview-tags { opacity: 0; transform: translateY(6px); }
.preview-title, .preview-desc, .preview-n, .preview-tags {
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

/* =========================================================
   FOOTER (scroll hint)
   ========================================================= */
.hero-foot {
  position: relative; z-index: 3;
  padding: 0 clamp(20px, 4vw, 56px) 22px;
}
.foot-rule {
  height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin-bottom: 16px;
}
.foot-row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
}
.foot-cell { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); }
.foot-cell .k { color: var(--ink-faint); }
.foot-cell .v { color: var(--ink-soft); }
.foot-scroll { cursor: pointer; transition: color .25s; }
.foot-scroll:hover { color: var(--accent); }
.foot-scroll:hover .v { color: var(--accent); }
.scroll-line {
  width: 48px; height: 1px; background: var(--line); position: relative; overflow: hidden;
}
.scroll-line-fill {
  position: absolute; inset: 0; background: var(--accent);
  transform: translateX(-100%); animation: scrollFill 2.6s var(--ease) infinite;
}
@keyframes scrollFill {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}
.scroll-arrow { animation: bobY 2.2s ease-in-out infinite; color: var(--accent); }
@keyframes bobY { 0%,100%{transform:translateY(0)} 50%{transform:translateY(3px)} }

/* =========================================================
   REVEAL
   ========================================================= */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal]:nth-child(2) { transition-delay: .08s; }
[data-reveal]:nth-child(3) { transition-delay: .16s; }
[data-reveal]:nth-child(4) { transition-delay: .22s; }
[data-reveal]:nth-child(5) { transition-delay: .28s; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  body { max-height: none; }
  .hero { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 28px; }
  .top-meta .top-cell:first-child { display: none; }
  .hero-right { order: 2; }
}
@media (max-width: 560px) {
  .title { font-size: clamp(40px, 12vw, 64px); }
  .top-bar { padding: 16px 18px; }
  .top-meta { gap: 12px; }
  .top-cell { font-size: 9px; }
  .foot-row { flex-direction: column; gap: 10px; align-items: flex-start; }
  .cta-row .btn { flex: 1; justify-content: center; }
}
