/* =========================================================================
   Rishabh Bansal — portfolio
   System: SF Pro Display / SF Pro Text (Apple) → Inter (web fallback)
   Palette: white, cool grays, Apple blue
   ========================================================================= */

:root {
  color-scheme: light;

  /* —— color (Apple marketing palette) —— */
  --bg:           #ffffff;
  --bg-soft:      #fbfbfd;
  --bg-card:      #f5f5f7;
  --bg-card-2:    #ebebed;
  --hairline:     #d2d2d7;
  --hairline-soft:#e8e8ed;

  --ink:          #1d1d1f;
  --ink-2:        #424245;
  --muted:        #6e6e73;
  --quiet:        #86868b;

  --accent:       #0071e3;
  --accent-hover: #0077ed;
  --accent-deep:  #0058b8;
  --accent-soft:  rgba(0, 113, 227, 0.08);

  --success:      #34c759;
  --success-soft: rgba(52, 199, 89, 0.16);

  /* —— type —— */
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --body:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* —— layout —— */
  --container: min(1280px, calc(100% - 48px));

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 980px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt", "ss01";
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

button, input, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

img, svg { display: block; max-width: 100%; }

::selection {
  background: var(--accent);
  color: #ffffff;
}

/* —— global emphasis: drop italic, use weight + accent —— */
em, i {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

strong, b {
  font-weight: 600;
}

/* =========================================================================
   Typography utilities (Apple eyebrow / display / body sizes)
   ========================================================================= */

.eyebrow {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.label {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================================
   Skip link
   ========================================================================= */

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #ffffff;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  transition: top 200ms var(--ease);
}
.skip-link:focus { top: 16px; }

/* =========================================================================
   Shell
   ========================================================================= */

.shell {
  width: var(--container);
  margin: 0 auto;
  position: relative;
}

/* =========================================================================
   Top bar — frosted-glass Apple nav
   ========================================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0;
  margin: 0 calc((var(--container) - 100%) * -0.5);
  padding: 0 calc((100% - var(--container)) * 0.5);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline-soft);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55);
  animation: glow 2.6s ease-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(52, 199, 89, 0); }
}

.wordmark em {
  color: var(--muted);
  font-weight: 400;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}

.top-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 220ms var(--ease);
}

.top-nav a:hover,
.top-nav a:focus-visible {
  opacity: 1;
  outline: none;
}

/* =========================================================================
   Hero
   ========================================================================= */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: calc(100vh - 52px);
  padding: clamp(80px, 10vw, 140px) 0 clamp(80px, 10vw, 140px);
  text-align: left;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 40px);
  flex-wrap: wrap;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 11px;
  background: var(--success-soft);
  color: #1f7a3d;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.availability .pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.availability .pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--success);
  opacity: 0.6;
  animation: ripple 2.2s var(--ease-out) infinite;
}

@keyframes ripple {
  0%   { transform: scale(0.7); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

.greeting { display: none; }

/* —— the name —— */
.hero-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-size: clamp(72px, 12vw, 156px);
}

.hero-name .row { display: block; }

.hero-name .row.last {
  display: block;
}

.hero-name .terminal-mark,
.hero-name .ampersand { display: none; }

.hero-lede {
  max-width: 680px;
  margin: clamp(28px, 4vw, 44px) 0 0;
  font-family: var(--display);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 400;
  line-height: 1.21;
  letter-spacing: -0.012em;
  color: var(--ink-2);
}

.hero-lede em {
  font-weight: 600;
  color: var(--ink);
}

.hero-foot {
  margin-top: clamp(56px, 8vw, 88px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline-soft);
}

.hero-coordinates {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: clamp(28px, 5vw, 64px);
}

.hero-coordinates .item {
  display: grid;
  gap: 6px;
}

.hero-coordinates .label {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.hero-coordinates strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(14px, 1vw, 16px);
  letter-spacing: -0.012em;
  color: var(--ink);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--accent);
  transition: color 200ms var(--ease);
}

.scroll-cue:hover { color: var(--accent-hover); }

.scroll-cue .arrow {
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
  animation: cue 2.4s var(--ease) infinite;
}

.scroll-cue .arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
}

@keyframes cue {
  0%, 100% { transform: translateY(0);   opacity: 0.6; }
  50%      { transform: translateY(3px); opacity: 1; }
}

/* =========================================================================
   Section scaffolding
   ========================================================================= */

.section {
  position: relative;
  padding: clamp(96px, 12vw, 160px) 0;
  scroll-margin-top: 60px;
}

.section + .section {
  border-top: 1px solid var(--hairline-soft);
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: clamp(48px, 7vw, 88px);
  max-width: 980px;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-pill);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

.section-kicker {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.section-title em {
  font-weight: 700;
  color: var(--ink);
  font-style: normal;
}

.section-intro {
  margin: 16px 0 0;
  max-width: 64ch;
  font-family: var(--display);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.section-intro a {
  color: var(--accent);
  transition: color 200ms var(--ease);
}
.section-intro a:hover { color: var(--accent-hover); }

/* =========================================================================
   Now — current work card
   ========================================================================= */

.now-grid {
  display: grid;
  gap: 16px;
}

.now-list {
  display: grid;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 8px 28px;
}

.now-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--hairline-soft);
}

.now-row:first-child { border-top: 0; }

.now-row .when {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.now-row .what {
  font-family: var(--display);
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
}

.now-row .what em {
  font-weight: 600;
  color: var(--ink);
}

.now-row .what a {
  color: var(--accent);
  transition: color 200ms var(--ease);
}

.now-row .what a:hover { color: var(--accent-hover); }

/* =========================================================================
   Selected works
   ========================================================================= */

.works {
  display: grid;
  gap: clamp(64px, 9vw, 112px);
}

.work {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  padding-top: 32px;
  border-top: 1px solid var(--hairline-soft);
}

@media (min-width: 980px) {
  .work {
    grid-template-columns: 200px minmax(0, 1fr) 320px;
  }
}

.work-meta {
  display: grid;
  gap: 10px;
  align-content: start;
}

.work-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-feature-settings: "tnum";
}

.work-num .ord { display: none; }

.work-tier {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.work-when {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.work-body { min-width: 0; }

.work-kind {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.work-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.work-summary {
  margin: 0 0 20px;
  max-width: 60ch;
  font-family: var(--display);
  font-size: clamp(17px, 1.3vw, 19px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.work-summary em {
  font-weight: 600;
  color: var(--ink);
}

.work-why {
  margin: 0 0 24px;
  padding: 0 0 0 16px;
  max-width: 58ch;
  border-left: 2px solid var(--hairline);
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.5;
  letter-spacing: -0.008em;
  color: var(--ink-2);
}

.work-why em {
  font-weight: 600;
  color: var(--ink);
}

.work-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.work-stack span {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  background: var(--bg-card);
  border-radius: var(--r-pill);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

.work-stack span::after { content: ""; }

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* —— Apple-style buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 220ms var(--ease), transform 220ms var(--ease);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn.btn-rust {
  background: var(--accent);
  color: #ffffff;
}

.btn.btn-rust:hover {
  background: var(--accent-hover);
}

.btn .arr {
  width: 14px;
  height: 14px;
  position: relative;
  margin-left: 2px;
}

.btn .arr::before {
  content: "›";
  position: absolute;
  inset: 0;
  border: 0;
  font-family: var(--display);
  font-size: 18px;
  line-height: 14px;
  font-weight: 400;
  text-align: center;
  transform: none;
}

.btn:hover .arr {
  transform: translateX(2px);
  transition: transform 220ms var(--ease);
}

/* —— side aside (proof points) —— */
.work-aside {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 0;
  position: relative;
}

.work-aside::before { content: none; }

.aside-title {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.aside-list li {
  position: relative;
  padding-left: 18px;
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink-2);
}

.aside-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 10px;
  height: 1px;
  background: var(--quiet);
}

.aside-list li em {
  font-weight: 600;
  color: var(--ink);
}

.aside-outcome {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--display);
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* =========================================================================
   Index — compact list
   ========================================================================= */

.index-list {
  display: grid;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 4px 28px;
}

.index-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 2fr) minmax(0, 1.6fr) 110px 18px;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
  padding: 22px 0;
  border-top: 1px solid var(--hairline-soft);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 220ms var(--ease);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: var(--r-md);
}

.index-row:first-child { border-top: 0; }

.index-row:hover {
  background: var(--bg-card-2);
}

.index-row .num {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  color: var(--quiet);
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

.index-row .name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(17px, 1.4vw, 20px);
  letter-spacing: -0.018em;
  color: var(--ink);
  line-height: 1.2;
  transition: color 240ms var(--ease);
}

.index-row .kind {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.index-row .kind em {
  font-weight: 500;
  color: var(--ink-2);
}

.index-row .when {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0;
}

.index-row .arr {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--quiet);
  transition: transform 280ms var(--ease), color 220ms var(--ease);
}

.index-row .arr svg { width: 14px; height: 14px; }

.index-row:hover .arr {
  color: var(--accent);
  transform: translateX(4px);
}

.index-row:hover .name { color: var(--accent); }

@media (max-width: 720px) {
  .index-list { padding: 4px 16px; }
  .index-row {
    grid-template-columns: 26px minmax(0, 1fr) 18px;
    gap: 14px;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .index-row .kind, .index-row .when { display: none; }
}

/* =========================================================================
   Command center — live proof graph
   ========================================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.command-center {
  color: #f8fafc;
}

.command-center::before {
  content: "";
  position: absolute;
  top: 44px;
  bottom: 44px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background:
    radial-gradient(circle at 16% 8%, rgba(20, 184, 166, 0.18), transparent 30%),
    radial-gradient(circle at 84% 24%, rgba(245, 158, 11, 0.16), transparent 28%),
    linear-gradient(135deg, #0b1020 0%, #111827 46%, #151515 100%);
}

.command-center .section-num {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}

.command-center .section-kicker,
.command-center .section-intro,
.command-center .muted-label {
  color: rgba(226, 232, 240, 0.68);
}

.command-center .section-title,
.command-center .section-title em {
  color: #f8fafc;
}

.command-shell {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(8, 13, 24, 0.78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.command-toolbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.command-toolbar strong,
.command-panel h3 {
  display: block;
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.muted-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.command-stats span,
.query-presets button,
.segmented button,
.panel-head > button,
.terminal-form button,
.preview-actions :is(a, button, span),
.graph-readout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(248, 250, 252, 0.9);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.command-stats span {
  padding: 0 10px;
}

.command-stats b {
  margin-right: 4px;
  color: #5eead4;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.45fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.command-panel {
  min-width: 0;
  padding: clamp(18px, 2vw, 24px);
  background: rgba(8, 13, 24, 0.9);
}

.command-panel--graph,
.command-panel--case,
.command-panel--previews {
  background: rgba(10, 18, 32, 0.94);
}

.command-panel--graph,
.command-panel--previews {
  grid-column: span 1;
}

.command-panel--case,
.command-panel--previews {
  grid-column: 2;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head > button,
.query-presets button,
.segmented button,
.terminal-form button,
.graph-readout button {
  padding: 0 12px;
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

.panel-head > button:hover,
.query-presets button:hover,
.segmented button:hover,
.terminal-form button:hover,
.graph-readout button:hover,
.segmented .is-active {
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(94, 234, 212, 0.5);
  color: #ffffff;
}

.search-box,
.terminal-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.search-box input,
.terminal-form input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0 13px;
  outline: none;
}

.search-box input:focus,
.terminal-form input:focus {
  border-color: rgba(94, 234, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.search-box button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

.query-presets,
.ranked-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.guide-answer {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-answer p,
.graph-readout p,
.preview-body p,
.case-sections p,
.proof-list p {
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 14px;
  line-height: 1.46;
  letter-spacing: -0.006em;
}

.guide-answer p {
  margin-top: 7px;
}

.result-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  min-width: min(100%, 210px);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  text-align: left;
}

.result-pill span {
  grid-row: span 2;
  color: #5eead4;
  font-family: var(--mono);
  font-size: 12px;
}

.result-pill strong {
  font-size: 13px;
  line-height: 1.1;
}

.result-pill small {
  color: rgba(226, 232, 240, 0.62);
  font-size: 12px;
  line-height: 1.2;
}

.segmented {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.constellation-card {
  position: relative;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #050816;
  background-size: 42px 42px;
}

#constellation-canvas {
  display: block;
  width: 100%;
  height: 420px;
  touch-action: none;
}

.constellation-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.node-label {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 130px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-pill);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(248, 250, 252, 0.88);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

.node-label.is-active {
  background: #f8fafc;
  color: #0f172a;
}

.graph-readout {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.graph-readout strong {
  font-size: 20px;
}

.graph-readout button {
  width: max-content;
  margin-top: 4px;
}

.project-list,
.status-list,
.terminal-output {
  display: grid;
  gap: 8px;
}

.project-row,
.status-row {
  display: grid;
  align-items: center;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  color: #f8fafc;
}

.project-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.project-row:hover,
.project-row.is-selected {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(45, 212, 191, 0.12);
}

.project-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dot-a), var(--dot-b));
}

.project-row strong,
.status-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.project-row small,
.status-row small,
.project-row em,
.status-row em {
  display: block;
  color: rgba(226, 232, 240, 0.62);
  font-size: 12px;
  line-height: 1.3;
}

.project-row em {
  color: #fbbf24;
  font-style: normal;
  font-weight: 800;
}

.case-study {
  display: grid;
  gap: 14px;
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--case-a) 72%, transparent), color-mix(in srgb, var(--case-b) 48%, transparent)),
    #111827;
}

.case-hero span,
.case-meta,
.terminal-form label {
  color: rgba(248, 250, 252, 0.72);
  font-family: var(--mono);
  font-size: 12px;
}

.case-hero h3 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1;
}

.case-hero p {
  max-width: 64ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.case-hero strong {
  align-self: start;
  color: #ffffff;
  font-size: 44px;
  line-height: 1;
}

.case-meta,
.stack-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-meta span,
.stack-strip span {
  padding: 7px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
}

.case-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.case-sections section,
.proof-list p {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.case-sections h4,
.curation-grid h4,
.preview-body h3 {
  margin: 0 0 7px;
  color: #ffffff;
  font-family: var(--display);
  font-size: 14px;
}

.proof-list {
  display: grid;
  gap: 8px;
}

.terminal-output {
  min-height: 210px;
  max-height: 310px;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #050816;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-line {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: rgba(226, 232, 240, 0.82);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

.terminal-input {
  color: #5eead4;
}

.terminal-form {
  margin-top: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.status-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(84px, auto);
  gap: 10px;
  padding: 11px 12px;
}

.status-row > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-row.is-up > span { background: #34d399; }
.status-row.is-down > span { background: #fb7185; }

.status-row small {
  grid-column: 2;
}

.status-row em {
  grid-column: 3;
  grid-row: 1 / span 2;
  text-align: right;
  font-style: normal;
}

.status-row.loading {
  min-height: 54px;
}

.status-row.loading > span {
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.curation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.curation-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.curation-grid li {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.curation-grid strong,
.curation-grid span {
  display: block;
}

.curation-grid strong {
  color: #f8fafc;
  font-size: 13px;
}

.curation-grid span {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.66);
  font-size: 12px;
  line-height: 1.35;
}

.preview-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.preview-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.browser-chrome {
  display: grid;
  grid-template-columns: repeat(3, 8px) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.browser-chrome span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.browser-chrome strong {
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(226, 232, 240, 0.64);
  font-family: var(--mono);
  font-size: 11px;
}

.preview-card img {
  width: 100%;
  aspect-ratio: 1200 / 760;
  object-fit: cover;
}

.preview-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-actions :is(a, button, span) {
  padding: 0 11px;
}

@media (max-width: 1040px) {
  .command-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .command-panel--case,
  .command-panel--previews {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .command-center::before {
    top: 32px;
    bottom: 32px;
  }

  .command-toolbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-stats {
    justify-content: flex-start;
  }

  .constellation-card,
  #constellation-canvas {
    min-height: 320px;
    height: 320px;
  }

  .search-box,
  .terminal-form,
  .case-hero,
  .case-sections,
  .curation-grid,
  .preview-wall {
    grid-template-columns: minmax(0, 1fr);
  }

  .terminal-form label {
    min-height: auto;
  }

  .status-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .status-row em {
    grid-column: 2;
    grid-row: auto;
    text-align: left;
  }
}

/* =========================================================================
   About — text + side panel
   ========================================================================= */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 72px);
}

@media (min-width: 880px) {
  .about-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

.about-body {
  max-width: 64ch;
  font-family: var(--display);
  font-size: clamp(19px, 1.5vw, 22px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--ink-2);
}

.about-body p { margin: 0 0 1em; }
.about-body p:last-child { margin-bottom: 0; }

.about-body em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

.about-side {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 28px;
  background: var(--bg-card);
  border-radius: var(--r-lg);
}

.about-side .group {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline-soft);
}

.about-side .group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.about-side .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.about-side .group p,
.about-side .group ul {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.about-side .group ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

/* =========================================================================
   Contact
   ========================================================================= */

.contact {
  text-align: left;
}

.contact-line {
  margin: 0 0 clamp(40px, 6vw, 64px);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--ink);
  max-width: 14ch;
}

.contact-line em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 8px 28px;
}

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 28px;
  }
  .contact-grid .contact-row + .contact-row {
    border-left: 1px solid var(--hairline-soft);
    padding-left: clamp(24px, 3vw, 40px);
  }
}

.contact-row {
  display: grid;
  gap: 8px;
  padding: clamp(20px, 3vw, 28px) 0;
  border-bottom: 1px solid var(--hairline-soft);
}

@media (min-width: 720px) {
  .contact-row { border-bottom: 0; padding: 4px 0; }
}

.contact-row .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.contact-row a {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(18px, 1.6vw, 22px);
  letter-spacing: -0.018em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  transition: color 220ms var(--ease);
}

.contact-row a:hover {
  color: var(--accent-hover);
}

.contact-row .arrow-out {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.85em;
  font-weight: 400;
  font-style: normal;
  color: currentColor;
  transition: transform 280ms var(--ease);
}

.contact-row a:hover .arrow-out { transform: translate(3px, -3px); }

/* =========================================================================
   Footer
   ========================================================================= */

.foot {
  padding: 32px 0 48px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.foot .colophon {
  font-family: var(--body);
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.foot .colophon em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-2);
}

/* =========================================================================
   Reveal animations
   ========================================================================= */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 800ms var(--ease-out),
    transform 800ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.hero .availability         { animation: rise 700ms var(--ease-out) 100ms backwards; }
.hero .hero-name .row.first { animation: rise 800ms var(--ease-out) 200ms backwards; }
.hero .hero-name .row.last  { animation: rise 800ms var(--ease-out) 320ms backwards; }
.hero .hero-lede            { animation: rise 800ms var(--ease-out) 480ms backwards; }
.hero .hero-foot            { animation: rise 800ms var(--ease-out) 640ms backwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */

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

/* =========================================================================
   Small screens
   ========================================================================= */

@media (max-width: 720px) {
  :root { --container: min(1280px, calc(100% - 28px)); }

  body { font-size: 16px; }

  .topbar { height: 48px; }
  .wordmark { font-size: 14px; }
  .wordmark em { display: none; }

  .top-nav { gap: 18px; font-size: 12px; }
  .top-nav a:nth-child(n+4) { display: none; }

  .hero { min-height: auto; padding-top: 56px; padding-bottom: 80px; }

  .hero-foot { grid-template-columns: 1fr; gap: 24px; }

  .hero-coordinates {
    grid-template-columns: 1fr 1fr;
    row-gap: 18px;
    gap: 28px;
  }

  .work { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
  .work-num { font-size: 56px; }

  .now-list { padding: 4px 20px; }
  .now-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px 0;
  }

  .work-aside { padding: 22px; }

  .contact-line { font-size: clamp(48px, 13vw, 96px); }

  .about-side { padding: 22px; }
}
