:root {
  /* Change the whole look here. */
  --bg: #0a0c11;
  --card: #14161d;
  --raised: #1d2029;
  --line: rgb(255 255 255 / 8%);
  --line-strong: rgb(255 255 255 / 16%);
  --fill: rgb(255 255 255 / 4%);
  --hover: rgb(255 255 255 / 7%);
  --hover-strong: rgb(255 255 255 / 10%);
  --side-bg: rgb(14 16 22 / 92%);

  --text: #f3f4f6;
  --text-2: #a6abb8;
  --muted: #7c8190;

  /* Chart and accent colours. Checked with the dataviz validator against the
     card colour: all pass for dark mode and colour blindness. */
  --blue: #3470ff;
  --blue-soft: #6f98ff;
  --orange: #e5600e;
  --cyan: #0e9fbb;
  --purple: #a855f7;
  --magenta: #e8489a;
  --yellow: #bd880a;

  /* Reserved for gains and losses only. */
  --gain: #3ddc84;
  --loss: #e5484d;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 50% -10%, rgb(47 107 255 / 18%), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--blue-soft);
  outline-offset: 3px;
}

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

/* Brand */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, rgb(47 107 255 / 35%), rgb(255 122 26 / 25%));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.btn:hover {
  background: #4a80ff;
  box-shadow: 0 6px 24px rgb(47 107 255 / 35%);
}

.btn.ghost {
  border-color: var(--line-strong);
  background: var(--fill);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--hover-strong);
  box-shadow: none;
}

/* Public top bar */

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item {
  position: relative;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-button:hover,
.nav-button[aria-expanded="true"] {
  background: rgb(255 255 255 / 6%);
  color: var(--text);
}

.caret {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease), margin 0.3s var(--ease);
}

.nav-button[aria-expanded="true"] .caret {
  margin-top: 3px;
  transform: rotate(225deg);
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  max-height: 70vh;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: 0 24px 60px rgb(0 0 0 / 55%);
  list-style: none;
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.25s var(--ease), visibility 0s linear 0.25s;
}

.menu.open {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

.menu-link,
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.menu-link:hover {
  background: rgb(255 255 255 / 7%);
}

.menu-item {
  color: var(--muted);
}

.menu-note {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 7%);
  color: var(--muted);
  font-size: 11px;
}

/* Home */

.home {
  overflow-x: hidden;
}

.hero {
  position: relative;
  z-index: 5;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) var(--gutter) 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--blue-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.grad {
  background: linear-gradient(100deg, #6f98ff 0%, #c084fc 48%, #ff8a3d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 480px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.stage {
  position: relative;
  max-width: 1100px;
  height: clamp(320px, 60vw, 620px);
  margin: -40px auto 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent);
  mask-image: linear-gradient(to bottom, #000 84%, transparent);
}

#globe {
  position: absolute;
  left: 50%;
  top: 8%;
  width: min(820px, 120%);
  aspect-ratio: 1;
  transform: translateX(-50%);
  opacity: 0.9;
}

.mock {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(860px, 94%);
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgb(14 16 22 / 92%);
  box-shadow: 0 40px 100px rgb(0 0 0 / 60%), 0 0 0 1px rgb(47 107 255 / 12%);
  transform: translateX(-50%) perspective(1400px) rotateX(18deg);
  transform-origin: 50% 100%;
}

.mock-body {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}

.mock-side {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 8px;
  background: var(--card);
}

.mock-side i {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: rgb(255 255 255 / 9%);
}

.mock-side i:first-child {
  width: 70%;
  background: var(--blue);
}

.mock-side i:nth-child(3) {
  width: 80%;
}

.mock-side i:nth-child(5) {
  width: 60%;
}

.mock-main {
  display: grid;
  gap: 10px;
}

.mock-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mock-card {
  height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.mock-card i {
  display: block;
  height: 6px;
  width: 40%;
  border-radius: 3px;
  background: rgb(255 255 255 / 12%);
}

.mock-card i + i {
  width: 70%;
  height: 12px;
  margin-top: 10px;
  background: rgb(255 255 255 / 22%);
}

.mock-card:nth-child(1) i + i {
  background: var(--blue);
}

.mock-card:nth-child(2) i + i {
  background: var(--orange);
}

.mock-card:nth-child(3) i + i {
  background: var(--cyan);
}

.mock-card:nth-child(4) i + i {
  background: var(--purple);
}

.mock-charts {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}

.mock-chart {
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.mock-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.footer-note {
  position: relative;
  z-index: 5;
  padding: 24px var(--gutter) 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Login */

.center-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
}

.gate-wrap {
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
}

.gate-card {
  width: min(380px, 100%);
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgb(20 22 29 / 88%);
  box-shadow: 0 30px 80px rgb(0 0 0 / 50%);
  backdrop-filter: blur(12px);
}

.gate-card .brand-mark {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  font-size: 15px;
}

.gate-card h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.gate-card .sub {
  margin: 6px 0 24px;
  color: var(--text-2);
}

.login {
  display: grid;
  gap: 12px;
}

.login input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.login input::placeholder {
  color: var(--muted);
}

.login input:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(47 107 255 / 25%);
}

.login-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--orange);
  font-size: 13px;
}

.login-message:empty {
  display: none;
}

@media (max-width: 760px) {
  .brand-word {
    display: none;
  }

  .mock-body {
    grid-template-columns: 1fr;
  }

  .mock-side {
    display: none;
  }

  .mock-charts {
    grid-template-columns: 1fr;
  }

  .mock-chart:last-child {
    display: none;
  }

  .mock-card {
    height: 48px;
  }
}

/* Load motion */

.hero,
.stage {
  animation: rise 0.8s var(--ease) both;
}

.stage {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

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

/* AI showcase (public home) */

.nav-anchor {
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

.stage {
  height: clamp(320px, 46vw, 470px);
}

.term {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: min(660px, 92%);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgb(12 14 19 / 94%);
  box-shadow: 0 40px 100px rgb(0 0 0 / 60%), 0 0 0 1px rgb(52 112 255 / 14%);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
  text-align: left;
  transform: translateX(-50%) perspective(1400px) rotateX(6deg);
  transform-origin: 50% 100%;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 3%);
}

.term-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(255 255 255 / 16%);
}

.term-bar i:nth-child(1) { background: var(--orange); }
.term-bar i:nth-child(2) { background: var(--yellow); }
.term-bar i:nth-child(3) { background: var(--cyan); }

.term-bar span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.term-body {
  padding: 16px 18px 18px;
}

.term-prompt {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.6;
}

.term-prompt b {
  color: var(--blue-soft);
}

.term-body ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: var(--text-2);
  list-style: none;
}

.term-body li::before {
  content: "✓";
  margin-right: 10px;
  color: var(--cyan);
}

.term-body li {
  animation: rise 0.5s var(--ease) both;
}

.term-body li:nth-child(1) { animation-delay: 0.9s; }
.term-body li:nth-child(2) { animation-delay: 1.7s; }
.term-body li:nth-child(3) { animation-delay: 2.5s; }
.term-body li:nth-child(4) { animation-delay: 3.3s; }
.term-body li:nth-child(5) { animation-delay: 4.1s; color: var(--text); }

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) var(--gutter) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-head .eyebrow {
  margin-bottom: 12px;
}

.section h2 {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: border-color 0.3s ease, transform 0.4s var(--ease);
}

.work-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.art {
  height: 170px;
  border-bottom: 1px solid var(--line);
}

.art-1 {
  background:
    radial-gradient(circle at 50% 42%, #f4f6fb 0, #aab3c7 9%, #3a4256 30%, transparent 46%),
    radial-gradient(420px 220px at 50% 110%, rgb(52 112 255 / 55%), transparent 70%),
    #0c0e14;
}

.art-2 {
  background:
    radial-gradient(circle, rgb(232 72 154 / 70%) 1.5px, transparent 2px) 0 0 / 16px 16px,
    radial-gradient(260px 170px at 70% 30%, rgb(168 85 247 / 45%), transparent 70%),
    #0c0e14;
}

.art-3 {
  background:
    linear-gradient(115deg, transparent 40%, rgb(229 96 14 / 40%) 70%, transparent 71%),
    linear-gradient(135deg, rgb(52 112 255 / 55%), rgb(14 159 187 / 35%) 55%, transparent 80%),
    #0c0e14;
}

.work-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
}

.work-status {
  margin: 0 0 8px;
  color: var(--blue-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-body h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.work-body p:not(.work-status) {
  margin: 0 0 18px;
  color: var(--text-2);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 12px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(180px 110px at 100% 0, color-mix(in srgb, var(--tone) 22%, transparent), transparent 70%),
    var(--card);
  transition: border-color 0.3s ease;
}

.skill:hover {
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
}

.skill:nth-child(1) { --tone: var(--blue); }
.skill:nth-child(2) { --tone: var(--purple); }
.skill:nth-child(3) { --tone: var(--magenta); }
.skill:nth-child(4) { --tone: var(--cyan); }
.skill:nth-child(5) { --tone: var(--orange); }
.skill:nth-child(6) { --tone: var(--yellow); }

.skill h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.skill p {
  margin: 0;
  color: var(--text-2);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-step {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.process-step span {
  display: block;
  margin-bottom: 14px;
  background: linear-gradient(100deg, var(--blue-soft), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.process-step h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.process-step p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

.cta {
  text-align: center;
}

.cta p {
  margin: 12px 0 22px;
  color: var(--text-2);
}

.footer-note {
  margin-top: clamp(56px, 9vw, 104px);
}

#mark {
  user-select: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.8s var(--ease);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  .work-grid,
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav-anchor {
    display: none;
  }

  .work-grid,
  .skills-grid,
  .process-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .term {
    font-size: 12px;
  }

  .stage {
    height: clamp(300px, 78vw, 380px);
  }
}

@media (max-width: 640px) {
  .stage {
    margin-top: 24px;
  }
}

/* Minimal landing: a name, a colour, one button */

.landing {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: calc(100svh - 150px);
  padding: 0 var(--gutter);
  text-align: center;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(620px 420px at 18% 32%, rgb(52 112 255 / 38%), transparent 70%),
    radial-gradient(520px 420px at 82% 38%, rgb(168 85 247 / 30%), transparent 70%),
    radial-gradient(560px 380px at 55% 88%, rgb(229 96 14 / 26%), transparent 70%);
  filter: blur(24px);
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(2%, 2%, 0) scale(1.08);
  }
}

.landing #globe {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(940px, 140vw);
  transform: translate(-50%, -50%);
  opacity: 0.5;
  pointer-events: none;
}

.name {
  margin: 0;
  font-size: clamp(46px, 12vw, 152px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  animation: rise 0.9s var(--ease) both;
}

.name .grad {
  background: linear-gradient(100deg, #6f98ff 0%, #c084fc 38%, #ff8a3d 70%, #6f98ff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s linear infinite;
}

@keyframes sheen {
  to {
    background-position: -200% 0;
  }
}

.hero-pick {
  position: relative;
  margin-top: clamp(24px, 4vw, 40px);
  animation: rise 0.9s 0.15s var(--ease) both;
}

.btn.big {
  padding: 13px 30px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 10px 40px rgb(52 112 255 / 40%);
}

.hero-menu {
  top: calc(100% + 12px);
  right: auto;
  left: 50%;
  text-align: left;
  transform: translate(-50%, -6px);
}

.hero-menu.open {
  transform: translate(-50%, 0);
}

.footer-note {
  margin-top: 0;
}