/* =====================================================================
   PORTFOLIO · TERMINAL AESTHETIC
   Design tokens mirror the chandra-extraction-pipeline-design.html doc.
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0A1510;
  --bg2:       #0E1C14;
  --bg3:       #122019;
  --surface:   #162820;
  --border:    #1E3828;
  --border2:   #2A4A38;
  --text:      #C8D9CC;
  --text-hi:   #E8F5EC;
  --muted:     #4A6B55;
  --dim:       #2E4A38;
  --volt:      #C8FF57;
  --volt2:     #A8E040;
  --volt-dim:  #4A6020;
  --red:       #FF5B5B;
  --yellow:    #FFD060;
  --cyan:      #7DD3A8;
  --blue:      #7AAFCF;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.06) 2px,
    rgba(0,0,0,.06) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Noise grain */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 99;
  opacity: .6;
}

/* ---------------------------------------------------------------------
   NAV
   --------------------------------------------------------------------- */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 0 48px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 21, 16, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .15em;
  color: var(--volt);
  text-decoration: none;
}
.nav-logo .bracket { color: var(--muted); font-weight: 300; }

/* Nav brand group: logo + resume link */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-resume {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .15em;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  display: inline-flex;
  align-items: baseline;
}
.nav-resume:hover { color: var(--volt); }
.nav-resume .bracket { color: var(--dim); font-weight: 300; transition: color .2s; }
.nav-resume:hover .bracket { color: var(--muted); }
.nav-resume .arrow {
  color: var(--volt-dim);
  font-weight: 400;
  margin-left: 3px;
  transition: color .2s;
}
.nav-resume:hover .arrow { color: var(--volt); }

@media (max-width: 420px) {
  .nav-logo, .nav-resume { font-size: 11px; letter-spacing: .1em; }
  .nav-brand { gap: 10px; }
}

.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--volt); }
.nav-links a.active::before {
  content: '> ';
  color: var(--volt);
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  width: 36px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: border-color .2s;
}
.nav-toggle:hover { border-color: var(--volt-dim); }
.nav-toggle:focus-visible {
  outline: 1px solid var(--volt);
  outline-offset: 2px;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--volt);
  border-radius: 1px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ---------------------------------------------------------------------
   STATUS BAR
   --------------------------------------------------------------------- */
.status-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  height: 26px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 48px;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .06em;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--volt);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }
.status-item { display: flex; align-items: center; gap: 8px; }
.status-val { color: var(--volt); }
.status-spacer { flex: 1; }

/* ---------------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------------- */
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 96px 48px 80px;
  position: relative;
  z-index: 2;
}

section {
  scroll-margin-top: 72px;
}

/* ---------------------------------------------------------------------
   HERO
   --------------------------------------------------------------------- */
.hero-header {
  margin-bottom: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--volt);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: '';
  display: block; width: 28px; height: 1px;
  background: var(--volt);
}

h1 {
  font-family: var(--font-mono);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--text-hi);
  margin-bottom: 20px;
}
h1 .accent { color: var(--volt); }

.subtitle {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 28px;
}
.subtitle strong { color: var(--text); font-weight: 400; }

.hero-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 4px;
  text-decoration: none;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: var(--volt);
  color: var(--bg);
  border: 1px solid var(--volt);
}
.btn-primary:hover { background: var(--volt2); border-color: var(--volt2); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--volt); color: var(--volt); }

/* ---------------------------------------------------------------------
   HEADINGS
   --------------------------------------------------------------------- */
h2 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-hi);
  margin-top: 72px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.01em;
}
h2 .num {
  color: var(--volt-dim);
  font-weight: 300;
  margin-right: 8px;
}

h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--cyan);
  margin-top: 32px;
  margin-bottom: 14px;
  letter-spacing: -.01em;
}

h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-hi);
  margin-bottom: 6px;
}

/* ---------------------------------------------------------------------
   TEXT
   --------------------------------------------------------------------- */
p {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 12px;
}
p a {
  color: var(--volt);
  text-decoration: none;
  border-bottom: 1px dashed var(--volt-dim);
}
p a:hover { border-bottom-style: solid; }

strong { color: var(--text-hi); font-weight: 500; }

ul, ol {
  margin: 8px 0 16px 20px;
  font-size: 14px;
  font-weight: 300;
}
li { margin-bottom: 6px; line-height: 1.65; }

/* ---------------------------------------------------------------------
   CODE
   --------------------------------------------------------------------- */
code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg3);
  color: var(--volt);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
pre {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

/* ---------------------------------------------------------------------
   TAGS
   --------------------------------------------------------------------- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
}
.tag-new       { background: rgba(200,255,87,.1); color: var(--volt);   border: 1px solid var(--volt-dim); }
.tag-unchanged { background: rgba(74,107,85,.15); color: var(--muted);  border: 1px solid var(--border); }
.tag-modified  { background: rgba(255,208,96,.1); color: var(--yellow); border: 1px solid rgba(255,208,96,.2); }

/* ---------------------------------------------------------------------
   SKILL LIST (tag cloud)
   --------------------------------------------------------------------- */
.skill-list {
  list-style: none;
  margin-left: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.skill-list li { margin: 0; }

/* ---------------------------------------------------------------------
   PROJECT GRID
   --------------------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}
/* First card spans full row at multi-col widths so 3 cards fill the grid. */
.project-grid > .project-card:first-child {
  grid-column: 1 / -1;
}
.project-card {
  background: var(--bg);
  padding: 24px 28px;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background .2s;
}
.project-card:hover { background: var(--bg2); }

.project-card-header {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
}
.project-index { color: var(--volt); font-weight: 600; }
.project-year  { color: var(--muted); }

.project-card h3 {
  margin-top: 0;
  color: var(--text-hi);
  font-size: 15px;
  margin-bottom: 8px;
}
.project-card p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}

/* ---------------------------------------------------------------------
   POST LIST (blog)
   --------------------------------------------------------------------- */
.post-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}
.post-item {
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.post-item:last-child { border-bottom: none; }
.post-item a {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 14px 0;
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
}
.post-item a:hover { color: var(--volt); }
.post-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  flex-shrink: 0;
  min-width: 88px;
}
.post-title {
  font-size: 14px;
  font-weight: 400;
}

/* ---------------------------------------------------------------------
   CONTACT
   --------------------------------------------------------------------- */
.contact-list {
  list-style: none;
  margin: 20px 0 0 0;
  padding: 0;
}
.contact-list li {
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
}
.contact-list li:last-child { border-bottom: none; }
.contact-key {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  min-width: 80px;
}
.contact-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--border2);
  transition: color .2s, border-color .2s;
}
.contact-list a:hover { color: var(--volt); border-bottom-color: var(--volt); }

/* ---------------------------------------------------------------------
   CALLOUTS
   --------------------------------------------------------------------- */
.callout {
  border-left: 3px solid;
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 6px 6px 0;
  background: var(--bg2);
}
.callout-info     { border-color: var(--cyan); }
.callout-warn     { border-color: var(--yellow); }
.callout-decision { border-color: var(--volt); }
.callout-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  font-weight: 500;
  margin-bottom: 8px;
}
.callout-info     .callout-title { color: var(--cyan); }
.callout-warn     .callout-title { color: var(--yellow); }
.callout-decision .callout-title { color: var(--volt); }
.callout p { margin-bottom: 6px; font-size: 13px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   ARTICLE (blog post / project page)
   --------------------------------------------------------------------- */
.article-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 20px;
}
.article-meta span { color: var(--text); }
.back-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .1em;
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 32px;
  transition: color .2s;
}
.back-link:hover { color: var(--volt); }
.back-link::before { content: '←'; }

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
/* ---------------------------------------------------------------------
   HERO SPLIT (services landing)
   --------------------------------------------------------------------- */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero-split .hero-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.hero-meta-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 20px 22px;
  font-family: var(--font-mono);
  position: sticky;
  top: 80px;
}
.hero-meta-card .meta-block {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.hero-meta-card .meta-block:first-child { padding-top: 0; }
.hero-meta-card .meta-block:last-child { border-bottom: none; padding-bottom: 0; }
.hero-meta-card .meta-label {
  color: var(--muted);
  letter-spacing: .12em;
  font-size: 9px;
  font-weight: 500;
  margin-bottom: 6px;
}
.hero-meta-card .meta-value {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}
.hero-meta-card .meta-value .volt { color: var(--volt); }
.status-dot-inline {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--volt);
  animation: pulse 2s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: 2px;
}

/* ---------------------------------------------------------------------
   SERVICES GRID
   --------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 24px 0;
}
.service-card {
  background: var(--bg);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .2s;
}
.service-card:hover { background: var(--bg2); }
.service-card .service-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--volt);
  font-weight: 600;
}
.service-card h3 {
  margin: 0;
  color: var(--text-hi);
  font-size: 15px;
  font-family: var(--font-mono);
}
.service-card > p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px 0;
  line-height: 1.65;
  font-weight: 300;
}
.service-caps {
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
}
.service-caps li {
  padding: 6px 0;
  border-top: 1px dashed var(--border);
  margin: 0;
  line-height: 1.4;
}
.service-caps li::before {
  content: '› ';
  color: var(--volt-dim);
  margin-right: 4px;
}

/* ---------------------------------------------------------------------
   PROCESS STEPS
   --------------------------------------------------------------------- */
.process-steps {
  counter-reset: step;
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.process-steps li {
  counter-increment: step;
  background: var(--bg);
  padding: 22px 22px;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  color: var(--text);
  font-weight: 300;
  transition: background .2s;
}
.process-steps li:hover { background: var(--bg2); }
.process-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--volt);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}
.process-steps li strong {
  display: block;
  margin-bottom: 4px;
}

/* ---------------------------------------------------------------------
   NEXT STEPS
   --------------------------------------------------------------------- */
.next-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.next-step-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  transition: all .2s;
}
.next-step-link:hover {
  color: var(--volt);
  border-color: var(--volt-dim);
  background: var(--bg3);
}
.next-step-arrow {
  color: var(--volt);
  font-weight: 600;
  font-size: 14px;
}

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; gap: 24px; }
  .hero-meta-card { position: static; }
}
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-links { gap: 16px; font-size: 10px; }
  .content { padding: 80px 20px 60px; }
  .status-bar { padding: 0 20px; gap: 16px; font-size: 9px; }
  .status-bar .hide-mobile { display: none; }
  h2 { margin-top: 56px; }
  .post-item a { flex-direction: column; gap: 4px; }
  .post-date { min-width: auto; }
  .contact-list li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .services-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; }
  .next-steps { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
}

/* Hamburger nav: narrow viewports only */
@media (max-width: 500px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 150;
    background: rgba(10, 21, 16, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 4px 0;
    font-size: 12px;
    transform: translateY(-120%);
    transition: transform .25s ease-out;
    pointer-events: none;
  }
  .nav-links.open {
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }
}
