:root {
  --bg: #0a0a0f;
  --panel: #111118;
  --panel-hi: #16161f;
  --border: #232334;
  --text: #e4e4ea;
  --muted: #8b8ea0;
  --dim: #5c5e72;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --warn: #fbbf24;
  --green: #34d399;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(600px 300px at -10% 50%, rgba(139, 92, 246, 0.06), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(34, 211, 238, 0.015) 3px, rgba(34, 211, 238, 0.015) 4px);
  background-size: auto, auto, 40px 40px, 40px 40px, auto;
  pointer-events: none;
  z-index: 0;
}
main { flex: 1 0 auto; position: relative; z-index: 1; }

/* ── Corner ASCII decorations (per-page content lives in each HTML) ── */
.ascii-deco {
  position: fixed;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 10px;
  line-height: 1.5;
  white-space: pre;
  pointer-events: none;
  z-index: 0;
  letter-spacing: 0;
  user-select: none;
  opacity: 0.3;
  margin: 0;
}
.ascii-left {
  top: 78px;
  left: 18px;
  color: var(--muted);
}
.ascii-right {
  bottom: 18px;
  right: 18px;
  color: var(--accent);
}
@media (max-width: 1180px) {
  .ascii-deco { display: none; }
}
.mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; }
a { color: var(--accent); text-decoration: none; transition: opacity .15s ease; }
a:hover { opacity: 0.75; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(10, 10, 15, 0.75);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
nav .wrap { display: flex; justify-content: space-between; align-items: center; }
nav .brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
}
nav .brand::before { content: "> "; color: var(--accent); }
nav .brand:hover { opacity: 1; color: var(--accent); }
nav ul { display: flex; gap: 24px; list-style: none; }
nav ul a {
  color: var(--muted);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
}
nav ul a:hover { color: var(--text); opacity: 1; }
nav ul a.active {
  color: var(--accent);
  opacity: 1;
}
nav ul a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -18px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ── Section ── */
/* Use top/bottom only; horizontal padding comes from .wrap and must not be reset. */
section { padding-top: 56px; padding-bottom: 8px; }
section:first-of-type { padding-top: 40px; }
h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
  font-weight: 500;
}
h2::before { content: "// "; color: var(--dim); }

/* ── Hero (home only) ── */
.hero { padding-top: 96px; padding-bottom: 40px; }
.hero h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1;
}
.hero h1 .caret { color: var(--accent); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .role {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 24px;
}
.hero .role .chev { color: var(--accent); }
.hero p.intro {
  color: var(--muted);
  max-width: 620px;
  font-size: 16px;
  line-height: 1.65;
}
.hero p.intro strong { color: var(--text); font-weight: 500; }

.socials { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--panel);
}
.socials a:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  opacity: 1;
}
.socials svg { width: 14px; height: 14px; }

/* ── Page header (non-home) ── */
.page-header {
  padding-top: 64px;
  padding-bottom: 16px;
}
.page-header h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.page-header h1 .chev { color: var(--accent); }
.page-header .sub {
  color: var(--muted);
  font-size: 15px;
  max-width: 540px;
}

/* ── About ── */
.about p {
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.7;
}
.about p strong { color: var(--text); font-weight: 500; }

.chains {
  display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap;
}
.chains .chain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

/* ── Experience ── */
.exp-row {
  padding: 20px 0;
  border-bottom: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
}
.exp-row:last-child { border-bottom: none; }
.exp-row .when {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--dim);
  padding-top: 2px;
  white-space: nowrap;
}
.exp-row .what h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
}
.exp-row .what .co {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin-bottom: 10px;
}
.exp-row .what p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.exp-row .what ul {
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.exp-row .what ul li { padding-left: 16px; position: relative; margin-bottom: 4px; }
.exp-row .what ul li::before {
  content: "›";
  position: absolute; left: 0; top: 0;
  color: var(--accent);
}
@media (max-width: 640px) {
  .exp-row { grid-template-columns: 1fr; gap: 8px; }
  .exp-row .when { padding-top: 0; }
}

/* ── Mobile tightening: breathing room under sticky nav + consistent edges ── */
@media (max-width: 640px) {
  .wrap { padding-left: 22px; padding-right: 22px; }
  .hero { padding-top: 44px; padding-bottom: 24px; }
  .hero h1 { font-size: 52px; letter-spacing: -0.03em; overflow-wrap: break-word; }
  .hero .role { font-size: 14px; margin-bottom: 20px; }
  .hero p.intro { font-size: 15px; }
  .page-header { padding-top: 36px; padding-bottom: 14px; }
  .page-header h1 { font-size: 32px; margin-bottom: 12px; overflow-wrap: break-word; }
  .page-header .sub { font-size: 14px; }
  section { padding-top: 36px; padding-bottom: 8px; }
  section:first-of-type,
  .page-header + section { padding-top: 20px; }
  h2 { margin-bottom: 18px; }
  nav ul { gap: 14px; }
  nav ul a { font-size: 12px; }
}

/* ── Projects ── */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.project {
  display: block;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .15s ease;
  position: relative;
}
.project:hover {
  border-color: var(--accent);
  background: var(--panel-hi);
  transform: translateY(-2px);
  opacity: 1;
}
.project .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.project h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.project p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}
.project .stack {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.project .stack span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  padding: 2px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.project .link-arrow {
  position: absolute;
  top: 20px; right: 20px;
  color: var(--dim);
  font-size: 14px;
}
.project:hover .link-arrow { color: var(--accent); }

.project.compact {
  padding: 14px 18px;
}
.project.compact h3 {
  font-size: 13px;
  margin-bottom: 4px;
}
.project.compact p {
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 8px;
}
.project.compact .tag {
  font-size: 10px;
  margin-bottom: 6px;
}
.project.compact .stack span {
  font-size: 9px;
  padding: 1px 6px;
}
.project.compact .link-arrow {
  top: 14px; right: 14px;
  font-size: 12px;
}

.projects-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

/* ── Skills ── */
.skill-group {
  margin-bottom: 24px;
}
.skill-group .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 8px;
}
.skill-group .items {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.skill-group .items span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

/* ── Achievements ── */
.achv {
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
}
.achv:last-child { border-bottom: none; }
.achv .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 8px;
  box-shadow: 0 0 12px var(--accent);
}
.achv h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.achv p {
  color: var(--muted);
  font-size: 13px;
}

/* ── Footer ── */
footer {
  padding: 60px 0 40px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-align: center;
  flex-shrink: 0;
}
footer .status::before {
  content: "●";
  color: var(--green);
  margin-right: 6px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ── Page-nav cross-links at bottom of content ── */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}
.page-nav a:hover { color: var(--accent); opacity: 1; }
.page-nav a.prev::before { content: "← "; }
.page-nav a.next::after  { content: " →"; }
