:root {
  --bg: #0a0c10;
  --bg-elev: #11151c;
  --line: rgba(148, 163, 184, 0.14);
  --text: #e8edf5;
  --muted: #8b97a8;
  --faint: #5c6778;
  --accent: #64ffda;
  --accent-dim: rgba(100, 255, 218, 0.12);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --rail: 320px;
  --max-main: 640px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: #9bffe8;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--accent);
  color: #04201a;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

/* Shell: rail + main */
.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 4rem 2rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(100, 255, 218, 0.06), transparent 60%),
    var(--bg);
}

.rail-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.rail-name {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 3.2vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.rail-tag {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 28ch;
  margin-bottom: 1.5rem;
}

.rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin-bottom: 2rem;
}

.rail-links a {
  font-size: 0.88rem;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.rail-links a:hover {
  color: var(--accent);
  border-bottom-color: rgba(100, 255, 218, 0.4);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
}

.rail-nav a {
  color: var(--faint);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.rail-nav a:hover,
.rail-nav a.active {
  color: var(--text);
  border-left-color: var(--accent);
}

.rail-meta {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  color: var(--faint);
}

/* Main column */
.main {
  padding: 4rem 3rem 5rem;
  max-width: calc(var(--max-main) + 6rem);
}

.block {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

.label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.prose {
  color: var(--muted);
  font-size: 1.02rem;
}

.prose p + p {
  margin-top: 1rem;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
  margin-top: 1rem;
}

/* Experience */
.jobs {
  list-style: none;
  display: grid;
  gap: 1.75rem;
}

.job {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
}

.job-dates {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  padding-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.job-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
  letter-spacing: -0.01em;
}

.job-body h3 span {
  color: var(--muted);
  font-weight: 500;
}

.job-body ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.job-body li {
  position: relative;
  padding-left: 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.job-body li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

/* Skills rows — scannable, not walls */
.skill-rows {
  display: grid;
  gap: 0.85rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.skill-cat {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.skill-items {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Project cards — single column list (3 items, no empty slot) */
.cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  perspective: 900px;
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  --press: 1;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num head"
    "num desc"
    "num tags";
  column-gap: 1rem;
  row-gap: 0.35rem;
  align-items: start;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transform:
    translateY(var(--lift))
    scale(var(--press))
    rotateX(var(--rx))
    rotateY(var(--ry));
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.12s ease-out;
  will-change: transform;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.card-frost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}

.card.is-hover,
.card:hover,
.card.is-frosted {
  border-color: rgba(180, 220, 255, 0.45);
  box-shadow:
    0 12px 36px rgba(80, 140, 200, 0.18),
    0 0 0 1px rgba(200, 230, 255, 0.12),
    inset 0 0 24px rgba(180, 220, 255, 0.06);
}

.card.is-press {
  --press: 0.97;
  --lift: 0px !important;
  transition-duration: 0.06s;
}

.card-link {
  color: inherit;
  display: block;
}

.card-link:hover {
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transform: none !important;
    transition: border-color 0.2s ease;
  }
  .card-frost {
    display: none;
  }
}

.card-top {
  position: relative;
  z-index: 1;
  grid-area: head;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0;
}

.card-num {
  grid-area: num;
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--faint);
  line-height: 1.1;
  min-width: 2ch;
  padding-top: 0.1rem;
}

.card-ext {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.card h3 {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.card p {
  grid-area: desc;
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.card .pills {
  grid-area: tags;
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pills span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
}

/* CTA */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  background: var(--accent);
  color: #04201a;
}

.btn:hover {
  color: #04201a;
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: rgba(100, 255, 218, 0.4);
  color: var(--accent);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--faint);
}

/* Resume page */
body.resume-page {
  background: #f6f7f9;
  color: #1a1d24;
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
}

.resume-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e6ee;
}

.resume-toolbar a,
.resume-toolbar button {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
}

.resume-toolbar .back {
  color: #334155;
  background: #f1f5f9;
}

.resume-toolbar .print-btn {
  color: #fff;
  background: #0f172a;
}

.resume-sheet {
  width: min(100% - 2rem, 780px);
  margin: 1.25rem auto 3rem;
  background: #fff;
  border: 1px solid #e2e6ee;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  padding: 2rem 2.25rem;
}

.rs-header {
  text-align: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1.5px solid #0f172a;
}

.rs-header h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.rs-header .role {
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.rs-header .meta {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
}

.rs-header .meta a {
  color: #0f172a;
  text-decoration: none;
}

.resume-sheet h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid #cbd5e1;
  margin: 0.95rem 0 0.45rem;
  padding-bottom: 0.2rem;
  color: #0f172a;
}

.resume-sheet .sum {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #1e293b;
  margin-bottom: 0.15rem;
}

.resume-sheet .skill-line {
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.resume-sheet .skill-line strong {
  font-weight: 700;
}

.resume-sheet .role-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-top: 0.55rem;
}

.resume-sheet .role-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: #475569;
  font-style: italic;
  margin-bottom: 0.2rem;
}

.resume-sheet .role-meta .dates {
  font-style: normal;
  white-space: nowrap;
  color: #64748b;
}

.resume-sheet ul {
  margin: 0.15rem 0 0.35rem 1.05rem;
  list-style: disc;
}

.resume-sheet li {
  font-size: 0.88rem;
  line-height: 1.35;
  margin-bottom: 0.12rem;
  color: #1e293b;
}

.resume-sheet .proj {
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.resume-sheet .proj a {
  color: #0f172a;
  font-weight: 600;
}

/* Mobile */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 2rem 1.25rem 1.5rem;
  }

  .rail-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 1.25rem;
  }

  .rail-nav a {
    border-left: 0;
    padding-left: 0;
    border-bottom: 2px solid transparent;
  }

  .rail-nav a:hover,
  .rail-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .main {
    padding: 2rem 1.25rem 3rem;
  }

  .job {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

}

@media print {
  .resume-toolbar {
    display: none !important;
  }
  body.resume-page {
    background: #fff;
  }
  .resume-sheet {
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
}
