:root {
  /* Palette */
  --bg:        #eaf2f6;
  --bg-soft:   #d8e6ee;
  --ink:       #1a2348;
  --ink-soft:  #4a5478;
  --paper:     #ffffff;
  --accent:    #6e2bd9;
  --accent-2:  #8a4ef0;
  --teal:      #6dc8d4;
  --teal-soft: #a8dde4;
  --rule:      rgba(26, 35, 72, 0.14);

  --display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif:   'Fraunces', 'Times New Roman', Times, serif;
  --sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --maxw:    1320px;
  --pad-x:   clamp(1.25rem, 4vw, 4rem);
  --edge-pad: 70px;

  /* Type */
  --t-mega:   clamp(2.6rem, 7.5vw, 6.5rem);
  --t-h2:     clamp(2.5rem, 6vw, 5rem);
  --t-h2sm:   clamp(2rem, 4vw, 3.5rem);
  --t-h3:     clamp(1.75rem, 3vw, 2.6rem);
  --t-lede:   clamp(1.05rem, 1.4vw, 1.2rem);
  --t-body:   1.0625rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  padding-left: max(var(--pad-x), var(--edge-pad));
}

.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  background: var(--ink); color: var(--bg);
  padding: .75rem 1rem; border-radius: 4px;
  z-index: 999;
}
.skip-link:focus { top: 1rem; }

.dot { color: var(--teal); font-weight: inherit; }

/* ============== HEADER ============== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 3vw, 3rem);
  background: transparent;
  transition: background-color .3s ease, backdrop-filter .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(234, 242, 246, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: var(--accent);
  flex: 0 0 auto;
}
.logo-mark { width: 56px; height: 38px; }
.logo-divider {
  display: inline-block;
  width: 1px; height: 22px;
  background: currentColor;
  opacity: 0.35;
}

.site-nav {
  display: flex;
  flex: 1;
  justify-content: center;
}
.site-nav ul {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2.25rem);
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav a {
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: .35rem 0;
  color: var(--ink);
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -3px; height: 2px;
  background: var(--accent);
  transition: right .35s cubic-bezier(.65,.05,.36,1);
}
.site-nav a:hover { color: var(--accent); }
.site-nav a:hover::after { right: 0; }

.hire-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem 0;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.hire-bubble {
  width: 32px; height: 32px;
  color: var(--accent);
  transition: transform .3s ease;
}
.hire-btn:hover .hire-bubble { transform: rotate(-8deg) scale(1.05); }

/* ============== EDGE MARKERS (left rail) ============== */
.edge-markers {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: var(--edge-pad);
  z-index: 50;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 1.5rem;
  gap: 1rem;
}
.edge-copyright {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  font-weight: 500;
  font-family: var(--display);
  text-transform: uppercase;
}
.edge-rule {
  display: block;
  width: 1px; height: 60px;
  background: var(--ink-soft);
  opacity: 0.4;
}

/* ============== STRIPED BUTTON ============== */
.btn-striped {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: color .3s ease, transform .3s ease;
  background: transparent;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(110, 43, 217, 0.10) 0 6px,
    transparent 6px 12px
  );
  margin-top: 1.5rem;
}
.btn-striped span { position: relative; z-index: 2; }
.btn-striped::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform .4s cubic-bezier(.65,.05,.36,1);
  z-index: 1;
}
.btn-striped:hover { color: #fff; }
.btn-striped:hover::before { transform: translateY(0); }

/* ============== HERO ============== */
.hero {
  min-height: 100vh;
  padding: 7rem 0 3rem;
  padding-left: var(--edge-pad);
  padding-right: clamp(1.25rem, 3vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
  padding-left: clamp(1rem, 2vw, 2rem);
  position: relative;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2rem, 4vw, 4rem);
  }
}

/* ----- Diagonal stripe band ----- */
.hero-stripes {
  position: absolute;
  left: 0;
  right: 40%;
  top: 45%;
  height: 50%;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--teal-soft) 0 2px,
    transparent 2px 12px
  );
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000 78%, transparent 100%);
          mask-image: linear-gradient(to right, #000 78%, transparent 100%);
}
@media (max-width: 900px) {
  .hero-stripes {
    top: 42%;
    height: 38%;
  }
}

.hero-text {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-mega);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}
.hero-title .line { display: block; }
.hero-title .line--prelude {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.02em;
}
.word-start { font-weight: 200; }

.hero-title .name-row {
  display: inline-flex;
  align-items: flex-end;   /* baseline-ish alignment with the square */
  gap: 0.45em;
  margin-top: 0.2em;
}
.hero-title .emphasised {
  font-family: var(--display);
  font-weight: 800;
  font-style: normal;
  letter-spacing: -0.025em;
  display: inline-block;
}

/* Portrait slot on the right */
.hero-portrait {
  position: relative;
  z-index: 2;
  aspect-ratio: 4 / 5;
  max-width: 450px;
  width: 100%;
  margin-left: auto;
  margin-top: -2rem;
  align-self: start;
}
.portrait-frame {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 0 0 2px var(--accent) inset;
}
.portrait-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ----- Hero foot row -----
   Below the name+portrait grid:
     [ dot + SCROLL stack ]   [ I'm a software engineer... ]
*/
.hero-foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: clamp(2rem, 4vw, 4rem);
  margin-top: clamp(2rem, 5vh, 4rem);
  padding-left: clamp(1rem, 2vw, 2rem);
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.hero-foot-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.foot-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
}

.foot-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.foot-scroll-letters { display: flex; flex-direction: column; font-weight: 500; }
.foot-scroll-letters span { display: block; line-height: 1.3; }
.foot-scroll-line {
  display: block;
  width: 1px; height: 56px;
  background: var(--ink-soft);
  opacity: 0.5;
  position: relative;
  overflow: hidden;
}
.foot-scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: scrollDown 2s cubic-bezier(.65,.05,.36,1) infinite;
}
@keyframes scrollDown {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

.hero-sub {
  margin: 0;
  max-width: 42ch;
  font-size: var(--t-lede);
  color: var(--ink);
  line-height: 1.55;
  align-self: start;
  padding-bottom: 0.5rem;
}
.hero-sub strong { font-weight: 700; }

/* ============== SECTION TITLES ============== */
.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-h2);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.section-title.small { font-size: var(--t-h2sm); }

.title-rule {
  display: block;
  width: 80px;
  height: 3px;
  background: var(--teal);
  border-radius: 999px;
  margin: 1.5rem 0 2.5rem;
}

.eyebrow {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
.eyebrow--soft { color: var(--ink-soft); }

.section-lede {
  max-width: 60ch;
  font-size: var(--t-lede);
  color: var(--ink);
  margin: 0 0 3rem;
  line-height: 1.55;
}

/* ============== TOGETHER ============== */
.together {
  padding: clamp(6rem, 14vh, 12rem) 0;
}
.together-body {
  max-width: 60ch;
  font-size: var(--t-lede);
  color: var(--ink);
  margin: 0;
  line-height: 1.6;
}
.together-body strong { font-weight: 700; }

/* ============== EXPERIENCE ============== */
.experience { padding: clamp(4rem, 10vh, 8rem) 0; }

.exp-list {
  list-style: none;
  margin: 3rem 0 0; padding: 0;
}
.exp-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.exp-item:last-child { border-bottom: 1px solid var(--rule); }

@media (min-width: 760px) {
  .exp-item {
    grid-template-columns: 240px 1fr;
    gap: 3rem;
  }
}
.exp-meta { display: flex; flex-direction: column; gap: .35rem; }
.exp-company {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.exp-date {
  font-family: var(--display);
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}
.exp-tag-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 0.15rem;
}
.exp-badge {
  display: inline-block;
  width: fit-content;
  padding: 0.2rem 0.6rem;
  background: var(--teal);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 3px;
  margin-top: 0.4rem;
}

.exp-item--upcoming {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(109, 200, 212, 0.10) 0 2px,
    transparent 2px 12px
  );
  border-radius: 8px;
  padding: 2.5rem clamp(1rem, 2vw, 2rem);
  margin: 0 calc(-1 * clamp(1rem, 2vw, 2rem));
  border: 1px solid rgba(109, 200, 212, 0.4);
  border-top: 1px solid rgba(109, 200, 212, 0.4);
}
.exp-item--upcoming + .exp-item { border-top: 1px solid var(--rule); }

.exp-body h3 {
  margin: 0 0 .9rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.exp-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  max-width: 62ch;
}
.exp-body strong { font-weight: 700; }

.exp-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1.25rem 0 0;
  padding: 0;
}
.exp-tags li {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 3px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  letter-spacing: 0.05em;
}

/* ============== OPEN SOURCE / PROJECTS ============== */
.open-source { padding: clamp(6rem, 14vh, 12rem) 0; }

.projects {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.project {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}

/* ============== PUBLICATIONS ============== */
.publications { padding: clamp(4rem, 10vh, 8rem) 0; }

.pub-list {
  list-style: none;
  margin: 3rem 0 0; padding: 0;
}
.pub-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}
.pub-item:last-child { border-bottom: 1px solid var(--rule); }

@media (min-width: 760px) {
  .pub-item {
    grid-template-columns: 240px 1fr;
    gap: 3rem;
  }
}

.pub-meta { display: flex; flex-direction: column; gap: .35rem; }
.pub-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.pub-venue {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ink);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.pub-date {
  font-family: var(--display);
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.pub-body .pub-title {
  margin: 0 0 .55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.pub-authors {
  margin: 0 0 1rem;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.pub-desc {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  max-width: 62ch;
}

/* ============== COURSES ============== */
.courses { padding: clamp(4rem, 10vh, 8rem) 0; }

.courses-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  margin-bottom: 6rem;
}
.course-school {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 760px) {
  .course-school {
    grid-template-columns: 280px 1fr;
    gap: 3rem;
  }
}
.course-school-meta h3 {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.course-school-meta p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  font-family: var(--display);
  letter-spacing: 0.04em;
}
.course-list {
  list-style: none;
  margin: 0; padding: 0;
  border-top: 1px solid var(--rule);
}
.course-list li {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  transition: padding .3s ease, color .3s ease;
}
.course-list li:hover {
  padding-left: .75rem;
  color: var(--accent);
}
.course-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}
.course-list li:hover .course-num { color: var(--accent); }

.class-projects {
  margin-top: 6rem;
  padding-top: 4rem;
  border-top: 2px dashed rgba(109, 200, 212, 0.55);
}
.class-projects-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-h2sm);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 3rem;
  color: var(--ink);
}

.class-project-list {
  list-style: none;
  margin: 0; padding: 0;
}
.class-project {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--rule);
}
.class-project:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) {
  .class-project {
    grid-template-columns: 240px 1fr;
    gap: 3rem;
  }
}
.cp-meta { display: flex; flex-direction: column; gap: .3rem; }
.cp-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.cp-school {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.cp-date {
  font-family: var(--display);
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cp-body h4 {
  margin: 0 0 .8rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cp-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  max-width: 62ch;
}
.cp-body strong { font-weight: 700; }

/* ============== FOOTER ============== */
.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-mark {
  margin: 0;
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-weight: 500;
}
.footer-social {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0; padding: 0;
}
.footer-social a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color .25s ease;
}
.footer-social a:hover { color: var(--accent); }

/* ============== ANIMATION SETUP ============== */
.js-loading .hero-title .word,
.js-loading .hero-portrait,
.js-loading .hero-stripes,
.js-loading .name-square {
  opacity: 0;
}
.js-loading .hero-title .word { transform: translateY(40px); }
.js-loading .hero-portrait { transform: translateX(40px); }
.js-loading .hero-sub,
.js-loading .hero-foot-marker {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .foot-scroll-line::after { display: none; }
}

/* ============== MOBILE TWEAKS ============== */
@media (max-width: 760px) {
  :root { --edge-pad: 30px; }
  .edge-copyright { font-size: 0.62rem; letter-spacing: 0.1em; }
  .hero { padding-top: 6rem; }
  .hero-portrait {
    max-width: 280px;
    margin: 0 auto;
    margin-top: 0;
  }
  .hire-btn span { display: none; }
  .site-nav a { font-size: 0.72rem; letter-spacing: 0.1em; }
  .site-nav ul { gap: 0.85rem; }
  .footer-social { gap: 1rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Stack the foot row vertically on small screens */
  .hero-foot {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .hero-foot-marker {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
  .foot-scroll-line { height: 1px; width: 56px; }
}