:root {
  --bg: #e4e6ec;
  --paper: #f5f6f9;
  --ink: #0a0b12;
  --ink-2: #44485a;
  --blue: #2342ff;
  --violet: #7a3cff;
  --white: #ffffff;
  --cut: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --body: "Chakra Petch", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
svg { display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

/* Outline that follows the cut corners: the element paints the line color,
   ::before paints the fill 1.5px inside it with the same cut. */
.outline { position: relative; isolation: isolate; background: var(--line); }
.outline::before {
  content: ""; position: absolute; inset: 1.5px; z-index: -1;
  background: var(--fill); transition: background 0.2s;
  clip-path: polygon(0 0, calc(100% - var(--cut) + 1px) 0, 100% calc(var(--cut) - 1px), 100% 100%, calc(var(--cut) - 1px) 100%, 0 calc(100% - var(--cut) + 1px));
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1.5px solid var(--ink);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: block; width: 26px; }
.logo svg { width: 100%; height: auto; }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.nav ul a:hover { color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  font-family: var(--body); font-weight: 600; font-size: 14px;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-ghost { --line: var(--ink); --fill: var(--bg); color: var(--ink); }
.btn-ghost:hover { --fill: var(--paper); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg); touch-action: pan-y; }
.hero .lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px;
  padding-top: 72px; padding-bottom: 190px;
}
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 6.4vw, 84px); line-height: 1.04; letter-spacing: 0.01em;
  margin: 0 0 18px;
}
.hero h1 span { display: block; }
.hero h1 .last { color: var(--blue); }
.role { font-size: 15px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 24px; }
.lede { font-size: 19px; max-width: 32em; color: var(--ink-2); margin: 0 0 36px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

.stage { position: relative; min-height: 460px; display: flex; align-items: center; justify-content: center; }
.dmark { width: 100%; max-width: 380px; overflow: visible; }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal="rise"] { transition: opacity 0.6s ease var(--d, 0ms), transform 0.8s var(--ease) var(--d, 0ms); }
.js [data-reveal="rise"]:not(.in) { opacity: 0; transform: translateY(28px); }

.js [data-reveal="shutter"] > * { transition: opacity 0.3s ease calc(var(--d, 0ms) + 0.34s); }
.js [data-reveal="shutter"]:not(.in) > * { opacity: 0; }
[data-reveal="shutter"]::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -48px; right: -48px; z-index: 3;
  background: var(--shutter, var(--ink)); pointer-events: none;
  clip-path: polygon(48px 0, 100% 0, calc(100% - 48px) 100%, 0 100%);
  transform: translateX(-110%);
}
.js [data-reveal="shutter"].in::after { animation: shutter 0.8s cubic-bezier(0.7, 0, 0.2, 1) var(--d, 0ms) both; }
@keyframes shutter {
  0% { transform: translateX(-110%); }
  45%, 55% { transform: translateX(0); }
  100% { transform: translateX(110%); }
}

/* ---------- Section heads ---------- */
section.block { padding: 110px 0 0; position: relative; }
main { position: relative; padding-bottom: 120px; }
.head { display: flex; align-items: center; gap: 18px; margin-bottom: 40px; }
.head .num { font-family: var(--display); font-size: 14px; color: var(--blue); }
.head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3.4vw, 36px); margin: 0; letter-spacing: 0.01em; }
.head .num, .head h2 { transition: transform 0.7s var(--ease), clip-path 0.7s var(--ease); }
.head h2 { transition-delay: 0.08s; }
.js .head:not(.in) .num, .js .head:not(.in) h2 { transform: translateY(70%); clip-path: inset(0 0 100% 0); }
.head .rule {
  flex: 1; height: 12px; position: relative;
  transform-origin: left; transition: transform 1.1s var(--ease) 0.2s;
}
.js .head:not(.in) .rule { transform: scaleX(0); }
.head .rule::before { content: ""; position: absolute; left: 0; right: 14px; top: 50%; height: 1.5px; background: currentColor; }
.head .rule::after {
  content: ""; position: absolute; right: 0; top: 1px; width: 10px; height: 10px;
  background: var(--blue); transform: rotate(45deg);
}

/* ---------- Tracking bar (follows the pointer across a panel) ---------- */
.track { position: relative; }
.track::before {
  content: ""; position: absolute; left: 0; top: 0; height: 6px; z-index: 2;
  width: var(--bar, 64px); max-width: 100%;
  background: var(--bar-c, var(--ink));
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transition: width 0.45s var(--ease);
}
.track { background-image: linear-gradient(var(--bar-c, var(--ink)), var(--bar-c, var(--ink))); background-size: 100% 1px; background-repeat: no-repeat; }

/* ---------- Panels ---------- */
.tag {
  display: inline-block; padding: 4px 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--bg); color: var(--ink);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.work { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.card { background-color: var(--paper); padding: 40px 36px 36px; }
.card.featured { --bar-c: var(--blue); --shutter: var(--blue); }
.card.alt { --bar-c: var(--violet); --shutter: var(--violet); }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.3; margin: 0 0 14px; }
.card p { margin: 0 0 16px; color: var(--ink-2); }
.card .sub { font-weight: 500; color: var(--ink); margin-top: -6px; }
.card ul { margin: 0; padding: 0; list-style: none; }
.card li { position: relative; padding-left: 22px; margin-bottom: 12px; }
.card li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 8px; height: 8px; background: var(--bar-c, var(--ink)); transform: rotate(45deg);
}
.note {
  margin-top: 24px; padding: 14px 16px;
  font-size: 14px; color: var(--ink-2);
  background: var(--bg); border-left: 3px solid var(--blue);
}
.link { display: inline-flex; gap: 8px; margin-top: 20px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 14px; color: var(--violet); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

.timeline { display: grid; gap: 16px; }
.job { display: grid; grid-template-columns: 200px 1fr; gap: 32px; background-color: var(--paper); padding: 34px 32px 30px; }
.job .when { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); font-weight: 600; }
.job h3 { font-family: var(--display); font-weight: 400; font-size: 18px; margin: 0 0 4px; }
.job .org { color: var(--ink-2); margin: 0 0 12px; font-size: 15px; }
.job ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.job li { margin-bottom: 6px; }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill { background-color: var(--paper); padding: 28px 26px 24px; }
.skill h3 { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 10px; font-weight: 600; }
.skill p { margin: 0; color: var(--ink-2); }

.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.edu .card h3 { font-size: 18px; }

/* Spine: a long line bundle down the left gutter, drawn as you scroll */
.spine { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--white); padding: 110px 0; position: relative; overflow: hidden; }
.contact .cl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contact .wrap { position: relative; z-index: 1; }
.contact .head .rule { color: rgba(255, 255, 255, 0.6); }
.contact p { font-size: 19px; color: #c9ccd8; max-width: 30em; margin: 0 0 32px; }
.contact-list { display: grid; gap: 12px; max-width: 520px; }
.contact-list a {
  --line: rgba(255, 255, 255, 0.28); --fill: #151728;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; text-decoration: none;
}
.contact-list a:hover { --line: var(--blue); --fill: #1b1f45; }
.contact-list small { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #a98bff; }

footer { background: var(--ink); color: #9ea3b5; font-size: 13px; letter-spacing: 0.1em; border-top: 1px solid rgba(255, 255, 255, 0.12); }
footer .wrap { padding-top: 22px; padding-bottom: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; padding-bottom: 64px; }
  .stage { order: -1; min-height: 240px; justify-content: flex-start; }
  .dmark { max-width: 170px; }
  .work, .edu { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .job { grid-template-columns: 1fr; gap: 8px; }
  .contact .cl { opacity: 0.35; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav ul { display: none; }
  .skills { grid-template-columns: 1fr; }
  .card { padding: 34px 22px 26px; }
  .job { padding: 30px 22px 24px; }
  section.block { padding-top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.nowrap { white-space: nowrap; }
.btn-sm { padding: 10px 18px; }
