:root {
  --bg: #070b12;
  --surface: #0c121e;
  --surface-2: #101827;
  --border: #1e293b;
  --border-hi: #38bdf866;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --emerald: #34d399;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.mono { font-family: 'JetBrains Mono', Consolas, monospace; }

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: -2;
}

.bg-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 460px;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.14), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 11, 18, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover { color: #fff; }
.nav-links .nav-term {
  color: var(--emerald);
  border: 1px solid #10b98144;
  background: #082920;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.nav-links .nav-term:hover { border-color: var(--emerald); }

.nav-links .nav-cta {
  color: var(--cyan);
  border: 1px solid #0ea5e955;
  background: #0c2235;
  padding: 6px 12px;
  border-radius: 8px;
}

.hero { padding: 64px 0 40px; }

.hero-split {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  align-items: center;
  gap: 44px;
  margin-bottom: 44px;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.portrait-glow {
  position: absolute;
  inset: -18px;
  background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.24), rgba(52, 211, 153, 0.12) 45%, transparent 72%);
  filter: blur(18px);
  z-index: 0;
  pointer-events: none;
}

.portrait-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 330px;
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.92) 0%, rgba(10, 15, 26, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.portrait-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.6);
}

.portrait-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 6px 10px;
}

.win-dots { display: flex; gap: 6px; }
.win-dots span { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.win-dots span:nth-child(1) { background: #ef4444cc; }
.win-dots span:nth-child(2) { background: #f59e0bcc; }
.win-dots span:nth-child(3) { background: #10b981cc; }

.portrait-path { font-size: 11px; color: var(--muted); }

.portrait-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #070b12;
  aspect-ratio: 1 / 1;
}

.hero-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.03) saturate(1.04);
}

.portrait-overlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(7, 11, 18, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.po-title { font-size: 14px; font-weight: 700; color: #f8fafc; line-height: 1.2; }
.po-sub { font-size: 11px; color: var(--cyan); margin-top: 2px; }

.portrait-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
}

.pf-chip {
  font-size: 10.5px;
  color: #cbd5e1;
  background: #0c1322;
  border: 1px solid #1e293b;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
  background: #082920;
  border: 1px solid #10b98144;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}

h1 {
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.1;
  background: linear-gradient(90deg, #ffffff 0%, #bae6fd 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hero-role {
  font-size: 19px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.hero-role a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dashed #38bdf866;
}

.hero-bio {
  max-width: 700px;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 28px;
}

.hero-bio strong { color: #f1f5f9; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
}

.btn-icon { gap: 8px; }
.btn.copied { border-color: var(--emerald); color: var(--emerald); }

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--cyan);
  color: #061320;
}

.btn-ghost {
  background: var(--surface);
  color: #e2e8f0;
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--border-hi); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.metric-val {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 2px;
}

.metric-lbl {
  font-size: 12.5px;
  color: var(--muted);
}

.section { padding: 48px 0; }

.section-head { margin-bottom: 24px; }

.section-tag {
  display: block;
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 6px;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.5px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

.panel h3, .panel h4 {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
}

.panel p {
  font-size: 14px;
  color: var(--muted);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.tl-item { position: relative; }

.tl-dot {
  position: absolute;
  left: -30px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}

.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tl-top h3 { font-size: 16px; font-weight: 700; color: #f8fafc; }
.tl-top a { color: var(--cyan); text-decoration: none; }
.tl-date { font-size: 12px; color: var(--emerald); font-weight: 600; }
.tl-card p { font-size: 14px; color: var(--muted); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s;
}

.project-card:hover { border-color: var(--border-hi); }
.project-card.featured { border-color: #0ea5e955; background: linear-gradient(180deg, #0d1828 0%, var(--surface) 100%); }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.p-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.p-live { background: #082920; color: var(--emerald); border: 1px solid #10b98144; }
.p-mobile { background: #0c2235; color: var(--cyan); border: 1px solid #0ea5e944; }
.p-tool { background: #261b0b; color: #fbbf24; border: 1px solid #d9770644; }
.p-infra { background: #1f1438; color: #c4b5fd; border: 1px solid #7c3aed44; }

.p-link {
  font-size: 12.5px;
  color: var(--cyan);
  text-decoration: none;
}

.project-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.project-card p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tags span {
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.panel-wide { grid-column: 1 / -1; }

.contact-box {
  background: linear-gradient(135deg, #0d1a2c 0%, #0b111c 100%);
  border: 1px solid #1e3a5f;
  border-radius: 16px;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.contact-box p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 26px 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.footer-link { color: var(--cyan); text-decoration: none; }

.term-modal[hidden] { display: none; }
.term-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.term-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(6px);
}

.term-window {
  position: relative;
  width: 100%;
  max-width: 660px;
  background: #090e17;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0d1422;
  border-bottom: 1px solid var(--border);
}

.term-title { font-size: 12px; color: var(--muted); }

.term-close {
  background: #131c2e;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.term-output {
  height: 250px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
}

.term-line { margin-bottom: 8px; white-space: pre-wrap; }
.t-cyan { color: var(--cyan); font-weight: 600; }
.t-green { color: var(--emerald); font-weight: 600; }
.t-prompt { color: #94a3b8; }
.t-res { color: #e2e8f0; }
.t-err { color: #f87171; }

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: #0b101b;
}

.term-chips button {
  background: #101827;
  color: #cbd5e1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}

.term-chips button:hover { border-color: var(--cyan); color: #fff; }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #070b12;
  font-size: 13px;
}

.term-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: 13px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media screen and (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { order: -1; }
  .portrait-card { max-width: 280px; }
  .metrics-grid, .about-grid, .projects-grid, .stack-grid {
    grid-template-columns: 1fr;
  }
  .nav-links a:not(.nav-cta) { display: none; }
}

@media print {
  @page { size: A4; margin: 10mm 12mm; }
  body { background: #ffffff !important; color: #0f172a !important; font-size: 11.5px !important; line-height: 1.42 !important; }
  .bg-grid, .bg-glow, .nav-wrap, .portrait-glow, .portrait-bar, .portrait-footer, .hero-actions, #copyEmailBtn, .term-modal { display: none !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .footer-link { color: var(--cyan); text-decoration: none; }

.term-modal[hidden] { display: none; }
.term-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.term-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(6px);
}

.term-window {
  position: relative;
  width: 100%;
  max-width: 660px;
  background: #090e17;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0d1422;
  border-bottom: 1px solid var(--border);
}

.term-title { font-size: 12px; color: var(--muted); }

.term-close {
  background: #131c2e;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.term-output {
  height: 250px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
}

.term-line { margin-bottom: 8px; white-space: pre-wrap; }
.t-cyan { color: var(--cyan); font-weight: 600; }
.t-green { color: var(--emerald); font-weight: 600; }
.t-prompt { color: #94a3b8; }
.t-res { color: #e2e8f0; }
.t-err { color: #f87171; }

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: #0b101b;
}

.term-chips button {
  background: #101827;
  color: #cbd5e1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}

.term-chips button:hover { border-color: var(--cyan); color: #fff; }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #070b12;
  font-size: 13px;
}

.term-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: 13px;
}

.reveal { opacity: 1 !important; transform: none !important; }

  .hero { padding: 0 0 12px !important; }
  .hero-split { grid-template-columns: 1fr 124px !important; gap: 18px !important; margin-bottom: 12px !important; align-items: start !important; }
  .hero-visual { order: 0 !important; }
  .portrait-card { max-width: 124px !important; border-color: #cbd5e1 !important; background: #ffffff !important; box-shadow: none !important; padding: 4px !important; border-radius: 12px !important; }
  .portrait-frame { border-radius: 8px !important; }
  .portrait-overlay { display: none !important; }

  .status-pill { font-size: 10px !important; padding: 3px 10px !important; margin-bottom: 6px !important; background: #ecfdf5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }
  h1 { -webkit-text-fill-color: #0f172a !important; font-size: 26px !important; margin-bottom: 4px !important; }
  .hero-role { font-size: 13px !important; color: #1e293b !important; margin-bottom: 6px !important; }
  .hero-bio { font-size: 11.5px !important; margin-bottom: 0 !important; color: #334155 !important; }
  .hero-bio strong { color: #0f172a !important; }

  .metrics-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
  .about-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .projects-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .stack-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

  .section { padding: 10px 0 !important; break-inside: auto !important; }
  .section-head { margin-bottom: 8px !important; break-after: avoid !important; page-break-after: avoid !important; }
  .section-tag { font-size: 9.5px !important; color: #0284c7 !important; margin-bottom: 2px !important; }
  h2 { font-size: 16px !important; color: #0f172a !important; }
  h3, h4, .metric-val, .tl-top h3, .project-card h3 { color: #0f172a !important; font-size: 12.5px !important; margin-bottom: 4px !important; }
  p, .metric-lbl, .tl-card p, .project-card p, .footer { color: #334155 !important; font-size: 11px !important; margin-bottom: 6px !important; }

  .metric-card, .panel, .tl-card, .project-card, .contact-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 9px 11px !important;
    border-radius: 8px !important;
    break-inside: avoid !important;
  }
  .timeline { gap: 8px !important; padding-left: 16px !important; }
  .tl-dot { left: -21px !important; top: 14px !important; width: 9px !important; height: 9px !important; background: #0284c7 !important; border-color: #ffffff !important; box-shadow: none !important; }
  .tl-date { font-size: 10px !important; color: #047857 !important; }
  .p-badge { font-size: 9px !important; padding: 2px 6px !important; }
  .p-link { font-size: 10px !important; color: #0284c7 !important; }
  .tags { gap: 4px !important; }
  .tags span { background: #f1f5f9 !important; color: #0f172a !important; border-color: #cbd5e1 !important; font-size: 9.5px !important; padding: 2px 6px !important; }

  .contact-box { padding: 12px 14px !important; gap: 10px !important; }
  .contact-links { gap: 6px !important; }
  .btn, .btn-primary, .btn-ghost {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 5px 9px !important;
    font-size: 10.5px !important;
    border-radius: 6px !important;
  }
  .footer { padding: 10px 0 0 !important; margin-top: 8px !important; font-size: 10px !important; }
}
