/* ===================== tokens ===================== */
:root{
  --bg: #0D1D35;
  --bg-panel: #122A4B;
  --line: #2C4C79;
  --line-soft: rgba(126,200,227,0.16);
  --text-primary: #E9F1FA;
  --text-secondary: #93AAC9;
  --text-dim: #5F7699;
  --accent-cyan: #7EC8E3;
  --accent-amber: #F2A65A;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --content-max: 1120px;
  --edge: clamp(20px, 5vw, 64px);
}

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

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

.grid-overlay{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to right, var(--line-soft) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px 88px);
  opacity: 0.35;
}

/* ===================== nav ===================== */
.topnav{
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px var(--edge);
  background: rgba(13,29,53,0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topnav__mark{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 2px;
}

.topnav__links{
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-x: auto;
}

.topnav__links a{
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.topnav__links a:hover{ color: var(--text-primary); }

.topnav__cta{
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--bg);
  background: var(--accent-cyan);
  padding: 8px 14px;
  border-radius: 2px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.topnav__cta:hover{ opacity: 0.85; }

@media (max-width: 720px){
  .topnav{ gap: 14px; }
  .topnav__links{ display: none; }
}

/* ===================== sheet shell ===================== */
main{ position: relative; z-index: 1; max-width: var(--content-max); margin: 0 auto; }

.sheet{
  position: relative;
  padding: 72px var(--edge) 56px;
  border-bottom: 1px solid var(--line);
}

.reg-mark{
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  opacity: 0.55;
}
.reg-mark::before, .reg-mark::after{
  content: '';
  position: absolute;
  background: var(--accent-cyan);
}
.reg-mark::before{ width: 100%; height: 1px; top: 50%; }
.reg-mark::after{ height: 100%; width: 1px; left: 50%; }
.reg-mark--tl{ top: 20px; left: var(--edge); }
.reg-mark--tr{ top: 20px; right: var(--edge); }

.sheet__number{
  margin: 48px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.sheet__title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 36px);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.sheet__lede{
  max-width: 62ch;
  color: var(--text-secondary);
  margin: 0 0 36px;
  font-size: 16px;
}

/* ===================== hero ===================== */
.sheet--hero{
  padding-top: 90px;
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.hero__eyebrow{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
  margin: 0 0 18px;
}

.hero__name{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.hero__role{
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 20px);
  color: var(--accent-cyan);
  margin: 0 0 22px;
  max-width: 46ch;
}

.hero__summary{
  color: var(--text-secondary);
  max-width: 56ch;
  font-size: 16.5px;
  margin: 0 0 32px;
}

.hero__actions{ display: flex; gap: 14px; flex-wrap: wrap; }

.btn{
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 2px;
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn--primary{ background: var(--accent-cyan); color: var(--bg); border-color: var(--accent-cyan); }
.btn--primary:hover{ opacity: 0.88; }
.btn--ghost{ color: var(--text-primary); }
.btn--ghost:hover{ border-color: var(--accent-cyan); color: var(--accent-cyan); }

.titleblock{
  border: 1px solid var(--line);
  background: var(--bg-panel);
  align-self: start;
  margin-top: 8px;
}
.titleblock__row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.titleblock__row:last-child{ border-bottom: none; }
.titleblock__label{ color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.titleblock__value{ color: var(--text-primary); text-align: right; }

@media (max-width: 860px){
  .sheet--hero{ grid-template-columns: 1fr; }
}

/* ===================== schematic ===================== */
.schematic{
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 24px clamp(12px, 3vw, 28px) 20px;
  overflow-x: auto;
}
.schematic__svg{ width: 100%; min-width: 720px; height: auto; display: block; }

.schem-line path{
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}

.schem-node rect{
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1.25;
}
.schem-node--accent rect{ stroke: var(--accent-amber); }

.schem-node__text{
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--text-primary);
}
.schem-node__meta{
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: var(--accent-cyan);
}

.schematic__prod{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: baseline;
  min-width: 720px;
}
.schematic__prod-title{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.schematic__prod-item{
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* pipeline draw-in, one orchestrated moment on load */
.schem-line path{
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw 1.1s ease forwards;
}
.schem-node{ opacity: 0; animation: appear 0.5s ease forwards; }
.schem-node:nth-of-type(1){ animation-delay: 0.05s; }
.schem-node:nth-of-type(2){ animation-delay: 0.15s; }
.schem-node:nth-of-type(3){ animation-delay: 0.25s; }
.schem-node:nth-of-type(4){ animation-delay: 0.55s; }
.schem-node:nth-of-type(5){ animation-delay: 0.85s; }
.schem-node:nth-of-type(6){ animation-delay: 0.95s; }
.schem-node:nth-of-type(7){ animation-delay: 1.05s; }
.schem-node:nth-of-type(8){ animation-delay: 1.35s; }

@keyframes draw{ to{ stroke-dashoffset: 0; } }
@keyframes appear{ to{ opacity: 1; } }

@media (prefers-reduced-motion: reduce){
  .schem-line path{ stroke-dashoffset: 0; animation: none; }
  .schem-node{ opacity: 1; animation: none; }
}

/* ===================== timeline / experience ===================== */
.timeline{ display: flex; flex-direction: column; gap: 44px; }

.role{
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}
.role:first-child{ border-top: none; padding-top: 0; }

.role__dates{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
  margin: 0 0 4px;
}
.role__location{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0;
}

.role__title{
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 4px;
}
.role__company{
  color: var(--text-secondary);
  margin: 0 0 14px;
  font-size: 14.5px;
}
.role__list{
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.role__list li{
  color: var(--text-secondary);
  font-size: 15px;
}

.metric{
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 0.95em;
}

@media (max-width: 720px){
  .role{ grid-template-columns: 1fr; gap: 8px; }
}

/* ===================== skills legend ===================== */
.legend{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.legend__item{
  background: var(--bg);
  padding: 20px 22px;
}
.legend__key{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.legend__value{
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
}

@media (max-width: 720px){
  .legend{ grid-template-columns: 1fr; }
}

/* ===================== certifications ===================== */
.certs{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.cert{
  background: var(--bg);
  padding: 18px 20px;
}
.cert__code{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-amber);
  margin: 0 0 6px;
}
.cert__name{
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
}

/* ===================== education + contact ===================== */
.sheet--split{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px){
  .sheet--split{ grid-template-columns: 1fr; }
}

.edu__degree{ font-size: 16px; margin: 0 0 6px; }
.edu__school{ color: var(--text-secondary); margin: 0 0 6px; }
.edu__dates{ font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); margin: 0; }

.contact-list{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-list a{ text-decoration: none; color: var(--text-primary); font-size: 15px; }
.contact-list a:hover{ color: var(--accent-cyan); }
.contact-list span{ color: var(--text-secondary); font-size: 15px; }

/* ===================== footer ===================== */
.footer{
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px var(--edge) 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer__link{ text-decoration: none; color: var(--accent-cyan); }
.footer__link:hover{ text-decoration: underline; }

/* ===================== focus states ===================== */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* ===================== engineering journey ===================== */
.journey{
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(to right, transparent 49.95%, var(--line-soft) 50%, transparent 50.05%),
    var(--bg-panel);
  padding: 34px clamp(18px, 4vw, 52px) 38px;
  overflow: hidden;
}

.journey::before{
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line);
  opacity: 0.45;
}

.journey__start{
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.journey__year{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--accent-cyan);
  background: var(--bg);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.journey__track{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journey__step{
  position: relative;
  min-height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.journey__step::before{
  content: '';
  position: absolute;
  top: 50%;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--accent-cyan);
  background: var(--bg);
  border-radius: 50%;
  z-index: 3;
}

.journey__index{
  position: absolute;
  left: calc(50% - 245px);
  width: 34px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-align: right;
}

.journey__card{
  width: min(420px, 43%);
  margin-left: 48%;
  padding: 13px 18px;
  border: 1px solid var(--line);
  background: var(--bg);
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.journey__card::before{
  content: '';
  position: absolute;
  left: -34px;
  top: 50%;
  width: 34px;
  height: 1px;
  background: var(--line);
}

.journey__card:hover{
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.journey__label{
  display: block;
  margin-bottom: 3px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.journey__card h3{
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}

.journey__ai{
  position: relative;
  z-index: 2;
  margin-top: 28px;
  padding: 24px 20px 20px;
  border: 1px solid var(--accent-amber);
  background: var(--bg);
}

.journey__ai-header{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.journey__ai-label{
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.journey__ai-line{
  width: 1px;
  height: 30px;
  margin: 12px auto 14px;
  background: var(--accent-amber);
}

.journey__branches{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.journey__branch{
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
}

.journey__branch::before{
  content: '';
  position: absolute;
  left: 50%;
  top: -11px;
  width: 1px;
  height: 10px;
  background: var(--accent-amber);
}

.journey__branch-index{
  color: var(--accent-amber);
  font-size: 10px;
}

.journey__branch--destination{
  grid-column: 1 / -1;
  justify-content: center;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  margin-top: 8px;
}

.journey__branch--destination::before{
  height: 18px;
  top: -19px;
}

@media (max-width: 720px){
  .journey{
    background: var(--bg-panel);
    padding: 28px 18px 30px;
  }

  .journey::before{
    left: 28px;
  }

  .journey__start{
    justify-content: flex-start;
    margin-left: 8px;
  }

  .journey__track{
    gap: 8px;
  }

  .journey__step{
    justify-content: flex-start;
    padding-left: 52px;
    min-height: 58px;
  }

  .journey__step::before{
    left: 28px;
  }

  .journey__index{
    display: none;
  }

  .journey__card{
    width: 100%;
    margin-left: 0;
  }

  .journey__card::before{
    left: -24px;
    width: 24px;
  }

  .journey__branches{
    grid-template-columns: 1fr;
  }

  .journey__branch--destination{
    grid-column: auto;
  }

  .journey__ai{
    margin-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce){
  .journey__card{
    transition: none;
  }
}
