/* ============================================================
   ATHIRADH KP — PORTFOLIO
   Design concept: engineering blueprint / schematic plate.
   The subject builds pipelines (scrape -> filter -> dedup ->
   rank -> notify) and the design borrows the visual language of
   a drafting table: grid paper, plate numbers, revision marks,
   and pipe-and-node diagrams.
   ============================================================ */

:root{
  --bg: #0b1826;
  --bg-panel: #10202f;
  --bg-panel-raised: #142a3d;
  --grid-line: rgba(129, 209, 197, 0.07);
  --grid-line-strong: rgba(129, 209, 197, 0.14);
  --border: #22364a;
  --border-bright: #33566f;
  --accent: #6fe3c4;
  --accent-dim: #3f8f7f;
  --accent-warm: #f2a65a;
  --accent-warm-dim: #a9713a;
  --text: #eaf2f5;
  --text-muted: #9fb3c4;
  --text-dim: #63788c;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 3px;
  --max: 1180px;
}

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

html{ scroll-behavior:smooth; }

body{
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0/48px 48px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0/48px 48px,
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.wrap{ max-width: var(--max); margin: 0 auto; padding: 0 32px; }

@media (max-width: 640px){ .wrap{ padding: 0 20px; } }

/* ---------- typography ---------- */

h1,h2,h3,h4{ font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--text); }

.eyebrow{
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow::before{
  content: '';
  width: 18px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

.plate-id{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

p.lede{ color: var(--text-muted); font-size: 1.08rem; max-width: 62ch; }

/* ---------- nav ---------- */

.topbar{
  position: fixed; top:0; left:0; right:0; z-index: 100;
  background: rgba(11,24,38,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap{
  display:flex; align-items:center; justify-content:space-between;
  height: 64px;
}
.brand{
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em;
  display:flex; align-items:center; gap:10px; color: var(--text);
}
.brand .dot{ width:7px; height:7px; border-radius:50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.navlinks{ display:flex; gap:32px; list-style:none; font-family: var(--mono); font-size: 13px; }
.navlinks a{ color: var(--text-muted); transition: color .2s; position:relative; }
.navlinks a:hover{ color: var(--accent); }
.navlinks .cta{
  border: 1px solid var(--border-bright);
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text);
}
.navlinks .cta:hover{ border-color: var(--accent); color: var(--accent); }
.navtoggle{ display:none; }

@media (max-width: 760px){
  .navlinks{ display:none; }
}

/* ---------- buttons ---------- */

.btn{
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 13px 22px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-bright);
  transition: all .2s ease;
  cursor: pointer;
  background: transparent;
}
.btn-primary{ background: var(--accent); color: #06141f; border-color: var(--accent); font-weight:600; }
.btn-primary:hover{ background: #85ecd0; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(111,227,196,0.25); }
.btn-ghost{ color: var(--text); }
.btn-ghost:hover{ border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-arrow{ transition: transform .2s; }
.btn:hover .btn-arrow{ transform: translateX(3px); }

/* ---------- section shell ---------- */

section{ padding: 120px 0; position: relative; }
section.tight{ padding: 90px 0; }
.section-head{ display:flex; justify-content:space-between; align-items:flex-end; gap: 40px; margin-bottom: 56px; flex-wrap:wrap; }
.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head .note{ font-family: var(--mono); font-size:12.5px; color: var(--text-dim); max-width: 34ch; text-align:right; }
@media (max-width:640px){ .section-head .note{ text-align:left; } }

hr.hair{ border:0; border-top: 1px solid var(--border); margin: 0; }

/* ---------- hero ---------- */

#hero{ padding-top: 190px; padding-bottom: 90px; }
.hero-grid{ display:grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items:center; }
@media (max-width: 900px){ .hero-grid{ grid-template-columns: 1fr; } }

.hero-name{ font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; margin: 10px 0 20px; }
.hero-name .accent{ color: var(--accent); }

.hero-tagline{ color: var(--text-muted); font-size: 1.15rem; max-width: 52ch; margin-bottom: 34px; }

.hero-actions{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom: 46px; }

.hero-meta{ display:flex; gap: 28px; flex-wrap:wrap; font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.hero-meta span{ color: var(--accent); }

/* schematic pipeline diagram */
.schematic{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 20px 22px;
  position: relative;
  overflow: hidden;
}
.schematic::before{
  content: 'FIG. 01 — DISCOVERY PIPELINE';
  position:absolute; top:12px; left:20px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing:0.1em;
  color: var(--text-dim);
}
.schem-nodes{ margin-top: 30px; display:flex; flex-direction:column; gap: 0; }
.schem-node{
  display:flex; align-items:center; gap: 14px;
  padding: 14px 4px;
  position: relative;
}
.schem-node .idx{
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  width: 22px; flex-shrink:0;
}
.schem-node .box{
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-panel-raised);
  flex: 1;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.schem-node .box small{ color: var(--text-dim); font-size: 10.5px; }
.schem-node:not(:last-child) .pipe{
  position:absolute; left: 33px; bottom:-1px;
  width:1px; height: 18px;
  background: repeating-linear-gradient(180deg, var(--accent) 0 4px, transparent 4px 8px);
  animation: flow 1.2s linear infinite;
}
@keyframes flow{ to{ background-position-y: -16px; } }
.schem-node.active .box{ border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(111,227,196,0.25); }
.schem-node.active .dotpulse{ background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dotpulse{ width:6px; height:6px; border-radius:50%; background: var(--text-dim); flex-shrink:0; margin-left:8px; }

/* ---------- work grid ---------- */

.work-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 980px){ .work-grid{ grid-template-columns: 1fr; } }

.plate{
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 5px;
  padding: 26px 24px 24px;
  display:flex; flex-direction:column;
  transition: border-color .25s, transform .25s;
  position: relative;
}
.plate:hover{ border-color: var(--border-bright); transform: translateY(-4px); }
.plate-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 18px; }
.plate h3{ font-size: 1.3rem; margin-top: 6px; }
.plate .status{
  font-family: var(--mono); font-size: 10px; letter-spacing:0.08em;
  color: var(--accent); border:1px solid var(--accent-dim); border-radius: 20px;
  padding: 3px 9px; white-space:nowrap;
}
.plate p{ color: var(--text-muted); font-size: 0.94rem; margin-bottom: 20px; flex:1; }
.tagrow{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom: 22px; }
.tag{ font-family: var(--mono); font-size: 10.5px; color: var(--text-muted); border:1px solid var(--border); padding: 4px 9px; border-radius: 3px; }
.plate-links{ display:flex; gap:14px; align-items:center; font-family: var(--mono); font-size:12.5px; }
.plate-links a{ color: var(--text); display:flex; align-items:center; gap:6px; }
.plate-links a:hover{ color: var(--accent); }
.plate-links a.secondary{ color: var(--text-dim); }

/* ---------- spec sheet (skills) ---------- */

.spec-table{ width:100%; border-collapse: collapse; }
.spec-table tr{ border-top: 1px solid var(--border); }
.spec-table tr:last-child{ border-bottom: 1px solid var(--border); }
.spec-table td{ padding: 18px 14px; vertical-align: top; }
.spec-table td:first-child{
  font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing:0.06em;
  width: 220px; white-space: nowrap; text-transform: uppercase;
}
.spec-table td:last-child{ color: var(--text-muted); font-size: 0.95rem; }
@media (max-width: 640px){
  .spec-table td:first-child{ white-space: normal; width: 40%; }
}

/* ---------- about ---------- */

.about-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 60px; }
@media (max-width: 900px){ .about-grid{ grid-template-columns: 1fr; gap: 40px; } }
.about-grid p{ color: var(--text-muted); margin-bottom: 18px; }
.about-grid p:first-child{ color: var(--text); font-size: 1.08rem; }

.credential{
  display:flex; justify-content:space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--border);
  font-size: 0.92rem;
}
.credential:last-child{ border-bottom: 1px solid var(--border); }
.credential .name{ color: var(--text); }
.credential .meta{ color: var(--text-dim); font-family: var(--mono); font-size: 11.5px; text-align: right; white-space:nowrap; }

/* ---------- research ---------- */

.research-card{
  border: 1px solid var(--border); border-radius: 5px; background: var(--bg-panel);
  padding: 30px 28px; display:grid; grid-template-columns: auto 1fr; gap: 28px; align-items:start;
}
@media (max-width:640px){ .research-card{ grid-template-columns:1fr; } }
.research-card .badge{
  font-family: var(--mono); font-size:11px; color:var(--accent-warm);
  border:1px solid var(--accent-warm-dim); border-radius:3px; padding:6px 10px; white-space:nowrap;
}

/* ---------- footer / contact ---------- */

footer{ border-top: 1px solid var(--border); padding: 60px 0 34px; }
.contact-row{ display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap: 30px; margin-bottom: 50px; }
.contact-links{ display:flex; flex-direction:column; gap:10px; font-family: var(--mono); font-size: 14px; }
.contact-links a{ color: var(--text-muted); }
.contact-links a:hover{ color: var(--accent); }
.foot-bottom{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; font-family: var(--mono); font-size:11px; color: var(--text-dim); }

/* ---------- case study pages ---------- */

.case-hero{ padding-top: 170px; padding-bottom: 60px; border-bottom: 1px solid var(--border); }
.case-hero h1{ font-size: clamp(2.1rem, 4.4vw, 3.2rem); margin: 14px 0 20px; max-width: 18ch; }
.case-meta-row{ display:flex; gap: 40px; flex-wrap:wrap; margin-top: 34px; font-family: var(--mono); font-size:12px; }
.case-meta-row div span{ display:block; color: var(--text-dim); margin-bottom: 6px; font-size:11px; letter-spacing:0.06em; text-transform:uppercase; }
.case-meta-row div strong{ color: var(--text); font-weight:500; font-size: 13px; }

.case-body{ padding: 70px 0; }
.case-layout{ display:grid; grid-template-columns: 200px 1fr; gap: 60px; }
@media (max-width: 860px){ .case-layout{ grid-template-columns: 1fr; } }

.case-toc{ position:sticky; top: 100px; align-self:start; font-family: var(--mono); font-size:12px; }
.case-toc a{ display:block; color: var(--text-dim); padding: 7px 0; border-left: 2px solid var(--border); padding-left: 14px; transition: all .2s; }
.case-toc a:hover, .case-toc a.active{ color: var(--accent); border-left-color: var(--accent); }
@media (max-width:860px){ .case-toc{ display:flex; flex-wrap:wrap; gap:10px; position:static; } .case-toc a{ border-left:none; border:1px solid var(--border); border-radius:20px; padding:6px 12px; } }

.case-copy h2{ font-size: 1.5rem; margin: 56px 0 18px; padding-top: 6px; }
.case-copy h2:first-child{ margin-top:0; }
.case-copy h3{ font-size: 1.1rem; margin: 30px 0 12px; color: var(--accent); }
.case-copy p{ color: var(--text-muted); margin-bottom: 16px; max-width: 74ch; }
.case-copy ul{ color: var(--text-muted); margin: 0 0 18px 20px; }
.case-copy li{ margin-bottom: 8px; }
.case-copy strong{ color: var(--text); font-weight: 600; }

/* field note / bug annotation block */
.fieldnote{
  border: 1px solid var(--accent-warm-dim);
  border-left: 3px solid var(--accent-warm);
  background: rgba(242,166,90,0.05);
  border-radius: 0 4px 4px 0;
  padding: 18px 20px;
  margin: 18px 0 28px;
}
.fieldnote .tag{ color: var(--accent-warm); border-color: var(--accent-warm-dim); margin-bottom: 10px; display:inline-block; }
.fieldnote p{ color: var(--text-muted); margin-bottom: 0; }
.fieldnote p + p{ margin-top: 10px; }

.callout{
  border: 1px solid var(--border); background: var(--bg-panel);
  border-radius: 4px; padding: 20px 22px; margin: 22px 0;
}
.callout p{ margin-bottom:0; }

.diagram-list{ background: var(--bg-panel); border:1px solid var(--border); border-radius:5px; padding: 22px 24px; margin: 20px 0 28px; }
.diagram-list div{ font-family: var(--mono); font-size: 12.5px; padding: 9px 0; border-top: 1px dashed var(--border); display:flex; gap:14px; }
.diagram-list div:first-child{ border-top:none; }
.diagram-list div .arrow{ color: var(--accent); }
.diagram-list div span.desc{ color: var(--text-dim); font-family: var(--body); }

.case-nav{ display:flex; justify-content:space-between; border-top:1px solid var(--border); margin-top:60px; padding-top: 30px; font-family: var(--mono); font-size:13px; }
.case-nav a{ color: var(--text-muted); }
.case-nav a:hover{ color: var(--accent); }

/* reveal on scroll */
.reveal{ opacity:0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity:1; transform:none; }

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
  .schem-node .pipe{ animation:none; }
  html{ scroll-behavior:auto; }
}
