:root {
  --ink: #070d1a;
  --paper: #edf3ff;
  --ember: #62a8ff;
  --muted: #9caac1;
  --line: #ffffff26;
  --display: "Arial Black","Helvetica Neue",Arial,sans-serif;
  --mono: "SFMono-Regular",Consolas,monospace
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: 80px
}

body {
  margin: 0;
  color: var(--paper);
  background: var(--ink);
  font-family: Arial,Helvetica,sans-serif;
  font-size: 16px;
  line-height: 1.6
}

a {
  color: inherit;
  text-decoration: none
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer
}

a,button,summary {
  -webkit-tap-highlight-color: transparent
}

::selection {
  background: var(--ember);
  color: var(--ink)
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 7px
}

.skip {
  position: fixed;
  left: 20px;
  top: -100px;
  z-index: 100;
  background: var(--ember);
  padding: 12px
}

.skip:focus {
  top: 20px
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1
}

header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 20px 4vw;
  background: linear-gradient(var(--ink),#070d1a00)
}

.brand {
  font-size: 45px;
  letter-spacing: -5px;
  font-weight: 900;
  line-height: 1
}

.brand span {
  color: var(--ember)
}

.header-label {
  font: 12px var(--mono);
  letter-spacing: 1.2px
}

.header-label span {
  color: var(--muted);
  margin-left: 14px
}

#motion {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 10px 16px;
  font: 12px var(--mono);
  letter-spacing: 1px
}

#motion span {
  color: var(--ember);
  margin-left: 8px
}

nav {
  position: fixed;
  right: 3vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 22px
}

nav a {
  font: 12px var(--mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  transition: color .3s
}

nav a span {
  font-size: 10px
}

nav a::after {
  content: "";
  height: 1px;
  width: 16px;
  background: #ffffff44;
  transition: width .3s,background .3s
}

nav a.active {
  color: var(--paper)
}

nav a.active::after {
  width: 35px;
  background: var(--ember)
}

nav a:hover {
  color: var(--ember)
}

.chapter {
  position: relative;
  min-height: 100svh;
  padding: 120px 15vw 100px 7vw;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.hero {
  padding-top: 135px;
  padding-bottom: 85px
}

.hero-top,.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 34px
}

.eyebrow,.edition,.hero-footer,.text-link,.facts span,.section-description,.stack-number,.closing-bottom,.profile-actions,footer {
  font-family: var(--mono)
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted)
}

.hero .eyebrow {
  color: var(--ember)
}

.edition {
  font-size: 12px;
  color: var(--muted)
}

h1,h2,h3,p {
  margin: 0
}

h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(48px,9.8vw,154px);
  letter-spacing: -.075em;
  line-height: 1.03;
  position: relative;
  margin-left: -.05em
}

h1>span {
  display: block
}

h1 .outline {
  -webkit-text-stroke: 1px var(--paper);
  color: transparent;
  letter-spacing: -.065em
}

.period {
  color: var(--ember);
  -webkit-text-stroke: 0
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 40px;
  gap: 30px
}

.hero-bottom p {
  font-size: 18px;
  line-height: 1.6
}

.hero-bottom p span {
  color: var(--muted)
}

.text-link {
  font-size: 12px;
  letter-spacing: 1px;
  white-space: nowrap
}

.link-line {
  display: block;
  background: var(--ember);
  height: 2px;
  width: 100%;
  margin-top: 13px;
  transition: transform .3s;
  transform-origin: left
}

.text-link:hover .link-line {
  transform: scaleX(.55)
}

.hero-footer {
  margin-top: 80px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px
}

.hero-footer a {
  display: flex;
  align-items: center;
  gap: 20px
}

.scroll-marker {
  height: 25px;
  width: 14px;
  border: 1px solid #ffffff55;
  border-radius: 10px;
  position: relative
}

.scroll-marker:before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 2px;
  height: 5px;
  background: var(--ember);
  animation: scroll 2s infinite
}

@keyframes scroll {
  to {
    transform: translateY(8px);
    opacity: 0
  }
}

h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px,5.7vw,86px);
  letter-spacing: -.065em;
  line-height: 1.12
}

em {
  color: var(--ember);
  font-style: normal
}

.section-symbol {
  font: 30px var(--mono);
  color: var(--ember)
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7vw;
  align-items: start
}

.large-copy {
  margin-top: 36px;
  font-size: 21px;
  color: var(--muted);
  line-height: 1.65
}

.about-copy {
  padding-top: 8px
}

.about-copy p {
  margin-bottom: 22px;
  color: #c0cce0
}

.facts {
  margin-top: 35px;
  border-top: 1px solid var(--line)
}

.facts>div {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 15px
}

.facts span {
  font-size: 11px;
  color: var(--muted)
}

.facts strong {
  font-size: 14px;
  font-weight: 400;
  text-align: right
}

.section-description {
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px
}

.projects {
  margin-top: 40px;
  border-top: 1px solid var(--line)
}

details {
  border-bottom: 1px solid var(--line)
}

summary {
  list-style: none;
  display: grid;
  grid-template-columns: 36px 1fr auto 24px;
  gap: 16px;
  align-items: center;
  padding: 23px 0;
  cursor: pointer
}

summary::-webkit-details-marker {
  display: none
}

.project-number {
  font: 12px var(--mono);
  color: var(--ember)
}

.project-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.6px
}

.project-title>span {
  display: block;
  font: 10px var(--mono);
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 6px
}

.project-tag {
  font: 10px var(--mono);
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 30px
}

.plus {
  font-size: 25px;
  font-weight: 300;
  transition: transform .25s;
  color: var(--ember)
}

details[open] .plus {
  transform: rotate(45deg)
}

summary:hover .project-title {
  color: var(--ember)
}

.project-detail {
  padding: 0 40px 25px 52px;
  max-width: 780px;
  color: #c0cce0
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px
}

.tags>span {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 5px 12px;
  font: 12px var(--mono);
  color: var(--paper)
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  margin-top: 45px;
  border-top: 1px solid var(--line)
}

.stack-grid article {
  padding: 26px 26px 0 0
}

.stack-grid article+article {
  padding-left: 26px;
  border-left: 1px solid var(--line)
}

.stack-number {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted)
}

h3 {
  font-size: 23px;
  letter-spacing: -.7px;
  margin-top: 22px
}

.stack-grid p {
  color: var(--muted);
  margin-top: 24px;
  max-width: 270px
}

.closing-copy {
  font-size: 19px;
  color: var(--muted);
  margin-top: 30px
}

.profile-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px
}

.profile-actions button, .profile-actions a {
  font: 12px var(--mono);
  letter-spacing: 1px;
  padding: 18px 25px;
  border: 1px solid var(--ember);
  transition: background .3s,color .3s
}

.button-primary {
  background: var(--ember);
  color: var(--ink)
}

.button-primary:hover {
  background: var(--paper);
  border-color: var(--paper)
}

.button-secondary {
  background: transparent
}

.button-secondary:hover {
  background: var(--ember);
  color: var(--ink)
}

.closing-bottom {
  margin-top: 75px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  font-size: 12px
}

.closing-bottom strong {
  display: block;
  letter-spacing: 1px
}

.closing-bottom span {
  display: block;
  color: var(--muted);
  margin-top: 6px
}

.closing-bottom a {
  color: var(--muted);
  font-size: 11px
}

footer {
  position: fixed;
  inset: auto 4vw 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 20px 0;
  color: var(--muted);
  background: linear-gradient(#070d1a00,var(--ink))
}

#chapter-label {
  color: var(--paper);
  min-width: 110px
}

.progress {
  height: 1px;
  width: 150px;
  background: var(--line)
}

.progress span {
  display: block;
  width: 20%;
  height: 1px;
  background: var(--ember);
  transition: width .5s
}

.footer-tip {
  margin-left: auto
}

#position {
  color: var(--paper);
  margin-left: 12px
}

#toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translate(-50%,20px);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 22px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 30
}

#toast.show {
  opacity: 1;
  transform: translate(-50%,0)
}

body.paused .scroll-marker:before {
  animation: none
}

@media(min-width:1500px) {
  .chapter {
    padding-left: 10vw;
    padding-right: 18vw
  }
  h1 {
    font-size: 10vw
  }
}

@media(max-width:900px) {
  .header-label span {
    display: none
  }
  nav {
    right: 2vw
  }
  nav a {
    font-size: 0;
    gap: 8px
  }
  nav a span {
    font-size: 11px
  }
  .chapter {
    padding-left: 6vw;
    padding-right: 12vw
  }
  .hero-bottom {
    align-items: start
  }
  .split {
    gap: 30px
  }
  .stack-grid {
    grid-template-columns: 1fr
  }
  .stack-grid article {
    padding: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 30px
  }
  .stack-grid article+article {
    padding: 20px 0;
    border-left: 0;
    border-top: 1px solid var(--line)
  }
  .stack-number {
    grid-column: 1/-1
  }
  .stack-grid article h3 {
    margin-top: 8px
  }
  .stack-grid article .tags {
    grid-column: 2;
    grid-row: 2/4;
    margin-top: 10px;
    align-content: start
  }
  .stack-grid p {
    margin-top: 10px;
    max-width: 100%
  }
  .project-tag {
    display: none
  }
  summary {
    grid-template-columns: 25px 1fr 20px
  }
  .hero-footer {
    margin-top: 65px
  }
  .edition {
    display: none
  }
}

@media(max-width:600px) {
  html {
    scroll-padding-top: 100px;
    scroll-snap-type: none
  }
  header {
    padding: 20px 6vw
  }
  .brand {
    font-size: 38px
  }
  .header-label {
    font-size: 10px;
    letter-spacing: .4px;
    max-width: 150px
  }
  #motion {
    font-size: 10px;
    padding: 8px 10px
  }
  nav {
    top: 75px;
    right: 6vw;
    left: 6vw;
    transform: none;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px
  }
  nav a {
    font-size: 10px;
    gap: 5px
  }
  nav a span {
    display: none
  }
  nav a::after {
    display: none
  }
  nav a.active {
    color: var(--ember)
  }
  .chapter {
    min-height: 100svh;
    padding: 150px 6vw 90px
  }
  .hero {
    justify-content: center
  }
  .hero-top {
    margin-bottom: 30px
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1.2px
  }
  h1 {
    font-size: clamp(45px,11.8vw,70px);
    letter-spacing: -.065em
  }
  h2 {
    font-size: clamp(42px,11vw,65px)
  }
  .hero-bottom {
    display: block;
    margin-top: 35px
  }
  .hero-bottom p {
    font-size: 16px
  }
  .text-link {
    display: inline-block;
    margin-top: 30px
  }
  .hero-footer {
    font-size: 9px;
    margin-top: 55px
  }
  .hero-footer>span {
    max-width: 130px
  }
  .hero-footer a {
    gap: 10px
  }
  .split {
    grid-template-columns: 1fr
  }
  .large-copy {
    font-size: 19px;
    margin-top: 22px
  }
  .about-copy {
    margin-top: 20px
  }
  .section-symbol {
    font-size: 23px
  }
  .section-top {
    margin-bottom: 28px
  }
  .facts strong {
    font-size: 13px
  }
  .project-title {
    font-size: 20px
  }
  .project-title>span {
    font-size: 9px;
    letter-spacing: .4px
  }
  .project-detail {
    padding-left: 40px;
    padding-right: 0
  }
  .projects {
    margin-top: 28px
  }
  summary {
    padding: 20px 0;
    gap: 10px
  }
  .stack-grid article {
    display: block
  }
  .stack-grid article .tags {
    margin-top: 18px
  }
  .stack-grid p {
    margin-top: 18px
  }
  .profile-actions {
    flex-direction: column;
    align-items: start
  }
  .profile-actions button, .profile-actions a {
    width: 100%
  }
  .closing-copy {
    font-size: 17px
  }
  .desktop {
    display: none
  }
  .closing-bottom {
    margin-top: 48px;
    gap: 15px;
    font-size: 11px
  }
  footer {
    left: 6vw;
    right: 6vw;
    font-size: 9px;
    gap: 12px
  }
  #chapter-label {
    min-width: 90px
  }
  .progress {
    flex: 1;
    width: auto
  }
  .footer-tip {
    display: none
  }
  #position {
    margin-left: 4px
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto
  }
  *,*::before {
    animation: none!important;
    transition: none!important
  }
}

@media print {
  html {
    scroll-snap-type: none
  }
  body {
    background: white;
    color: black;
    font-size: 11pt
  }
  header,nav,footer,canvas,.hero-footer,.profile-actions,.skip,.section-symbol,#toast,.closing-bottom a {
    display: none!important
  }
  .chapter {
    padding: 25px 0;
    min-height: 0;
    break-inside: avoid
  }
  .hero {
    padding-top: 0
  }
  .hero-top {
    margin-bottom: 15px
  }
  h1 {
    font-size: 48px
  }
  h1 .outline {
    color: black;
    -webkit-text-stroke: 0
  }
  h2 {
    font-size: 28px
  }
  em,.period,.hero .eyebrow,.project-number {
    color: #245ea8
  }
  .hero-bottom,.split {
    display: block
  }
  .hero-bottom p,.large-copy,.about-copy p,.closing-copy,.stack-grid p,.section-description {
    color: #333;
    font-size: 11pt
  }
  .text-link {
    display: none
  }
  .large-copy {
    margin: 15px 0
  }
  .facts {
    margin-top: 20px
  }
  .projects {
    margin-top: 20px
  }
  .project-title {
    font-size: 16px
  }
  .project-title>span,.eyebrow,.stack-number,.facts span {
    color: #555
  }
  .project-detail {
    display: block!important;
    padding-bottom: 15px;
    color: #333
  }
  .stack-grid {
    grid-template-columns: repeat(3,1fr);
    margin-top: 20px
  }
  .tags>span {
    color: black;
    border-color: #ccc
  }
  summary {
    padding: 12px 0
  }
  .plus {
    display: none
  }
  .facts>div,details,.stack-grid,.stack-grid article+article {
    border-color: #ccc
  }
  .closing-copy {
    margin-top: 15px
  }
  .closing-bottom {
    margin-top: 20px
  }
}

/* Motion graphics: kinetic typography, staggered reveals, and ambient light. */

body {
  isolation: isolate
}

main {
  position: relative
}

#scene {
  z-index: -1
}

.sr-only {
  position: absolute!important;
  width: 1px!important;
  height: 1px!important;
  padding: 0!important;
  margin: -1px!important;
  overflow: hidden!important;
  clip-path: inset(50%)!important;
  white-space: nowrap!important;
  border: 0!important
}

.kinetic-text {
  display: inline
}

.type-word {
  display: inline-block;
  white-space: nowrap;
  padding-bottom: .12em;
  margin-bottom: -.12em
}

.type-letter {
  display: inline-block;
  transform-origin: 50% 100%
}

.motion-ready:not(.paused) .chapter:not(.in-view) .type-letter {
  opacity: 0;
  transform: translateY(105%) rotate(7deg)
}

.motion-ready:not(.paused) .chapter.in-view .type-letter {
  animation: type-enter .85s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(90ms + var(--letter)*22ms)
}

.motion-ready:not(.paused) .hero.in-view .outline .type-letter {
  animation-delay: calc(260ms + var(--letter)*22ms)
}

.motion-reveal {
  transform-origin: left center
}

.motion-ready:not(.paused) .chapter:not(.in-view) .motion-reveal {
  opacity: 0;
  transform: translateY(26px)
}

.motion-ready:not(.paused) .chapter.in-view .motion-reveal {
  animation: panel-enter .8s cubic-bezier(.16,1,.3,1) var(--delay,150ms) both
}

.chapter.in-view .section-symbol {
  animation: symbol-enter 1.3s cubic-bezier(.16,1,.3,1) both
}

.hero.in-view .outline .kinetic-text {
  animation: ink-light 6s ease-in-out 1.4s infinite
}

.chapter:after {
  content: "";
  position: absolute;
  left: 7vw;
  right: 15vw;
  top: 100px;
  height: 1px;
  background: linear-gradient(90deg,var(--ember),#62a8ff00 65%);
  opacity: .35;
  transform-origin: left
}

.chapter.in-view:after {
  animation: line-enter 1.2s cubic-bezier(.16,1,.3,1) both
}

.hero:after {
  display: none
}

.section-symbol {
  display: inline-block
}

.footer-tip {
  background: transparent;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  padding: 8px 0;
  color: var(--muted)
}

.footer-tip:hover {
  color: var(--ember)
}

nav a.active:after {
  box-shadow: 0 0 15px #62a8ff80
}

.text-link:hover .link-line {
  transform: scaleX(1);
  animation: link-travel .6s cubic-bezier(.16,1,.3,1)
}

summary:hover .plus {
  transform: rotate(90deg)
}

details[open] summary:hover .plus {
  transform: rotate(135deg)
}

.paused *,.paused *:before,.paused *:after {
  animation: none!important
}

.paused .type-letter,.paused .motion-reveal {
  opacity: 1!important;
  transform: none!important
}

.paused .outline .kinetic-text {
  filter: none
}

.paused html {
  scroll-behavior: auto
}

@keyframes type-enter {
  0% {
    opacity: 0;
    transform: translateY(110%) rotate(9deg);
    filter: blur(7px)
  }
  60% {
    opacity: 1;
    filter: blur(0)
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0);
    filter: blur(0)
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(26px)
  }
  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes symbol-enter {
  from {
    opacity: 0;
    transform: rotate(-18deg) scale(.6)
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1)
  }
}

@keyframes line-enter {
  from {
    transform: scaleX(0)
  }
  to {
    transform: scaleX(1)
  }
}

@keyframes ink-light {
  0%,100% {
    filter: drop-shadow(0 0 0 #62a8ff00)
  }
  50% {
    filter: drop-shadow(0 0 14px #62a8ff35)
  }
}

@keyframes link-travel {
  from {
    transform: scaleX(0)
  }
  to {
    transform: scaleX(1)
  }
}

@media(max-width:600px) {
  .chapter:after {
    left: 6vw;
    right: 6vw;
    top: 125px
  }
  .footer-tip {
    display: block;
    font-size: 9px;
    margin-left: auto
  }
  .progress {
    max-width: 50px
  }
  .hero .type-word {
    padding-bottom: .15em;
    margin-bottom: -.15em
  }
}

@media(prefers-reduced-motion:reduce) {
  .type-letter,.motion-reveal {
    opacity: 1!important;
    transform: none!important;
    filter: none!important
  }
  .outline .kinetic-text {
    filter: none!important
  }
}

@media print {
  .type-letter,.motion-reveal {
    opacity: 1!important;
    transform: none!important;
    filter: none!important;
    animation: none!important
  }
  .kinetic-text {
    filter: none!important
  }
  .chapter:after {
    display: none!important
  }
  .type-word {
    padding: 0;
    margin: 0
  }
  .type-letter {
    display: inline
  }
}

/* CV contact details and community recognition. */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 26px;
  font: 12px var(--mono);
}

.contact-links a {
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.contact-links a:hover {
  color: var(--ember);
}

.community-copy {
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

@media print {
  .contact-links, .community-copy {
    color: #333;
    font-size: 10pt;
  }
}

/* Personal AI research shares the existing project disclosure components. */
.research {
  margin-top: 64px;
}

.research-heading h3 {
  font-family: var(--display);
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.2;
  margin-top: 16px;
}

.research-note {
  margin-top: 20px;
  padding-left: 16px;
  border-left: 2px solid var(--ember);
}

.research-note strong {
  font: 10px var(--mono);
  letter-spacing: 1px;
  color: var(--ember);
}

.research-note p {
  margin-top: 8px;
}

@media print {
  .research {
    margin-top: 25px;
    break-inside: auto;
  }
  .research-heading h3 {
    font-size: 22px;
  }
  .research-note strong {
    color: #245ea8;
  }
}

/* AI projects lead the Work chapter; mobile experience provides context. */
.work > .research {
  margin-top: 36px;
}

.engineering-background {
  margin-top: 64px;
}

@media print {
  .engineering-background {
    margin-top: 25px;
  }
}
