:root {
  --paper: #f3eee3;
  --ink: #11110f;
  --muted: #6d6458;
  --line: #171614;
  --card: #fff9ec;
  --red: #ff4938;
  --blue: #2658ff;
  --green: #178653;
  --yellow: #f6ce3d;
  --grid-line: rgba(17,17,15,.045);
  --dock-fill: rgba(255,255,255,.38);
  --rail: 104px;
  --max: 1180px;
}
[data-theme="dark"] {
  --paper: #10100f;
  --ink: #f3eee3;
  --muted: #b9ad9b;
  --line: #f3eee3;
  --card: #191817;
  --red: #ff5a48;
  --blue: #6f92ff;
  --green: #35b978;
  --yellow: #f6ce3d;
  --grid-line: rgba(243,238,227,.055);
  --dock-fill: rgba(255,255,255,.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "DM Sans", sans-serif;
  transition: background .22s ease, color .22s ease;
}
.side-nav {
  position: fixed;
  inset: 18px auto 18px 18px;
  z-index: 30;
  width: var(--rail);
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 8px 8px 0 var(--line);
  display: grid;
  grid-template-rows: 86px 1fr 116px;
}
.mark {
  display: grid;
  place-items: center;
  border-bottom: 2px solid var(--line);
  color: var(--ink);
  background: var(--card);
  text-decoration: none;
}
.mark img {
  width: 52px;
  height: 52px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #55e6e1;
  box-shadow: 4px 4px 0 var(--line);
  transform: rotate(-5deg);
}
.rail-links {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px 10px;
}
.rail-links a {
  min-height: clamp(46px, 6vh, 68px);
  color: var(--ink);
  text-decoration: none;
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  font: 700 11px/1 "Space Mono", monospace;
  text-transform: uppercase;
  border-radius: 18px;
  position: relative;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.rail-links a:first-child { border-top: 2px solid transparent; }
.rail-links a:hover {
  background: var(--yellow);
  border-color: var(--line);
  transform: rotate(-2deg);
}
.rail-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 5;
  min-width: max-content;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--line);
  padding: 8px 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-8px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}
.rail-links a:hover .rail-label,
.rail-links a:focus-visible .rail-label {
  opacity: 1;
  transform: translate(0, -50%);
}
.rail-links svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}
.rail-bottom {
  border-top: 2px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.rail-bottom a {
  display: grid;
  place-items: center;
  color: var(--ink);
  text-decoration: none;
  font: 700 12px/1 "Space Mono", monospace;
  border-right: 2px solid var(--line);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: var(--dock-fill);
}
.rail-bottom a:last-child { border-right: 0; }
.page {
  margin-left: calc(var(--rail) + 28px);
}
.wrap {
  width: min(var(--max), calc(92vw - var(--rail) / 2));
  margin: 0 auto;
}
.top-strip {
  min-height: 54px;
  border-bottom: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.top-strip span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.theme-toggle {
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  padding: 8px 10px;
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--line);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.theme-toggle:hover {
  background: var(--yellow);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}
.toggle-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: inset -5px -2px 0 var(--ink);
}
[data-theme="dark"] .toggle-icon {
  background: var(--ink);
  box-shadow: inset 6px 0 0 var(--yellow);
}
.hero {
  min-height: calc(100vh - 54px);
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(280px, 360px);
  gap: 30px;
  align-items: center;
  padding: 34px 0 54px;
}
.hello {
  display: grid;
  gap: 10px;
}
.sentence {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: start;
}
.sentence small {
  padding-top: 14px;
  font: 700 15px/1 "Space Mono", monospace;
  color: var(--red);
}
h1 {
  margin: 0;
  font: 400 clamp(4.4rem, 10vw, 11rem)/.85 Anton, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0;
}
.role {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  font: 400 clamp(2rem, 4.25vw, 4.7rem)/.9 Anton, sans-serif;
  text-transform: uppercase;
}
.word {
  border: 2px solid var(--line);
  padding: 6px 10px 10px;
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--line);
}
.word:nth-child(2) { background: var(--blue); color: #fff; }
.word:nth-child(3) { background: var(--green); color: #fff; }
.word:nth-child(4) { background: var(--red); color: #fff; }
.lede {
  max-width: 600px;
  color: var(--muted);
  font-size: 20px;
  margin: 20px 0 0 84px;
  padding-right: 24px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 0 84px;
}
.btn {
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--line);
  background: var(--card);
  padding: 12px 15px;
  font: 700 13px/1 "Space Mono", monospace;
  box-shadow: 5px 5px 0 var(--line);
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--line);
}
.btn.primary {
  background: var(--red);
  color: #fff;
}
.photo-card {
  border: 2px solid var(--line);
  background: var(--card);
  padding: 10px;
  box-shadow: 10px 10px 0 var(--line);
  justify-self: end;
  transform: rotate(1.5deg);
  width: min(100%, 360px);
}
.photo-card img {
  width: 100%;
  height: auto;
  max-height: min(62vh, 600px);
  object-fit: contain;
  object-position: center top;
  display: block;
}
.section {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 34px;
  padding: 76px 0;
  border-bottom: 2px solid var(--line);
}
.section-title {
  position: sticky;
  top: 24px;
  align-self: start;
}
.section-title small {
  font: 700 14px/1 "Space Mono", monospace;
  color: var(--red);
}
.section-title h2 {
  margin: 10px 0 0;
  font: 400 58px/.9 Anton, sans-serif;
  text-transform: uppercase;
}
.stack {
  display: grid;
  gap: 16px;
}
.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 38px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  position: relative;
}
.timeline-dot {
  width: 78px;
  height: 78px;
  border: 2px solid var(--line);
  background: var(--yellow);
  display: grid;
  place-items: center;
  font: 400 38px/.85 Anton, sans-serif;
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--line);
  z-index: 1;
}
.timeline-card {
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 7px 7px 0 var(--line);
  padding: 18px;
  display: grid;
  gap: 12px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.timeline-card:hover {
  transform: translate(3px, 3px);
  box-shadow: 4px 4px 0 var(--line);
}
.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.timeline-role {
  border: 2px solid var(--line);
  background: var(--green);
  color: #fff;
  padding: 7px 10px;
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.timeline-date {
  color: var(--muted);
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.timeline-card h3 {
  margin: 0;
  font-size: 25px;
}
.timeline-company {
  color: var(--blue);
  font: 700 14px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.timeline-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}
.timeline-highlight {
  border-left: 6px solid var(--red);
  background: var(--dock-fill);
  padding: 12px 14px;
  color: var(--ink);
  font: 700 14px/1.45 "Space Mono", monospace;
}
.case {
  display: grid;
  grid-template-columns: 82px 1fr 150px;
  gap: 18px;
  border: 2px solid var(--line);
  background: var(--card);
  padding: 16px;
  box-shadow: 7px 7px 0 var(--line);
}
.case-num {
  font: 400 58px/.85 Anton, sans-serif;
  color: var(--green);
}
.case h3 {
  margin: 0 0 8px;
  font-size: 24px;
}
.case p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}
.tag {
  justify-self: end;
  align-self: start;
  border: 2px solid var(--line);
  background: var(--yellow);
  padding: 8px 10px;
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.skills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.skill {
  min-height: 112px;
  border: 2px solid var(--line);
  background: var(--card);
  padding: 14px;
  display: grid;
  align-content: end;
  font: 700 17px/1.1 "Space Mono", monospace;
  box-shadow: 5px 5px 0 var(--line);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.project-card {
  min-height: 360px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 7px 7px 0 var(--line);
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.project-card:nth-child(2) {
  transform: rotate(1deg);
}
.project-card:hover {
  transform: translate(3px, 3px);
  box-shadow: 4px 4px 0 var(--line);
  background: var(--dock-fill);
}
.project-card:nth-child(2):hover {
  transform: rotate(1deg) translate(3px, 3px);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.project-tag {
  width: fit-content;
  border: 2px solid var(--line);
  background: var(--green);
  color: #fff;
  padding: 7px 10px;
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.project-index {
  font: 400 58px/.85 Anton, sans-serif;
  color: var(--blue);
}
.project-card h3 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}
.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}
.project-bullets {
  list-style: none;
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
}
.project-bullets li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
}
.project-bullets li::before {
  content: "->";
  color: var(--red);
  font: 700 13px/1.4 "Space Mono", monospace;
}
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-chip {
  border: 2px solid var(--line);
  background: var(--dock-fill);
  color: var(--ink);
  padding: 7px 9px;
  font: 700 12px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
.research-card,
.education-card {
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 7px 7px 0 var(--line);
  padding: 18px;
  display: grid;
  gap: 14px;
}
.research-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.research-card h3,
.education-card h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}
.research-meta,
.education-meta {
  color: var(--blue);
  font: 700 13px/1.35 "Space Mono", monospace;
  text-transform: uppercase;
}
.research-card p,
.education-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}
.research-score {
  width: fit-content;
  border-left: 6px solid var(--red);
  background: var(--dock-fill);
  padding: 10px 14px;
  color: var(--ink);
  font: 700 14px/1.4 "Space Mono", monospace;
  text-transform: uppercase;
}
.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.research-actions a {
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--line);
  background: var(--card);
  padding: 7px 9px;
  font: 700 11px/1 "Space Mono", monospace;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.research-actions a:hover {
  background: var(--dock-fill);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}
.creative-showcase {
  margin: 0;
}
.creative-showcase img {
  width: 100%;
  height: min(74vh, 860px);
  object-fit: contain;
  display: block;
  background: transparent;
}
.cert-list {
  display: grid;
  gap: 16px;
}
.cert-group {
  display: grid;
  gap: 14px;
}
.cert-group.two-col {
  grid-template-columns: repeat(2, 1fr);
}
.cert-group.three-col {
  grid-template-columns: repeat(3, 1fr);
}
.cert-item {
  min-height: 156px;
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 5px 5px 0 var(--line);
  padding: 16px;
  display: grid;
  grid-template-rows: 34px auto 1fr;
  gap: 10px;
  align-items: start;
}
.cert-item h3 {
  margin: 0;
  font-size: 22px;
}
.cert-item p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.cert-label {
  width: 128px;
  height: 34px;
  border: 2px solid var(--line);
  background: var(--green);
  color: #fff;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  font: 700 12px/1 "Space Mono", monospace;
  text-align: center;
  text-transform: uppercase;
}
.contact {
  min-height: 60vh;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 26px;
  align-items: end;
  padding: 80px 0 46px;
}
.contact h2 {
  margin: 0;
  font: 400 clamp(4.2rem, 10vw, 10rem)/.85 Anton, sans-serif;
  text-transform: uppercase;
}
.contact a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding: 12px 0;
  font: 700 14px/1 "Space Mono", monospace;
  text-transform: uppercase;
}
@media (max-width: 980px) {
  :root { --rail: 78px; }
  .side-nav {
    inset: 14px auto 14px 14px;
    grid-template-rows: 70px 1fr 96px;
    box-shadow: 5px 5px 0 var(--line);
  }
  .mark { font-size: 20px; }
  .mark img {
    width: 44px;
    height: 44px;
    box-shadow: 3px 3px 0 var(--line);
  }
  .rail-links { padding: 8px 7px; gap: 6px; }
  .rail-links a { min-height: clamp(42px, 6vh, 60px); font-size: 0; border-radius: 14px; }
  .rail-links svg { width: 25px; height: 25px; }
  .hero, .section, .contact { grid-template-columns: 1fr; }
  .photo-card { transform: none; }
  .timeline::before { left: 34px; }
  .timeline-item { grid-template-columns: 74px 1fr; }
  .timeline-dot {
    width: 70px;
    height: 70px;
    font-size: 34px;
  }
  .case { grid-template-columns: 1fr; }
  .tag { justify-self: start; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
  .cert-group.two-col,
  .cert-group.three-col { grid-template-columns: 1fr; }
  .cert-list { grid-template-columns: 1fr; }
  .research-head { flex-direction: column; }
  .research-actions { justify-content: flex-start; }
  .project-card:nth-child(2) { transform: none; }
  .project-card:nth-child(2):hover { transform: translate(3px, 3px); }
  .section-title { position: static; }
}
@media (max-width: 620px) {
  :root { --rail: 0px; }
  .side-nav {
    inset: auto 12px 12px 12px;
    width: auto;
    height: 70px;
    grid-template-rows: 1fr;
    grid-template-columns: 64px 1fr;
    border: 2px solid var(--line);
    box-shadow: 5px 5px 0 var(--line);
  }
  .mark { border-bottom: 0; border-right: 2px solid var(--line); }
  .rail-links {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-content: stretch;
    padding: 6px;
  }
  .rail-links a {
    min-height: 54px;
    border-top: 0;
    border-bottom: 0;
    border-right: 0;
    border-radius: 12px;
  }
  .rail-label { display: none; }
  .rail-links a:first-child { border-top: 0; }
  .rail-bottom { display: none; }
  .page { margin-left: 0; padding-bottom: 74px; }
  .wrap { width: min(calc(100vw - 40px), var(--max)); }
  .top-strip {
    display: flex;
    min-height: auto;
    padding: 14px 0;
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }
  .hero { padding-top: 34px; min-height: auto; }
  h1 { font-size: 64px; }
  .role {
    flex-wrap: wrap;
    font-size: 38px;
  }
  .sentence { grid-template-columns: 42px 1fr; }
  .lede, .actions { margin-left: 0; }
  .timeline::before { display: none; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline-dot {
    width: fit-content;
    height: auto;
    padding: 8px 12px;
  }
  .photo-card,
  .timeline-card,
  .case,
  .project-card,
  .research-card,
  .education-card,
  .cert-item,
  .skill {
    box-shadow: 4px 4px 0 var(--line);
  }
  .skills, .project-grid, .cert-list { grid-template-columns: 1fr; }
  .cert-group.two-col,
  .cert-group.three-col { grid-template-columns: 1fr; }
}
