:root {
  --bg: #FAF9F6;
  --bg-elev: #FFFFFF;
  --bg-tint: #F2EFE8;
  --ink: #0A0A0A;
  --ink-2: #1F1F1F;
  --ink-3: #4A4A4A;
  --ink-4: #8A857D;
  --ink-5: #B8B2A7;
  --line: #E8E4DB;
  --line-strong: #D4CFC4;
  --accent: #F97316;
  --accent-soft: #FFEDD5;
  --accent-ink: #9A3412;
  --indigo: #6366F1;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max-w: 1280px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--accent); font-weight: 500; }
strong { font-weight: 600; color: var(--ink); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 48px;
}

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.brand-title {
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 400;
}
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-links a {
  font-size: 15px;
  color: var(--ink-3);
  position: relative;
  transition: color 0.15s ease;
}
.nav-links a.active {
  color: var(--ink);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
}
.nav-links a:hover { color: var(--ink); }

/* ============ HERO ============ */
.hero {
  padding: 120px 0 72px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding-top: 24px;
}
.hero-title {
  font-size: clamp(52px, 8.5vw, 108px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin-bottom: 32px;
}
.hero-accent {
  color: var(--accent);
}
.hero-sub {
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--ink-3);
  max-width: 540px;
  line-height: 1.5;
}
.hero-right {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: 360px;
}
.orb {
  position: absolute;
  top: 50%;
  right: -5%;
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: conic-gradient(from 180deg,
    #F97316 0%,
    #FBBF24 25%,
    #F43F5E 50%,
    #8B5CF6 75%,
    #F97316 100%);
  filter: blur(70px);
  opacity: 0.14;
  animation: spin 40s linear infinite;
  z-index: 0;
  pointer-events: none;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ INLINE TERMINAL (pure text, no container) ============ */
.term-inline {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  font-family: var(--mono);
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
.term-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0;
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.term-meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.5);
  animation: pulse 2s ease-in-out infinite;
}
.term-meta-label {
  color: var(--ink-3);
}
.term-body {
  padding: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.75;
  min-height: 320px;
  max-height: 320px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  background: none;
}
/* Syntax colors tuned for cream background */
.t-prompt { color: #075985; font-weight: 600; }
.t-user   { color: #166534; font-weight: 500; }
.t-cmd    { color: #7E22CE; font-weight: 500; }
.t-out    { color: var(--ink-3); }
.t-ok     { color: #15803D; font-weight: 500; }
.t-warn   { color: #B45309; }
.t-err    { color: #B91C1C; }
.t-dim    { color: var(--ink-4); }
.t-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--ink);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: termCursor 1s step-end infinite;
}
@keyframes termCursor { 50% { opacity: 0; } }

@media (max-width: 960px) {
  .term-inline { max-width: 100%; padding: 22px 24px; }
  .term-body { font-size: 12.5px; min-height: 280px; max-height: 280px; }
}

/* ============ SCROLLING TICKER ============ */
.ticker {
  background: #0A0A0A;
  color: var(--bg);
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  position: relative;
  mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.ticker-track {
  display: inline-flex;
  gap: 28px;
  align-items: center;
  white-space: nowrap;
  animation: ticker 60s linear infinite;
  padding-left: 28px;
  will-change: transform;
}
.ticker:hover .ticker-track {
  animation-play-state: paused;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--bg);
  text-transform: none;
}
.ticker-dot {
  color: var(--accent);
  font-size: 10px;
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .viz-connections line,
  .packet,
  .viz-hub .hex-outer,
  .viz-hub .hex-inner,
  .pod,
  .viz-node circle,
  .orb,
  .ticker-track { animation: none !important; }
}

/* Hero meta row */
.hero-meta {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.meta-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meta-lbl {
  font-size: 12px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.meta-val {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}
.meta-available {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============ SECTIONS ============ */
.section {
  padding: 100px 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 48px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.section-lbl {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.lbl-strong {
  color: var(--ink);
  font-weight: 700;
}
.section-link {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  transition: opacity 0.15s ease;
}
.section-link:hover { opacity: 0.6; }
.section-link-faint {
  font-size: 13px;
  color: var(--ink-4);
}
.section-lbl-sm {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 24px;
  display: inline-block;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

/* ============ WORK ============ */
.work-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.work-item:last-child { border-bottom: none; }
.work-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-4);
  padding-top: 6px;
}
.work-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--ink);
}
.work-co {
  font-size: 17px;
  font-weight: 400;
  color: var(--ink-3);
}
.work-desc {
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 720px;
}
.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.work-tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
  background: var(--bg-tint);
  color: var(--ink-3);
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ============ METRICS ============ */
.section-metrics {
  background: var(--bg-tint);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
}
.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.metric-num {
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1;
}
.metric-label {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
  max-width: 240px;
}

/* ============ STACK ============ */
.stack-rows {
  border-top: 1px solid var(--line);
}
.stack-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.stack-cat {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.stack-items {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ============ PROJECTS ============ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.project-item {
  background: var(--bg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.project-item:hover {
  background: var(--bg-tint);
}
.project-item.project-soon {
  opacity: 0.6;
  cursor: default;
}
.project-item.project-soon:hover {
  background: var(--bg);
}
.project-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.project-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.arrow {
  font-weight: 400;
  color: var(--ink-4);
  transition: transform 0.2s ease, color 0.2s ease;
}
.project-item:not(.project-soon):hover .arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}
.project-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
  flex: 1;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  background: var(--bg-tint);
  color: var(--ink-3);
  border-radius: 4px;
}

/* ============ ABOUT ============ */
.section-about {
  background: var(--bg-tint);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 72px;
  align-items: start;
}
.about-headline {
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 32px;
}
.about-body {
  font-size: 17px;
  color: var(--ink-3);
  line-height: 1.65;
  margin-bottom: 20px;
  max-width: 560px;
}
.btn-primary {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 28px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.15s ease;
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.about-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about-avatar {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -24px rgba(0,0,0,0.15);
}
.about-caption {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-3);
}
.about-caption-dim {
  color: var(--ink-4);
}

/* ============ CONTACT ============ */
.contact-headline {
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 20px;
}
.contact-sub {
  font-size: 18px;
  color: var(--ink-3);
  margin-bottom: 48px;
  max-width: 540px;
}
.contact-list {
  border-top: 1px solid var(--line);
}
.contact-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.contact-row:hover {
  background: var(--bg-tint);
  padding-left: 16px;
  padding-right: 16px;
  margin-left: -16px;
  margin-right: -16px;
}
.contact-lbl {
  font-size: 13px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.contact-val {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.contact-arrow {
  font-size: 24px;
  color: var(--ink-4);
  transition: color 0.15s ease, transform 0.15s ease;
}
.contact-row:hover .contact-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ============ FOOTER ============ */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}
.footer-sig {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.footer-dim {
  font-size: 13px;
  color: var(--ink-4);
  margin-top: 4px;
}
.footer-year {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-4);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .container { padding: 0 24px; }
  .nav-inner { padding: 16px 24px; }
  .hero { padding: 72px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-right { min-height: 180px; }
  .orb { width: 180px; height: 180px; filter: blur(30px); }
  .hero-meta { grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 56px; }
  .section { padding: 64px 0; }
  .work-item { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .work-date { padding-top: 0; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .stack-row { grid-template-columns: 1fr; gap: 8px; }
  .project-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 13px; }
  .brand-title { display: none; }
  .contact-row { grid-template-columns: 90px 1fr auto; gap: 16px; }
  .contact-val { font-size: 15px; }
}

@media (max-width: 560px) {
  .hero-title { font-size: 48px; letter-spacing: -0.035em; }
  .project-item { padding: 24px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}
