/* Cedarline AI Lab */

:root {
  --bg: #05070d;
  --panel: rgba(12, 18, 34, 0.78);
  --border: rgba(56, 189, 248, 0.16);
  --border-hi: rgba(34, 211, 238, 0.55);
  --grid: rgba(56, 189, 248, 0.055);
  --text: #e6edf7;
  --muted: #93a4bd;
  --dim: #64748b;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --green: #4ade80;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --red: #f87171;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Glows + blueprint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60rem 32rem at 90% -10%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(48rem 32rem at -10% 35%, rgba(167, 139, 250, 0.10), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 44px 44px;
}
#net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0.6; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-soft); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(5, 7, 13, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; font-family: var(--mono); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.08em; color: var(--text); }
.brand:hover { color: var(--text); }
.brand b { color: var(--cyan); font-weight: 600; }
.brand-bot { width: 26px; height: 26px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; }
.brand-bot circle, .brand-bot .e { fill: var(--cyan); stroke: none; }
.nav nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav nav a:hover { color: var(--text); background: rgba(34, 211, 238, 0.08); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 40px; }
.kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--cyan); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: ping 2s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); font-weight: 700; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 20px; max-width: 34rem; font-size: 1.15rem; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--mono); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn::before { content: "▸"; opacity: 0.7; }
.btn-primary { background: var(--cyan); color: #021014; box-shadow: 0 0 24px rgba(34, 211, 238, 0.35); }
.btn-primary:hover { color: #021014; transform: translateY(-1px); box-shadow: 0 0 36px rgba(34, 211, 238, 0.55); }
.btn-ghost { border-color: var(--border-hi); color: var(--text); }
.btn-ghost:hover { color: var(--text); background: rgba(34, 211, 238, 0.08); }

.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 36px 0 0; }
.hud div { padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.hud dt { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; color: var(--cyan); white-space: nowrap; }
.hud dd { margin: 2px 0 0; font-size: 0.78rem; line-height: 1.3; color: var(--muted); }

/* Robot + terminal */
.rig { position: relative; padding-top: 170px; }
.bot { position: absolute; top: 0; right: 8%; z-index: 0; width: 180px; height: auto; overflow: visible; }
.bot-float { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.bot-shell { stroke: #38bdf8; stroke-width: 2; }
.bot-part { fill: #162033; stroke: #38bdf8; stroke-width: 2; }
.bot-face { fill: #020617; stroke: rgba(56, 189, 248, 0.4); stroke-width: 1.5; }
.bot-eyes { filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.9)); }
.bot-eyes rect { fill: var(--cyan); transform-box: fill-box; transform-origin: center; animation: eyeblink 5s infinite; }
@keyframes eyeblink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(0.12); } }
.bot-mouth { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; }
.bot-line { stroke: #38bdf8; stroke-width: 3; stroke-linecap: round; }
.bot-tip { fill: var(--cyan-soft); }
.bot-tip-glow { animation: tipglow 2s ease-in-out infinite; }
@keyframes tipglow { 50% { opacity: 0.25; } }
.bot-arm { fill: none; stroke: #38bdf8; stroke-width: 7; stroke-linecap: round; }
.bot-wave { transform-box: view-box; transform-origin: 136px 150px; animation: wave 3.2s ease-in-out infinite; }
@keyframes wave {
  0%, 55%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-16deg); }
  20% { transform: rotate(6deg); }
  40% { transform: rotate(4deg); }
}
.bot-chip rect { fill: #020617; stroke: var(--cyan); stroke-width: 1.5; }
.bot-chip line { stroke: var(--cyan); stroke-width: 1.5; stroke-linecap: round; }
.bot-chip text { font-family: var(--mono); font-size: 12px; font-weight: 600; fill: var(--cyan); }

.term {
  position: relative; z-index: 1; overflow: hidden;
  background: rgba(2, 6, 16, 0.92);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.05), 0 20px 60px -20px rgba(34, 211, 238, 0.35);
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: rgba(15, 23, 42, 0.85); border-bottom: 1px solid var(--border); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: #f87171; }
.term-bar i:nth-child(2) { background: #fbbf24; }
.term-bar i:nth-child(3) { background: #4ade80; }
.term-bar span { margin-left: 8px; font-family: var(--mono); font-size: 0.75rem; color: var(--dim); }
.term-body { min-height: 290px; padding: 16px 18px 18px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(56, 189, 248, 0.3) transparent; font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; white-space: pre; color: var(--text); }
.term-body .p { color: var(--green); }
.term-body .c { color: var(--text); }
.term-body .o { color: var(--muted); }
.term-body .k { color: var(--cyan); }
.term-body .hl { color: var(--cyan-soft); }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; background: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding-top: 88px; }
.sec-head { max-width: 44rem; margin-bottom: 32px; }
.idx { margin-bottom: 10px; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--cyan); }
.idx::before { content: ""; display: inline-block; width: 24px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--cyan); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 700; }
.sec-sub { margin-top: 12px; color: var(--muted); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  position: relative; overflow: hidden; padding: 22px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: 0; transition: opacity 0.2s; }
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: 0 12px 40px -18px rgba(34, 211, 238, 0.45); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-hi); background: rgba(34, 211, 238, 0.06); }
.ico svg { width: 20px; height: 20px; fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3, .slot h3 { font-size: 1.08rem; font-weight: 600; }
.desc { font-size: 0.95rem; color: var(--muted); }
.spec { display: grid; gap: 6px; margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); font-family: var(--mono); font-size: 0.76rem; }
.spec div { display: grid; grid-template-columns: 72px 1fr; gap: 10px; }
.spec dt { color: var(--dim); }
.spec dd { margin: 0; color: var(--text); }

/* Roadmap */
.phases { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.phases::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--violet)); opacity: 0.35; }
.phases li { position: relative; padding-top: 34px; }
.node { position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--dim); }
.phases li.past .node { border-color: var(--cyan); background: var(--cyan); }
.phases li.now .node { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18), 0 0 18px rgba(34, 211, 238, 0.6); animation: pulse 1.8s ease-in-out infinite; }
.phases li.now .node::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--cyan); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.06), 0 0 26px rgba(34, 211, 238, 0.8); } }
.now-tag { display: none; position: absolute; top: 0; left: 30px; padding: 1px 7px; border-radius: 5px; background: var(--cyan); color: #021014; font-family: var(--mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; }
.phases li.now .now-tag { display: inline-block; }
.when { margin-bottom: 4px; font-family: var(--mono); font-size: 0.74rem; color: var(--cyan); }
.phases h3 { margin-bottom: 6px; font-size: 1rem; font-weight: 600; }
.phases .desc { font-size: 0.86rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-hi); background: rgba(34, 211, 238, 0.06); color: var(--cyan-soft); font-family: var(--mono); font-size: 0.68rem; font-weight: 400; letter-spacing: 0.04em; white-space: nowrap; }
.chip-violet { border-color: rgba(167, 139, 250, 0.5); background: rgba(167, 139, 250, 0.08); color: #c4b5fd; }
.chip-dim { border-color: var(--border); background: transparent; color: var(--muted); }
.phase-status { margin-top: 28px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

/* Projects */
.proj-id { margin-bottom: 14px; font-family: var(--mono); font-size: 2rem; font-weight: 600; line-height: 1; background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.proj h3 { margin-bottom: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.tags li { padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(148, 163, 184, 0.16); background: rgba(148, 163, 184, 0.08); color: var(--muted); font-family: var(--mono); font-size: 0.7rem; }
.status { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.led { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.led-queued { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.led-off { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); animation: blink 1.6s steps(1) infinite; }

/* Lab log */
.log { margin: 0 0 0 6px; padding: 0; list-style: none; border-left: 2px solid var(--border); }
.log li { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 0 0 28px 28px; }
.log li:last-child { padding-bottom: 4px; }
.log li::before { content: ""; position: absolute; top: 6px; left: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
.log li.queued::before { border-color: var(--dim); border-style: dashed; }
.log time { padding-top: 2px; font-family: var(--mono); font-size: 0.8rem; color: var(--cyan); }
.log li.queued time { color: var(--dim); }
.log h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 600; }
.log p { max-width: 40rem; margin-top: 4px; font-size: 0.94rem; color: var(--muted); }

/* Playground */
.slot {
  padding: 22px;
  background: repeating-linear-gradient(135deg, rgba(34, 211, 238, 0.03) 0 10px, transparent 10px 20px), var(--panel);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius);
}
.slot-state { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.slot h3 { margin-bottom: 8px; }

/* Footer */
.foot { margin-top: 96px; background: rgba(5, 7, 13, 0.6); border-top: 1px solid var(--border); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 32px; font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.foot b { color: var(--cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .rig { max-width: 560px; }
  .phases { grid-template-columns: 1fr; gap: 22px; }
  .phases::before { top: 6px; bottom: 6px; left: 9px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--cyan), var(--violet)); }
  .phases li { padding-top: 0; padding-left: 40px; }
  .node { top: 2px; }
  .now-tag { position: static; margin-bottom: 6px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .nav nav { -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .rig { padding-top: 138px; }
  .bot { width: 150px; right: 4%; }
  .term-body { min-height: 0; padding: 14px; font-size: 0.72rem; }
  .section { padding-top: 64px; }
  .log li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
