/* ═══════════════════════════════════════════════════════════
   SHOHAN'S LAB — terminal/signal design system
   concept: the whole page reads like a session on your own box
   palette:  #0a0e17 ink · #0f1626 panel · #dbe6ff text
             #2dd4bf signal teal · #f5b455 amber · #a78bfa data purple
   type:     Sora (display/body) · IBM Plex Mono (labels/data/nav)
             Unbounded (hero name only)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f6f9fe;
  --border: #d8e0ee;
  --text: #14202f;
  --muted: #5a6b85;
  --teal: #0d9488;
  --amber: #b45309;
  --purple: #7c3aed;
  --danger: #dc3d5c;
  --radius: 14px;
  --font: 'Sora', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  --display: 'Unbounded', var(--font);
  /* legacy aliases (admin panel) */
  --accent: var(--teal);
  --accent-2: var(--purple);
  --red: var(--danger);
  --bg-soft: var(--panel-2);
}
[data-theme="dark"] {
  --bg: #0a0e17;
  --panel: #0f1626;
  --panel-2: #121b2e;
  --border: #1e2a42;
  --text: #dbe6ff;
  --muted: #8b9cc0;
  --teal: #2dd4bf;
  --amber: #f5b455;
  --purple: #a78bfa;
  --danger: #ff6b81;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
::selection { background: rgba(45,212,191,.25); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--amber); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

/* ── cursor ── */
.cursor {
  position: fixed; width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal); pointer-events: none; z-index: 9999;
  mix-blend-mode: difference; transform: translate(-50%,-50%);
  transition: width .15s, height .15s, opacity .2s; opacity: 0;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 40px; height: 40px; }
@media (hover: none) { .cursor { display: none; } }

/* ── signal rail (scroll progress) ── */
.signal-rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 3px;
  z-index: 150; pointer-events: none;
}
.signal-fill {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--teal), var(--purple));
  transform-origin: top; transform: scaleY(0);
  transition: transform .08s linear;
}
.signal-tag {
  position: absolute; bottom: 20px; left: 9px;
  writing-mode: vertical-rl; font-family: var(--mono);
  font-size: 9px; letter-spacing: .25em; color: var(--muted);
}

/* ── nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 0; transition: background .3s, padding .3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.nav-logo .logo-mark { color: var(--teal); }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
  position: relative; letter-spacing: .02em;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--teal); border-radius: 2px;
}
.nav-actions { display: flex; gap: 10px; align-items: center; }
.theme-toggle, .hamburger {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1rem;
  transition: border-color .2s, transform .15s; font-family: var(--font);
}
.theme-toggle:hover, .hamburger:hover { border-color: var(--teal); transform: translateY(-1px); }
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; padding: 0 10px; }
.hamburger span { display: block; height: 2px; width: 20px; background: var(--text); transition: .3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 760px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -270px; width: 250px; height: 100vh;
    background: var(--panel); flex-direction: column; gap: 6px;
    padding: 90px 30px; transition: right .3s; border-left: 1px solid var(--border);
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: .95rem; padding: 8px 0; }
}

/* ── hero: terminal window ── */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 130px 0 60px; }
.terminal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  max-width: 720px;
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.t-dot { width: 12px; height: 12px; border-radius: 50%; }
.t-dot.r { background: #ff5f57; } .t-dot.y { background: #febc2e; } .t-dot.g { background: #28c840; }
.term-title { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-left: 10px; }
.term-btn { margin-left: auto; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.term-body { padding: 30px 28px; font-family: var(--mono); }
.t-line { display: flex; gap: 10px; margin-bottom: 8px; }
.prompt { color: var(--teal); font-weight: 600; }
.cmd { color: var(--text); }
.t-out { color: var(--muted); font-size: .88rem; margin-bottom: 18px; line-height: 1.7; }
.t-out-big {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 4.2rem); letter-spacing: -.02em; line-height: 1.1;
  background: linear-gradient(120deg, var(--text), var(--teal));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin: 10px 0 8px;
}
.ok { color: var(--amber); font-weight: 600; }
.dim { opacity: .6; }
.caret { display: inline-block; width: 9px; height: 1.05em; background: var(--teal); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--border); color: var(--text); background: var(--panel);
  transition: transform .15s, border-color .2s, background .2s, box-shadow .2s;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: 0 8px 24px rgba(45,212,191,.1); }
.btn.primary { background: var(--teal); color: #06201c; border-color: var(--teal); }
.btn.primary:hover { background: #4ee3cf; box-shadow: 0 8px 30px rgba(45,212,191,.25); }
.scroll-hint { margin-top: 44px; font-family: var(--mono); font-size: .78rem; color: var(--muted); animation: bob 2s infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ── sections ── */
.section { padding: 96px 0; position: relative; }
.eyebrow {
  font-family: var(--mono); font-size: .82rem; color: var(--teal);
  letter-spacing: .04em; margin-bottom: 8px;
}
.sec-title { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px; }
.sec-sub { color: var(--muted); margin-bottom: 34px; }

/* ── cards ── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; margin-bottom: 16px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover { border-color: rgba(45,212,191,.4); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
[data-theme="dark"] .card:hover { box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.tag {
  font-family: var(--mono); font-size: .75rem; padding: 4px 11px; border-radius: 7px;
  background: rgba(167,122,250,.08); color: var(--purple); border: 1px solid rgba(167,122,250,.25);
}
.tag.green { background: rgba(45,212,191,.08); color: var(--teal); border-color: rgba(45,212,191,.25); }
.job-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ── about ── */
.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: 44px; align-items: center; }
.about-photo { position: relative; }
.about-photo img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--border);
  aspect-ratio: 1/1; object-fit: cover; filter: saturate(.95);
}
.about-photo::after {
  content: ''; position: absolute; inset: 14px -14px -14px 14px;
  border: 2px solid var(--teal); border-radius: var(--radius); z-index: -1; opacity: .45;
}
.about-text p { margin-bottom: 14px; color: var(--muted); }
.about-text b { color: var(--text); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 20px; }
.fact {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: .85rem; color: var(--text); font-weight: 500;
  font-family: var(--mono); font-size: .8rem;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } .about-photo { max-width: 320px; margin: 0 auto; } }

/* ── skills ── */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.skill {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; font-family: var(--mono); font-size: .88rem; color: var(--text);
  transition: border-color .2s, transform .2s;
}
.skill::before { content: '> '; color: var(--teal); }
.skill:hover { border-color: var(--teal); transform: translateY(-2px); }

/* ── why (work replacement) ── */
.why-text {
  font-size: clamp(1.25rem, 3.2vw, 1.8rem); font-weight: 600; line-height: 1.55;
  color: var(--text); max-width: 680px; letter-spacing: -.01em;
}

/* ── work experience ── */
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.job-title { font-size: 1.15rem; font-weight: 700; }
.job-title span { color: var(--muted); font-weight: 500; }
.job-date { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.job-desc { color: var(--muted); font-size: .95rem; margin-top: 10px; }
.why-note { margin-top: 14px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }

/* ── projects ── */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.project .p-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.project h3 { font-size: 1.05rem; font-weight: 700; }
.project .stars { font-family: var(--mono); font-size: .9rem; color: var(--purple); white-space: nowrap; }
.project p { color: var(--muted); font-size: .92rem; }
.project .links { margin-top: auto; padding-top: 10px; font-family: var(--mono); font-size: .82rem; }
.tilt { transform-style: preserve-3d; will-change: transform; }

/* ── certs ── */
.cert { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cert h3 { font-size: 1rem; font-weight: 600; }
.cert .org { color: var(--teal); font-size: .85rem; font-weight: 600; }
.cert .meta { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.cert a { font-family: var(--mono); font-size: .8rem; }

/* ── blog ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.blog-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; text-decoration: none; color: var(--text); }
.blog-card h3 { font-size: 1.08rem; font-weight: 700; color: var(--text); }
.blog-card p { color: var(--muted); font-size: .9rem; }
.blog-card:hover h3 { color: var(--teal); }
.blog-meta { font-family: var(--mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.read-more { font-family: var(--mono); font-size: .84rem; color: var(--teal); margin-top: auto; padding-top: 8px; }

/* ── post ── */
.post-title { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; line-height: 1.15; }
.post-body { margin-top: 26px; font-size: 1.02rem; color: var(--muted); }
.post-body p { margin-bottom: 18px; }
.post-body h1, .post-body h2, .post-body h3 { color: var(--text); margin: 30px 0 12px; letter-spacing: -.01em; }
.post-body h2 { font-size: 1.45rem; } .post-body h3 { font-size: 1.2rem; }
.post-body ul, .post-body ol { margin: 0 0 18px 24px; }
.post-body li { margin-bottom: 6px; }
.post-body pre {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; overflow-x: auto; margin: 0 0 18px; font-size: .86rem;
}
.post-body code { font-family: var(--mono); font-size: .88em; }
.post-body pre code { font-size: .86rem; }
.post-body blockquote {
  border-left: 3px solid var(--amber); padding: 4px 0 4px 18px;
  color: var(--text); font-style: italic; margin: 0 0 18px;
}
.post-body img { border-radius: 12px; margin: 6px 0 18px; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }

/* ── contact ── */
.contact-form { display: grid; gap: 12px; max-width: 520px; margin: 0 auto; }
.contact-form input, .contact-form textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 16px; color: var(--text); font-family: var(--font);
  font-size: .95rem; transition: border-color .2s; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--teal); }
.contact-form ::placeholder { color: var(--muted); }

/* ── footer ── */
.footer { border-top: 1px solid var(--border); padding: 34px 0 46px; text-align: center; color: var(--muted); font-size: .88rem; }
.footer .mono { font-family: var(--mono); font-size: .76rem; margin-top: 8px; opacity: .7; }

/* ── toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--panel); border: 1px solid var(--teal); color: var(--text);
  padding: 12px 22px; border-radius: 12px; font-size: .9rem; z-index: 200;
  transition: transform .35s ease; opacity: 0; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { border-color: var(--danger); }

/* ── reveal ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── responsive ── */
@media (max-width: 640px) {
  .section { padding: 68px 0; }
  .hero { min-height: 88vh; padding: 120px 0 50px; }
  .term-body { padding: 22px 18px; }
  .signal-tag { display: none; }
}

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

/* ═══════════════════════════════════════════════════════════
   HERO GLITCH — forced-dark terminal boot, screen-recordable
   signature: text-scramble reveal + periodic RGB-split burst
   ═══════════════════════════════════════════════════════════ */
.hero-glitch {
  --hg-bg: #05070c;
  --hg-panel: #0b0f1a;
  --hg-panel-2: #0e1524;
  --hg-border: #1c2740;
  --hg-text: #e8f0ff;
  --hg-muted: #7688ab;
  --hg-teal: #2dd4bf;
  --hg-magenta: #ff2ea6;
  --hg-cyan: #22d3ee;
  --hg-amber: #ffb454;
  position: relative;
  background: var(--hg-bg);
  isolation: isolate;
  overflow: hidden;
}
.hero-glitch::before {
  content: '';
  position: absolute; inset: -10%;
  background: radial-gradient(ellipse at 30% 20%, rgba(45,212,191,.09), transparent 55%),
              radial-gradient(ellipse at 80% 80%, rgba(255,46,166,.06), transparent 50%);
  pointer-events: none; z-index: 0;
}
.hero-glitch .scanlines {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
  animation: scan-shift 9s linear infinite;
}
@keyframes scan-shift { from { background-position: 0 0; } to { background-position: 0 240px; } }
.hero-glitch .noise {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise-flicker .4s steps(2) infinite;
}
@keyframes noise-flicker { 0%,100% { opacity: .035; } 50% { opacity: .07; } }
.hero-glitch .container { position: relative; z-index: 2; }

.hero-glitch .terminal {
  background: var(--hg-panel); border: 1px solid var(--hg-border);
  animation: term-glow 4.5s ease-in-out infinite;
}
@keyframes term-glow {
  0%,100% { box-shadow: 0 0 0 1px rgba(45,212,191,.08), 0 30px 90px rgba(0,0,0,.6), 0 0 40px rgba(45,212,191,.05); }
  50%     { box-shadow: 0 0 0 1px rgba(45,212,191,.2),  0 30px 90px rgba(0,0,0,.6), 0 0 70px rgba(45,212,191,.13); }
}
.hero-glitch .term-bar { background: var(--hg-panel-2); border-bottom-color: var(--hg-border); }
.hero-glitch .term-title, .hero-glitch .term-btn { color: var(--hg-muted); }
.hero-glitch .prompt { color: var(--hg-teal); }
.hero-glitch .cmd { color: var(--hg-text); }
.hero-glitch .t-out { color: var(--hg-muted); }
.hero-glitch .ok { color: var(--hg-amber); }
.hero-glitch .caret { background: var(--hg-teal); }

/* boot-in: lines arrive one at a time via JS toggling .show */
.boot-line { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.boot-line.show { opacity: 1; transform: translateY(0); }

/* signature: scramble-reveal + RGB-split glitch on the name */
.hero-glitch .glitch {
  position: relative;
  color: var(--hg-text);
  -webkit-text-fill-color: var(--hg-text);
  background: none;
  transform: translateY(8px);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%;
  background: var(--hg-bg); opacity: 0; pointer-events: none;
}
.glitch::before { color: var(--hg-cyan); }
.glitch::after  { color: var(--hg-magenta); }
.glitch.glitch-burst::before { left: 3px; opacity: .85; animation: glitch-slice .38s steps(3,end); }
.glitch.glitch-burst::after  { left: -3px; opacity: .85; animation: glitch-slice-2 .38s steps(3,end); }
@keyframes glitch-slice {
  0%   { clip-path: inset(10% 0 70% 0); transform: translate(0,0); }
  33%  { clip-path: inset(65% 0 5% 0);  transform: translate(-2px,0); }
  66%  { clip-path: inset(30% 0 45% 0); transform: translate(2px,0); }
  100% { clip-path: inset(80% 0 2% 0);  transform: translate(0,0); }
}
@keyframes glitch-slice-2 {
  0%   { clip-path: inset(70% 0 10% 0); transform: translate(0,0); }
  33%  { clip-path: inset(5% 0 65% 0);  transform: translate(2px,0); }
  66%  { clip-path: inset(45% 0 30% 0); transform: translate(-2px,0); }
  100% { clip-path: inset(2% 0 80% 0);  transform: translate(0,0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glitch .scanlines, .hero-glitch .noise, .hero-glitch .terminal { animation: none; }
  .boot-line { opacity: 1; transform: none; transition: none; }
  .glitch { transform: none; }
}
