/* ===========================================================
   Sparsh Verma — Portfolio Design System
   "Pipeline" visual language: Source -> Transform -> Process -> Output -> Sink
   =========================================================== */

:root {
  --ink:        #0A0F1C;
  --elevated:   #121B2D;
  --elevated-2: #172338;
  --line:       #24314c;
  --text:       #EDF1F7;
  --text-dim:   #93A1BD;
  --text-faint: #5C6B85;
  --amber:      #F2A93B;
  --amber-dim:  #c98f33;
  --teal:       #3FDFC9;
  --green:      #5FD08A;
  --rose:       #F2618C;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { scrollbar-color: var(--line) var(--ink); }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  background-color: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(63, 223, 201, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 223, 201, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
}

/* Scroll offset so fixed header doesn't cover section tops */
section[id], div[id] {
  scroll-margin-top: 96px;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.font-mono { font-family: var(--font-mono); }

a { -webkit-tap-highlight-color: transparent; color: inherit; text-decoration: none; }

::selection { background: var(--amber); color: var(--ink); }

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

/* ---------- Text & accents ---------- */
.text-accent { color: var(--teal); }
.text-amber { color: var(--amber); }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }

/* ---------- Eyebrow / stage label ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--teal);
  display: inline-block;
}

/* ---------- Cards ---------- */
.card {
  background-color: var(--elevated);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 12px 30px -16px rgba(0,0,0,0.6);
}
.card-hover {
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -18px rgba(63, 223, 201, 0.25);
}

/* ---------- Tags ---------- */
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  background-color: var(--elevated-2);
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: 0.7rem;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1;
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
}
.btn-primary:hover {
  background: #ffc561;
  box-shadow: 0 8px 24px -8px rgba(242, 169, 59, 0.55);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.btn-ghost {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--teal); }

/* ---------- Header / Nav ---------- */
.site-header {
  background-color: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-link {
  position: relative;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--teal); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}

.logo-cursor {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--amber);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Status pill ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--elevated);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(95,208,138,0.6);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(95,208,138,0.55); }
  70% { box-shadow: 0 0 0 6px rgba(95,208,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,208,138,0); }
}

/* ---------- Ops console (hero signature) ---------- */
.console {
  background: linear-gradient(180deg, var(--elevated), var(--elevated-2));
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.7);
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.console-dot { width: 10px; height: 10px; border-radius: 50%; }
.console-body {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  padding: 1.25rem 1.4rem;
  color: var(--text-dim);
}
.console-prompt { color: var(--teal); }
.console-ok { color: var(--green); }
.console-out { color: var(--text); }
.console-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.console-stat {
  padding: 0.9rem 0.5rem;
  text-align: center;
  border-right: 1px solid var(--line);
}
.console-stat:last-child { border-right: none; }
.console-stat .num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--amber);
  font-weight: 700;
}
.console-stat .lbl {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ---------- Browser frame for screenshots ---------- */
.browser-frame {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--elevated-2);
}
.browser-frame .chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
.browser-frame .url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  margin-left: 0.4rem;
  flex: 1;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-frame img { display: block; width: 100%; height: auto; }

/* ---------- SSBForge module mockup (browser-frame content, no real screenshot) ---------- */
.mockup-body {
  padding: 1.5rem;
  background: radial-gradient(circle at 30% 0%, rgba(242,169,59,0.07), transparent 60%), var(--ink);
}
.mockup-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}
.mockup-hero .kicker {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--rose);
  text-transform: uppercase;
}
.mockup-hero h6 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
.mockup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
@media (max-width: 480px) {
  .mockup-grid { grid-template-columns: repeat(2, 1fr); }
}
.mockup-tile {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.65rem 0.5rem;
  text-align: center;
}
.mockup-tile .ic { color: var(--rose); margin-bottom: 0.3rem; }
.mockup-tile .name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}
.mockup-tile .time {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
}
.mockup-footer {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
}
.mockup-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--amber);
  border: 1px solid var(--line);
  background: var(--elevated);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}

/* ---------- Architecture diagram wrapper ---------- */
.diagram-card {
  background: var(--elevated-2);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem;
  overflow-x: auto;
  min-width: 0;
}
.diagram-card svg { width: 100%; min-width: 640px; height: auto; display: block; }
.diag-label { font-family: var(--font-mono); }
.diagram-scroll-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 0.6rem;
}
@media (max-width: 700px) {
  .diagram-scroll-hint { display: block; }
}

/* ---------- Diagram node primitives (used inside inline SVGs) ---------- */
.dg-box { fill: var(--elevated); stroke: var(--line); stroke-width: 1.5; }
.dg-box-amber { stroke: var(--amber); }
.dg-box-teal { stroke: var(--teal); }
.dg-box-rose { stroke: var(--rose); }
.dg-title { fill: var(--text); font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; }
.dg-sub { fill: var(--text-dim); font-family: var(--font-mono); font-size: 10.5px; }
.dg-tag { fill: var(--text-faint); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.4px; }
.dg-arrow { stroke: var(--text-faint); stroke-width: 1.6; fill: none; }
.dg-arrow-accent { stroke: var(--teal); stroke-width: 1.6; fill: none; stroke-dasharray: 4 4; }
.dg-arrowhead { fill: var(--text-faint); }

/* ---------- Code block ---------- */
.code-block {
  background-color: var(--elevated-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  padding: 1.1rem 1.2rem;
  border-radius: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
}
.code-comment { color: var(--text-faint); }
.code-keyword { color: var(--rose); }
.code-string { color: var(--green); }
.code-function { color: #7CB8FF; }
.code-variable { color: var(--amber); }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Pipeline rail (signature scroll-spy element) ---------- */
.rail {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
}
@media (min-width: 1100px) {
  .rail { display: flex; }
}
.rail-track {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
  z-index: 0;
}
.rail-fill {
  position: absolute;
  top: 0; left: 50%;
  width: 2px;
  background: linear-gradient(180deg, var(--teal), var(--amber));
  transform: translateX(-50%);
  z-index: 1;
  transition: height 0.3s ease;
  height: 0%;
}
.rail-node {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.05rem 0;
  cursor: pointer;
}
.rail-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--elevated);
  border: 2px solid var(--text-faint);
  transition: all 0.25s ease;
}
.rail-node.is-active .rail-dot {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(242,169,59,0.18);
}
.rail-tag {
  position: absolute;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s ease;
  background: var(--elevated);
  border: 1px solid var(--line);
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
}
.rail-node:hover .rail-tag,
.rail-node.is-active .rail-tag {
  opacity: 1;
  transform: translateX(0);
  color: var(--amber-dim);
}
.rail-node.is-active .rail-tag { color: var(--amber); }

/* ---------- Mobile menu ---------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
#mobile-menu.is-open {
  max-height: 480px;
}

/* ---------- Misc ---------- */
.divider {
  border-top: 1px solid var(--line);
}
.quick-facts dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.quick-facts dd {
  color: var(--text);
  margin-bottom: 1rem;
}
