:root {
  --bg: #0a0e14;
  --bg-2: #0e131c;
  --panel: #111824;
  --panel-2: #0c121b;
  --border: #1c2735;
  --border-2: #243144;
  --text: #e6edf3;
  --muted: #8b98a9;
  --muted-2: #5d6b7d;
  --accent: #2bd47e;     /* neon green */
  --accent-2: #38bdf8;   /* cyan */
  --crit: #ff5d6c;
  --high: #2bd47e;
  --med: #f5b14c;
  --radius: 14px;
  --maxw: 1120px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: radial-gradient(1200px 800px at 70% -10%, #11202e 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }
.accent-2 { color: var(--accent-2); }

/* ---------- background fx ---------- */
.grid-bg {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(43,212,126,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,212,126,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(900px 600px at 50% 0%, #000 0%, transparent 80%);
}
.scanlines {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 56px);
  background: rgba(10,14,20,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; letter-spacing: .5px; }
.brand-bracket { color: var(--accent); }
.brand-caret { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 26px; font-family: var(--mono); font-size: .9rem; }
.nav-links a { color: var(--muted); transition: color .2s; position: relative; }
.nav-links a:hover { color: var(--accent); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); transition: .25s; }

/* ---------- layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 5vw, 56px); }
.section { padding: 84px 0 24px; }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 38px; }
.section-index { font-family: var(--mono); color: var(--accent); font-size: .85rem; opacity: .8; }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; letter-spacing: -.5px; }
.section-title .hash { color: var(--muted-2); font-family: var(--mono); }
.section-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-2), transparent); }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 110px) 0 40px; }
.hero-inner { max-width: 760px; animation: heroIn .7s ease both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-inner { animation: none; } }
.status-pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .78rem; color: var(--accent);
  background: rgba(43,212,126,.08); border: 1px solid rgba(43,212,126,.25);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 26px;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(43,212,126,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(43,212,126,.5);} 70% { box-shadow: 0 0 0 9px rgba(43,212,126,0);} 100% { box-shadow: 0 0 0 0 rgba(43,212,126,0);} }

.terminal {
  background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: 12px; overflow: hidden; margin-bottom: 30px;
  box-shadow: 0 24px 60px -28px rgba(0,0,0,.8);
  max-width: 540px;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #0a0f17; border-bottom: 1px solid var(--border); }
.tdot { width: 11px; height: 11px; border-radius: 50%; }
.tdot.red { background: #ff5f56; } .tdot.yellow { background: #ffbd2e; } .tdot.green { background: #27c93f; }
.terminal-title { margin-left: 8px; font-family: var(--mono); font-size: .76rem; color: var(--muted-2); }
.terminal-body { padding: 16px 18px; font-family: var(--mono); font-size: .86rem; }
.terminal-body p { margin: 3px 0; }
.terminal-body .prompt { color: var(--accent); margin-right: 8px; }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--muted); padding-left: 18px; }
.terminal-body .out.accent { color: var(--accent-2); }
#typeLine::after { content: "▋"; color: var(--accent); animation: blink 1s steps(1) infinite; }

.hero-title { font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.1; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 20px; }
.hero-sub { color: var(--muted); font-size: 1.06rem; max-width: 600px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 46px; }

.btn {
  font-family: var(--mono); font-size: .9rem; font-weight: 500;
  padding: 12px 24px; border-radius: 10px; cursor: pointer; transition: .2s; border: 1px solid transparent;
  display: inline-block;
}
.btn-primary { background: var(--accent); color: #04130b; font-weight: 700; }
.btn-primary:hover { box-shadow: 0 10px 30px -8px rgba(43,212,126,.5); transform: translateY(-2px); }
.btn-ghost { border-color: var(--border-2); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.5rem; color: var(--text); font-family: var(--mono); }
.hero-stats span { font-size: .8rem; color: var(--muted-2); }

/* ---------- about ---------- */
.about-grid { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.about-photo { position: relative; flex-shrink: 0; }
.about-photo img {
  width: 160px; height: 160px; object-fit: cover; object-position: center top;
  border-radius: 16px; border: 1px solid var(--border-2);
  filter: grayscale(20%) contrast(1.03);
  box-shadow: 0 20px 50px -22px rgba(0,0,0,.85), 0 0 0 4px rgba(43,212,126,.06);
}
.about-photo::before {
  content: ""; position: absolute; inset: -8px; border-radius: 20px;
  border: 1px dashed rgba(43,212,126,.25); pointer-events: none;
}
.photo-tag {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .68rem; color: var(--accent);
  background: var(--panel); border: 1px solid var(--border-2);
  padding: 3px 10px; border-radius: 6px; white-space: nowrap;
}
.about-text { flex: 1; min-width: 280px; }
.about-text p { color: var(--muted); margin-bottom: 14px; }
.about-text strong { color: var(--text); }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 18px; }
.about-tags li {
  font-family: var(--mono); font-size: .76rem; color: var(--accent-2);
  border: 1px solid var(--border-2); padding: 5px 11px; border-radius: 999px; background: rgba(56,189,248,.05);
}

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: .25s; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px;
  background: var(--accent); opacity: .5; transition: .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 24px 50px -28px rgba(0,0,0,.8); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-id { font-family: var(--mono); font-size: .72rem; color: var(--muted-2); }
.sev { font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .8px; padding: 4px 9px; border-radius: 5px; }
.sev-crit { color: var(--crit); background: rgba(255,93,108,.12); border: 1px solid rgba(255,93,108,.3); }
.sev-high { color: var(--high); background: rgba(43,212,126,.12); border: 1px solid rgba(43,212,126,.3); }
.sev-med { color: var(--med); background: rgba(245,177,76,.12); border: 1px solid rgba(245,177,76,.3); }
.sev-learn { color: var(--accent-2); background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.28); }
.card h3 { font-size: 1.18rem; margin-bottom: 10px; letter-spacing: -.3px; }
.card p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.stack { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; }
.stack li { font-family: var(--mono); font-size: .72rem; color: var(--muted); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; background: var(--bg-2); }
.card-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.card-links a {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .8rem; color: var(--accent-2);
  transition: .2s;
}
.card-links a:hover { color: var(--accent); transform: translateX(2px); }

/* ---------- certs ---------- */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cert { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: .2s; }
.cert:hover { border-color: var(--border-2); transform: translateY(-3px); }
.cert-status { font-family: var(--mono); font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 5px; display: inline-block; margin-bottom: 12px; }
.cert-status.done { color: var(--accent); background: rgba(43,212,126,.12); border: 1px solid rgba(43,212,126,.3); }
.cert-status.pursuing { color: var(--med); background: rgba(245,177,76,.1); border: 1px solid rgba(245,177,76,.28); }
.cert h4 { font-size: 1.02rem; margin-bottom: 6px; }
.cert p { color: var(--muted); font-size: .85rem; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 36px; }
.contact-intro .prompt-line { font-family: var(--mono); color: var(--accent); margin-bottom: 14px; }
.contact-intro p { color: var(--muted); }
.socials { display: flex; gap: 16px; margin-top: 22px; font-family: var(--mono); font-size: .9rem; }
.socials a { color: var(--accent-2); border-bottom: 1px solid transparent; transition: .2s; }
.socials a:hover { border-color: var(--accent-2); }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .row { display: flex; gap: 14px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: .78rem; color: var(--muted); flex: 1; }
.contact-form input, .contact-form textarea {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; color: var(--text); font-family: var(--sans); font-size: .92rem; transition: .2s; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,212,126,.12); }
.contact-form .btn { align-self: flex-start; margin-top: 4px; }
.form-note { font-family: var(--mono); font-size: .8rem; min-height: 1em; }
.form-note.ok { color: var(--accent); }
.form-note.err { color: var(--crit); }

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw); margin: 60px auto 0; padding: 28px clamp(18px, 5vw, 56px);
  border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: .8rem; color: var(--muted-2);
}

/* ---------- reveal animation ---------- */
.section, .hero-inner > * { opacity: 1; }
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 60px 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(10,14,20,.97); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s; }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px clamp(18px,5vw,56px); border-top: 1px solid var(--border); width: 100%; }
  .nav-toggle { display: flex; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-form .row { flex-direction: column; }
  .about-grid { flex-direction: column; text-align: center; }
  .about-tags { justify-content: center; }
  .hero-stats { gap: 28px; }
}
