/* theme: 1990s hong kong neon signage — hot orange-red lettering, mint tube borders, yellow small print */
:root {
  color-scheme: dark;
  --bg: #0a0c0d;
  --panel: #101415;
  --ink: #f3ece2;
  --muted: #9ba39f;
  --line: #232a2b;
  --red: #ff5433;
  --green: #4dffb0;
  --yellow: #ffe45c;
  --blue: #8fe9ff;
  --maroon: #a8162e;
  --font: "Tilt Neon", "Trebuchet MS", system-ui, sans-serif;
  --glow-red: 0 0 4px rgba(255, 84, 51, 0.9), 0 0 14px rgba(255, 60, 30, 0.75), 0 0 34px rgba(255, 50, 20, 0.45);
  --glow-green: 0 0 4px rgba(77, 255, 176, 0.8), 0 0 14px rgba(77, 255, 176, 0.45);
  --glow-yellow: 0 0 4px rgba(255, 228, 92, 0.8), 0 0 12px rgba(255, 210, 60, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(46rem 22rem at 50% 6rem, rgba(255, 70, 40, 0.10), transparent 70%),
    radial-gradient(40rem 24rem at 12% 2rem, rgba(60, 220, 190, 0.06), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: #fff; }

a { color: inherit; text-decoration: none; }
p, ul, ol, h1, h2 { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; }

:focus-visible { outline: 1px solid var(--green); outline-offset: 4px; }

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

.wrap { max-width: 750px; margin: 0 auto; padding: 0 24px; }

/* ── header ── */
.site-header { padding: 56px 0 32px; text-align: center; }

/* graffiti pieces sit back, like part of the wall */
.mark { display: block; width: min(400px, 86%); margin: 0 auto 22px; }
.piece { display: block; width: 100%; height: auto; }

/* the name is a neon sign: a dark backing panel screwed to the wall, a mint glass tube
   around the edge, and hot orange-red lettering standing a little off the panel */
.sign {
  --screw: #6b7573 0 1.2px, #171c1b 1.6px 2.8px, transparent 3.2px;
  position: relative; display: inline-block; max-width: 100%;
  padding: 11px;
  border: 1px solid #1d2423; border-radius: 16px;
  background:
    radial-gradient(circle at 9px 9px, var(--screw)),
    radial-gradient(circle at calc(100% - 9px) 9px, var(--screw)),
    radial-gradient(circle at 9px calc(100% - 9px), var(--screw)),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--screw)),
    linear-gradient(172deg, rgba(255, 255, 255, 0.055), transparent 38%),
    radial-gradient(ellipse at 50% 55%, rgba(255, 70, 40, 0.16), transparent 70%),
    #0b0f0f;
  box-shadow:
    0 0 70px rgba(255, 60, 30, 0.13), 0 0 40px rgba(77, 255, 176, 0.07),
    0 14px 26px -12px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.tube {
  position: relative;
  padding: 12px 28px;
  border: 3px solid #dffff1; border-radius: 12px;
  box-shadow:
    0 0 3px #8dffcd, 0 0 9px rgba(77, 255, 176, 0.95), 0 0 26px rgba(77, 255, 176, 0.4),
    inset 0 0 3px #8dffcd, inset 0 0 9px rgba(77, 255, 176, 0.8), inset 0 0 30px rgba(77, 255, 176, 0.12);
}
/* metal clips holding the tube to the panel */
.tube::before {
  content: ""; position: absolute; inset: -7px; pointer-events: none;
  background: linear-gradient(90deg, #5c6664, #d5dedb 45%, #6f7a77) no-repeat;
  background-size: 5px 11px;
  background-position: 22% 0, 78% 0, 22% 100%, 78% 100%;
  background-image:
    linear-gradient(90deg, #5c6664, #d5dedb 45%, #6f7a77), linear-gradient(90deg, #5c6664, #d5dedb 45%, #6f7a77),
    linear-gradient(90deg, #5c6664, #d5dedb 45%, #6f7a77), linear-gradient(90deg, #5c6664, #d5dedb 45%, #6f7a77);
  background-repeat: no-repeat;
}
/* where the tube starts and ends: two blackened electrode caps with a gap between them */
.tube::after {
  content: ""; position: absolute; left: 34px; bottom: -6px; width: 30px; height: 9px; border-radius: 2px;
  background: linear-gradient(90deg, #2b3231 0 7px, #0b0f0f 7px 23px, #2b3231 23px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#site-name {
  position: relative;
  font-size: clamp(1.9rem, 7.2vw, 3.5rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #fff4ee;
  /* white-hot core, coloured gas, wide spill, then the tube's shadow on the panel behind it */
  text-shadow:
    0 0 1px #fff, 0 0 3px #ffc2b0, 0 0 7px rgba(255, 96, 60, 0.95),
    0 0 16px rgba(255, 60, 30, 0.8), 0 0 38px rgba(255, 50, 20, 0.5), 0 0 70px rgba(255, 50, 20, 0.25),
    0 7px 5px rgba(0, 0, 0, 0.55);
}
#site-name .ghost { visibility: hidden; }
#site-name .typed { position: absolute; left: 0; top: 0; }
.sign.lit #site-name { animation: flicker 9s linear 2s infinite; }
/* one tired letter that buzzes and drops out now and then */
#site-name .dud { animation: dud 13s linear 4s infinite; }
@keyframes dud {
  0%, 60%, 61.2%, 62.4%, 66%, 100% { color: inherit; text-shadow: inherit; opacity: 1; }
  60.4%, 61.8% { color: #6b3a30; text-shadow: 0 7px 5px rgba(0, 0, 0, 0.55); opacity: 0.85; }
  62.8%, 65.4% { color: #6b3a30; text-shadow: 0 0 6px rgba(255, 60, 30, 0.25), 0 7px 5px rgba(0, 0, 0, 0.55); opacity: 0.9; }
}

#tw-cursor {
  display: inline-block; width: 0.08em; height: 0.85em; margin-left: 4px; vertical-align: -0.08em;
  background: var(--yellow); box-shadow: var(--glow-yellow);
  animation: blink 0.8s step-end infinite;
}
#tw-cursor.done { animation: none; opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }

.sub {
  margin: 14px 0 30px;
  color: var(--yellow); text-shadow: var(--glow-yellow);
  font-size: 13px; letter-spacing: 0.42em; text-indent: 0.42em;
  opacity: 0;
}
.sub.show { opacity: 1; animation: strike 0.9s linear; }

/* a tube struggling to start, then holding */
@keyframes strike {
  0% { opacity: 0; } 12% { opacity: 1; } 20% { opacity: 0.15; } 34% { opacity: 1; }
  42% { opacity: 0.3; } 55%, 100% { opacity: 1; }
}
/* an old sign dipping now and then */
@keyframes flicker {
  0%, 91%, 93.5%, 96%, 100% { opacity: 1; }
  92% { opacity: 0.55; } 95% { opacity: 0.75; }
}

#site-nav {
  display: flex; justify-content: center; gap: clamp(20px, 6vw, 48px);
  margin-bottom: 32px;
  opacity: 0; transition: opacity 0.5s ease;
}
#site-nav.show { opacity: 1; }

.nav-btn {
  position: relative; padding: 2px 0;
  background: none; border: 0; cursor: pointer;
  color: var(--ink); font: inherit; letter-spacing: 0.06em; text-transform: lowercase;
  opacity: 0.5; transition: opacity 0.2s, color 0.2s, text-shadow 0.2s;
}
.nav-btn:hover { opacity: 0.95; text-shadow: 0 0 10px rgba(255, 255, 255, 0.45); }
.nav-btn.active { opacity: 1; color: #ffe1d6; text-shadow: var(--glow-red); }
.nav-btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: var(--green); box-shadow: var(--glow-green);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(.65, 0, .35, 1);
}
.nav-btn.active::after { transform: scaleX(1); }
#site-nav:not(.show) .nav-btn::after { transform: scaleX(0); }

.rule { height: 1px; background: var(--line); }
#site-divider, #site-content { opacity: 0; transition: opacity 0.5s ease; }
#site-divider.show, #site-content.show { opacity: 1; }

/* ── pages ── */
main { min-height: 50vh; padding-top: 40px; text-align: left; }

.page { transition: opacity 0.28s cubic-bezier(.4, 0, .2, 1), transform 0.28s cubic-bezier(.4, 0, .2, 1); }
.page-hidden { display: none; }
.page-exit { opacity: 0; transform: translateY(-5px); }
.page-enter { opacity: 0; transform: translateY(6px); }

.fade-item { opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s ease; }
.fade-item.visible { opacity: 1; transform: none; }

.lede { font-size: 18px; margin-bottom: 60px; }

section { margin-bottom: 56px; }

h2 {
  margin-bottom: 20px;
  color: var(--yellow); text-shadow: var(--glow-yellow);
  font-size: 13px; font-weight: 400; letter-spacing: 0.24em;
}

.dots li { display: flex; gap: 14px; align-items: flex-start; }
.dots li + li { margin-top: 10px; }
.dots li::before {
  content: ""; flex: none; width: 5px; height: 5px; margin-top: 0.68em; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red), 0 0 12px rgba(255, 84, 51, 0.6);
}

.num { color: var(--green); text-shadow: var(--glow-green); font-variant-numeric: tabular-nums; }
.unit { text-transform: none; }

.ilink { border-bottom: 1px dotted rgba(77, 255, 176, 0.7); transition: color 0.2s, border-color 0.2s, text-shadow 0.2s; }
.ilink:hover { color: var(--yellow); border-color: var(--yellow); text-shadow: var(--glow-yellow); }

.icons { display: flex; align-items: center; gap: 36px; }
.icons a { opacity: 0.7; transition: opacity 0.2s, color 0.2s, filter 0.2s; }
.icons a:hover { opacity: 1; color: var(--green); filter: drop-shadow(0 0 6px rgba(77, 255, 176, 0.8)); }

/* ── experience: a timeline of tubes that light up ── */
.xps { position: relative; padding-left: 26px; }
.xps::before {
  content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: var(--line);
}

.xp { --c: var(--red); --g: rgba(255, 84, 51, 0.55); position: relative; }
.xp:nth-child(4n + 2) { --c: var(--green); --g: rgba(77, 255, 176, 0.5); }
.xp:nth-child(4n + 3) { --c: var(--yellow); --g: rgba(255, 228, 92, 0.5); }
.xp:nth-child(4n + 4) { --c: var(--blue); --g: rgba(143, 233, 255, 0.5); }
.xp + .xp { margin-top: 10px; }

/* node on the timeline */
.xp::before {
  content: ""; position: absolute; left: -27px; top: 24px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s;
}
.xp:hover::before, .xp.open::before {
  border-color: var(--c); background: var(--c);
  box-shadow: 0 0 6px var(--c), 0 0 18px var(--g);
  transform: scale(1.15);
}

.xp-head {
  display: grid; grid-template-columns: 104px 1fr 18px; gap: 18px; align-items: start;
  width: 100%; padding: 16px 16px 16px 14px;
  background: none; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; text-align: left; text-transform: lowercase;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s;
}
.xp:hover .xp-head { transform: translateX(4px); background: rgba(255, 255, 255, 0.02); }
.xp.open .xp-head, .xp:hover .xp-head {
  border-color: var(--c);
  box-shadow: 0 0 5px var(--g), inset 0 0 14px -6px var(--g);
}
.xp.open .xp-head { border-bottom-color: transparent; border-radius: 10px 10px 0 0; box-shadow: none; }

.xp-main { display: block; }
.xp-main .t { display: block; transition: text-shadow 0.25s; }
.xp-main .d { display: block; }
.xp .at { color: var(--c); }
.xp:hover .at, .xp.open .at { text-shadow: 0 0 8px var(--g); }
.xp:hover .xp-main .t { animation: strike 0.5s linear; }

.yr { color: var(--muted); font-size: 13px; padding-top: 3px; white-space: nowrap; }
.d { margin-top: 3px; color: var(--muted); font-size: 14px; }

.live {
  display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%;
  background: var(--green); box-shadow: var(--glow-green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

.chev { position: relative; width: 14px; height: 14px; margin-top: 6px; }
.chev::before, .chev::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px;
  background: var(--muted); transition: transform 0.3s, background 0.25s, box-shadow 0.25s;
}
.chev::after { transform: rotate(90deg); }
.xp:hover .chev::before, .xp:hover .chev::after, .xp.open .chev::before, .xp.open .chev::after {
  background: var(--c); box-shadow: 0 0 6px var(--c);
}
.xp.open .chev::after { transform: rotate(0deg); }

.xp-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s cubic-bezier(.4, 0, .2, 1); }
.xp.open .xp-body { grid-template-rows: 1fr; }
.xp-inner { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0.35s; }
.xp.open .xp-inner {
  visibility: visible;
  padding: 4px 16px 18px 136px;
  border: 1px solid var(--c); border-top: 0; border-radius: 0 0 10px 10px;
}
.xp-inner .dots { font-size: 14px; }
.xp-inner .dots li::before { background: var(--c); box-shadow: 0 0 6px var(--c); }
.xp-inner .ilink { display: inline-block; margin-top: 14px; font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span {
  padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 12px;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.tags span:hover { border-color: var(--c); color: var(--ink); box-shadow: 0 0 8px var(--g); }

/* ── plain rows (education) ── */
.row {
  display: grid; grid-template-columns: 116px 1fr; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  transition: border-color 0.2s;
}
.row:first-child { padding-top: 0; }
.row:hover { border-color: rgba(77, 255, 176, 0.6); }

/* ── project cards ── */
.grid { display: grid; grid-template-columns: 1fr; gap: 48px 32px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

.viz { position: relative; display: block; aspect-ratio: 1 / 1; margin-bottom: 12px; }
.card .t { font-size: 15px; }
.card .y { margin-left: 12px; color: var(--muted); }

.win {
  position: absolute; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.win img, .win svg, .tile img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .win {
  border-color: var(--green);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 6px rgba(77, 255, 176, 0.7), 0 0 24px rgba(77, 255, 176, 0.2);
}
.card:hover .win + .win, .card:hover .win.photo {
  border-color: var(--red); transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 6px rgba(255, 84, 51, 0.7), 0 0 24px rgba(255, 84, 51, 0.25);
}

.tile {
  position: absolute; aspect-ratio: 1 / 1; overflow: hidden; z-index: 2;
  border-radius: 24%; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.chip {
  position: absolute; z-index: 2; display: flex; flex-direction: column;
  padding: 8px 12px;
  background: rgba(10, 12, 13, 0.92);
  border: 1px solid var(--line); border-left: 2px solid var(--red); border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-size: 12px; color: var(--muted);
}
.chip b { color: var(--yellow); text-shadow: var(--glow-yellow); font-size: 21px; font-weight: 400; line-height: 1.2; }

.out {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; transition: color 0.2s;
}
.card:hover .out { color: var(--green); }

.intent { z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; font-size: 13px; }
.intent .k { color: var(--muted); font-size: 10px; letter-spacing: 0.2em; }
.intent .v i { color: var(--red); font-style: normal; }
.intent .bar { height: 3px; margin-top: 4px; background: var(--line); }
.intent .bar span { display: block; width: 92%; height: 100%; background: var(--red); box-shadow: 0 0 8px var(--red); }

/* card visuals animate on hover (always on for touch screens) */
.scroll { animation: scroll 7s linear infinite; }
@keyframes scroll { to { transform: translateX(-400px); } }

.rings ellipse { opacity: 0.16; animation: ring 2.6s ease-in-out infinite; }
.rings ellipse:nth-child(1) { opacity: 0.8; }
.rings ellipse:nth-child(2) { opacity: 0.55; animation-delay: 0.2s; }
.rings ellipse:nth-child(3) { opacity: 0.38; animation-delay: 0.4s; }
.rings ellipse:nth-child(4) { opacity: 0.25; animation-delay: 0.6s; }
.rings ellipse:nth-child(5) { animation-delay: 0.8s; }
@keyframes ring { 30% { opacity: 1; stroke-width: 2; } }

.ping { transform-box: fill-box; transform-origin: center; animation: ping 2.6s ease-out infinite; }
@keyframes ping { to { transform: scale(5); opacity: 0; } }

.scroll, .rings ellipse, .ping { animation-play-state: paused; }
.card:hover .scroll, .card:hover .rings ellipse, .card:hover .ping { animation-play-state: running; }
@media (hover: none) {
  .scroll, .rings ellipse, .ping { animation-play-state: running; }
}

/* spray-painted tag on the top-left corner of milo's top window */
.spray {
  position: absolute; left: 9%; top: -3%; z-index: 3; width: 44%; height: auto;
  transform: rotate(-5deg); opacity: 0.88; pointer-events: none;
}

/* ── contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 32px; align-items: start; }
.brain { rotate: 3deg; }
.brain.visible { opacity: 1; }

/* ── footer ── */
footer { margin-top: 96px; padding-bottom: 48px; }
footer p { margin-top: 40px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 560px) {
  .site-header { padding-top: 40px; }
  .sign { padding: 9px; }
  .tube { padding: 10px 16px; }
  .sub { letter-spacing: 0.3em; text-indent: 0.3em; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .contact-grid { grid-template-columns: 1fr; }
  .brain { max-width: 280px; margin: 0 auto; }
  .xp-head { grid-template-columns: 1fr 18px; gap: 4px 12px; }
  .xp-head .yr { grid-column: 1 / -1; }
  .xp.open .xp-inner { padding-left: 14px; }
}

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