/* ============================================================
   Mawardi Rosli: quiet grid, light Plex Sans throughout; numbered
   headings with a muted second half. The loud thing is the hero
   halftone ink in the hero; experience sits in tinted bands.
   ============================================================ */

@font-face {
  font-family: "Plex Sans";
  src: url("../vendor/fonts/plex-sans-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("../vendor/fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("../vendor/fonts/plex-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../vendor/fonts/newsreader-300-italic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f1f2f3;
  --ink: #17181b;
  --muted: #64676d;
  --line: #d6d8db;
  --accent: #2f45e3;
  --stage: #15161a;
  --card: #1c1d22;
  --card-ink: #e9eaee;
  --card-muted: #9a9da5;
  --tint-1: #ccd2f4;
  --tint-2: #c3d6d3;
  --tint-3: #ddd5c9;
  --band-ink: #17181b;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111214;
    --ink: #e6e7ea;
    --muted: #8e9198;
    --line: #2a2c30;
    --accent: #8f9dff;
    --stage: #1b1d21;
    --card: #1b1d21;
    --tint-1: #2b304f;
    --tint-2: #233533;
    --tint-3: #37322b;
    --band-ink: #e6e7ea;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111214;
  --ink: #e6e7ea;
  --muted: #8e9198;
  --line: #2a2c30;
  --accent: #8f9dff;
  --stage: #1b1d21;
  --card: #1b1d21;
  --tint-1: #2b304f;
  --tint-2: #233533;
  --tint-3: #37322b;
  --band-ink: #e6e7ea;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--line);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Layout: 12 columns, headings full width, content from column 5 --- */

.hero,
.section,
.footer {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 20px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main {
  padding-top: 68px;
}

/* Fixed bar; after scrolling it tucks into a floating pill. */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 22px var(--gutter);
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 0.875rem;
  transition: max-width 0.7s var(--ease-out), padding 0.7s var(--ease-out), top 0.7s var(--ease-out),
    border-radius 0.7s var(--ease-out), background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.topbar.is-pill {
  top: 12px;
  max-width: min(760px, calc(100% - 24px));
  padding: 12px 22px;
  border-radius: 999px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark,
.intro-mark {
  height: auto;
  fill: currentColor;
}
.brand-mark {
  width: 30px;
}
.nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  align-items: baseline;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
}
.nav a:hover {
  color: var(--ink);
}
.theme-toggle {
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--ink);
}

/* ---- Hero: greeting beside a framed portrait, halftone ink behind ---- */

.hero-ink {
  position: relative;
  overflow: hidden;
}
.fluid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.intro {
  position: relative;
  min-height: calc(100svh - 68px);
  align-content: center;
  align-items: center;
  row-gap: 40px;
  padding-block: 40px 96px;
  pointer-events: none; /* the ink under the words keeps following the pointer */
}
.intro-text {
  grid-column: 1 / 8;
  display: grid;
  row-gap: 20px;
}
.intro-name {
  font-size: 0.875rem;
  color: var(--muted);
}
.intro-words {
  display: grid;
  gap: 0.15em;
  font-weight: 300;
}
.intro-side {
  font-size: clamp(2.5rem, 5.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.intro-side.is-right {
  min-height: 1.15em; /* holds the line while phrases swap */
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--accent);
}

/* The portrait sits in a paper mat with an offset hairline frame behind it. */.portrait {
  grid-column: 9 / 13;
  position: relative;
  margin: 0;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  /* Paper-filled copy over an accent copy, both offset: a 1px frame outline behind the mat. */
  box-shadow: 14px 14px 0 -1px var(--paper), 14px 14px 0 0 var(--accent), 0 24px 48px -24px rgba(0, 0, 0, 0.25);
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.motion .portrait {
  animation: frame-in 1.2s var(--ease-out) 0.2s both;
}
.motion .portrait img {
  animation: photo-in 1.4s var(--ease-out) 0.35s both;
}
.motion .intro.is-wait .portrait,
.motion .intro.is-wait .portrait img {
  animation-play-state: paused;
}
@keyframes frame-in {
  from {
    opacity: 0;
    transform: translateY(32px) rotate(1.5deg);
  }
}
@keyframes photo-in {
  from {
    clip-path: inset(100% 0 0 0);
    transform: scale(1.12);
  }
}

/* Each phrase rises in (1s, expo out), holds, then rises out (0.5s, ease in). */
.cycle .w {
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.motion .cycle .w > span {
  display: inline-block;
  animation: rise-in 1s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 100ms) both;
}
.motion .cycle.is-out .w > span {
  animation: rise-out 0.5s cubic-bezier(0.32, 0, 0.67, 0) calc(var(--i) * 50ms) both;
}
@keyframes rise-in {
  from {
    transform: translateY(105%);
  }
}
@keyframes rise-out {
  to {
    transform: translateY(-105%);
  }
}

/* Intro screen: flashes, the name, a paper wipe, then the name flies to the header. */
html.is-intro {
  overflow: hidden;
}
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
}
.intro-screen.is-clear {
  background: transparent;
  transition: background-color 0.3s ease;
  pointer-events: none;
}
.intro-flash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.intro-flash svg,
.intro-mark {
  width: clamp(220px, 34vw, 460px);
}
.intro-flash svg {
  overflow: visible;
  fill: #fff;
  filter: url(#intro-rough);
}
.intro-flash svg.is-outline {
  fill: none;
  stroke: #fff;
  stroke-width: 22;
}
/* Inverted frames: black type on white, like a photocopy flipped. */
.intro-screen.is-inv {
  background: #fff;
}
.is-inv .intro-flash svg {
  fill: #000;
  stroke: #000;
}
.is-inv .intro-flash svg.is-outline {
  fill: none;
}
.intro-fx {
  position: absolute;
  width: 0;
  height: 0;
}
.intro-grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.is-clear .intro-grain {
  opacity: 0;
}
.intro-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  opacity: 0;
}
.intro-wipe {
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform: translateY(-100%);
  transition: opacity 0.6s ease;
}
.is-clear .intro-wipe {
  opacity: 0;
}

/* About: a lead paragraph, then the facts. */
.about-copy {
  max-width: 34em;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
}
.about-copy + .about-copy {
  margin-top: 1em;
  color: var(--muted);
}
#about .facts {
  margin-top: clamp(40px, 6vh, 64px);
}

.facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 20px;
  padding-top: 14px;
  font-size: 0.875rem;
  line-height: 1.45;
}
.facts > div {
  grid-column: span 4;
}
.facts > div:first-child {
  grid-column: 1 / 5;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  max-width: 32ch;
}

/* ---- Sections --------------------------------------------------------- */

.section {
  padding-block: clamp(56px, 10vh, 112px);
}

/* Hairlines are pseudo-elements so they can draw in from the left. */
.section,
.facts,
.footer {
  position: relative;
}
.section::before,
.facts::before,
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
  transform-origin: left;
}
.facts::before {
  left: 0;
  right: 0;
}

/* Headings: a numbered label (a CSS counter, so hidden sections never leave a gap),
   then one light sans statement with its second half in the muted grey. */
main {
  counter-reset: section;
}
.section-title {
  grid-column: 1 / -1;
  margin-bottom: clamp(40px, 7vh, 72px);
  font-size: clamp(2.25rem, 4.4vw, 3.75rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.section-title::before {
  counter-increment: section;
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.t-sub {
  color: var(--muted);
}

.section-body {
  grid-column: 5 / 13;
  min-width: 0;
}
.section.is-wide .section-body {
  grid-column: 1 / -1;
}

h3 {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Work: an asymmetric two-up grid. Each card is a dark media frame holding the
   live demo (it presses in a few pixels on hover), then a caption on the page. */
.cards {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(56px, 9vh, 96px) 20px;
}
.card {
  grid-column: span 6;
  scroll-margin-top: 96px;
}
.card:nth-child(3n + 1) {
  grid-column: 1 / 8;
}
.card:nth-child(3n + 2) {
  grid-column: 8 / 13;
}
.card:nth-child(3n) {
  grid-column: 4 / 13;
}
.card-media {
  padding: clamp(10px, 1.6vw, 20px);
  border-radius: 14px;
  background: var(--card);
  color: var(--card-ink);
  clip-path: inset(0 round 14px);
  transition: clip-path 0.5s var(--ease-out);
}
.card-media:hover {
  clip-path: inset(6px round 10px);
}
.card-media .demo {
  border: 0;
  background: none;
}
.card-info {
  --card-ink: var(--ink);
  --card-muted: var(--muted);
  margin-top: 14px;
}
.card-cap {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.card-cap span {
  color: var(--muted);
}
.card-body {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  font-size: 0.9375rem;
}
.card dt {
  margin-bottom: 4px;
  font-size: 0.8125rem;
  color: var(--card-muted);
}
.card dd {
  max-width: 42ch;
}

/* Experience: full-bleed tinted bands that open in place. */
.bands {
  overflow: hidden;
  border-radius: 20px;
}
.band {
  background: var(--tint);
  color: var(--band-ink);
}
.band h3 {
  font: inherit;
  letter-spacing: normal;
}
.band-row {
  width: 100%;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 13rem 7rem 44px;
  align-items: center;
  gap: 16px;
  padding: 26px 28px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.band-row:focus-visible {
  outline-offset: -6px;
}
.band-n,
.band-org,
.band-date {
  font-size: 0.8125rem;
}
.band-role {
  font-size: clamp(1.5rem, 3.2vw, 2.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  transition: transform 0.5s var(--ease-out);
}
.band-row:hover .band-role {
  transform: translateX(8px);
}
.band-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition: transform 0.5s var(--ease-out);
}
.band-toggle::before,
.band-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.band-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.band.is-open .band-toggle {
  transform: rotate(45deg);
}
.band-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-out);
}
.band.is-open .band-panel {
  grid-template-rows: 1fr;
}
.band-panel > div {
  overflow: hidden;
}
.band-panel ul {
  max-width: calc(64ch + 28px + 5rem);
  padding: 0 28px 30px calc(28px + 5rem);
  font-size: 1rem;
}
.band-panel li + li {
  margin-top: 10px;
}

/* Certifications and publications */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.entry:last-child {
  border-bottom: 1px solid var(--line);
}
.entry-title {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
}
.entry-detail {
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.entry-year {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Interests */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.interests li {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Capabilities */
.capabilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
}
.capabilities dt {
  color: var(--ink);
  font-size: 1rem;
}
.capabilities dd {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 40ch;
}
.stack {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  max-width: 64ch;
}
.stack span {
  color: var(--muted);
}

/* Contact */
.exploring {
  margin-bottom: 56px;
}
.exploring-label,
.message label > span {
  font-size: 0.875rem;
  color: var(--muted);
}
.exploring-label {
  margin-bottom: 14px;
}
.contact-copy {
  max-width: 52ch;
  color: var(--muted);
}

/* Message form: underlined fields, the accent line marks focus. */
.message {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
  max-width: 720px;
  margin-top: 40px;
}
.message label {
  display: grid;
  gap: 6px;
}
.message-body,
.message-foot {
  grid-column: 1 / -1;
}
.message input,
.message textarea {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.message input:focus-visible,
.message textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}
.message .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}
.message-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.magnet.is-solid {
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}
.magnet.is-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.magnet.is-solid:disabled {
  opacity: 0.6;
  cursor: progress;
}
.message-status {
  font-size: 0.9375rem;
  color: var(--muted);
}
.links {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  font-size: 1.125rem;
}

/* Footer */
.footer {
  padding-block: 28px 36px;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer span {
  grid-column: 1 / 5;
}
.footer a {
  grid-column: 5 / 13;
  text-decoration: none;
}

/* ---- Motion -----------------------------------------------------------
   Only active under html.motion (set by app.js when reduced motion is off).
   Load: the statement rises out of its masks and the header drops in. Scroll: titles rise line by line, blocks lift,
   hairlines draw. Timings follow the reference: ~1s, power3-like ease. */

.motion .intro-name {
  animation: fade 1.1s ease 0.3s both;
}
.motion .topbar {
  animation: drop 1.2s var(--ease-out) 1.2s both;
}

.w {
  display: inline-block;
  vertical-align: top;
}
.motion [data-reveal="lines"] .w {
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.motion [data-reveal="lines"] .w > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: calc(var(--l, 0) * 70ms + var(--i, 0) * 12ms);
}
.motion [data-reveal="lines"][data-in] .w > span {
  transform: none;
}

.motion .intro.is-wait .w > span {
  transform: translateY(105%);
  animation: none;
}

.motion [data-reveal="up"] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.motion [data-reveal="up"][data-in] {
  opacity: 1;
  transform: none;
}

.motion [data-reveal="rule"]::before {
  transform: scaleX(0);
  transition: transform 1.5s var(--ease-out);
}
.motion [data-reveal="rule"][data-in]::before {
  transform: scaleX(1);
}

/* Section handoff: as a section scrolls away it settles back (fades, drifts up, shrinks a
   touch) while the next one rises over it. Native scroll-driven animation; browsers
   without animation-timeline just scroll. */
@supports (animation-timeline: view()) {
  .motion .section {
    animation: section-out linear both;
    animation-timeline: view();
    animation-range: exit 25% exit 100%;
  }
}
@keyframes section-out {
  to {
    opacity: 0.2;
    transform: translateY(-48px) scale(0.97);
  }
}

/* Nav curtain (useSectionJump): parked below the viewport until a jump. */
.jump {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding-inline: var(--gutter);
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  transform: translateY(100%);
  pointer-events: none;
}
.jump-n {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.6;
}
.jump-t {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---- Small screens ---------------------------------------------------- */

@media (max-width: 760px) {
  .hero,
  .section,
  .footer,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  main {
    padding-top: 92px;
  }
  .topbar {
    flex-wrap: wrap;
    row-gap: 10px;
    padding-block: 18px;
  }
  .nav {
    justify-content: flex-start;
    gap: 20px;
  }
  /* The pill keeps the mark and drops the name, so the links still fit on one row. */
  .topbar.is-pill {
    gap: 14px;
    padding-inline: 16px;
  }
  .topbar.is-pill .brand-name {
    display: none;
  }
  .topbar.is-pill .nav {
    gap: 0;
    justify-content: space-between;
  }
  .topbar.is-pill .theme-toggle {
    margin-left: 0;
  }
  .intro {
    min-height: calc(100svh - 92px);
    row-gap: 32px;
  }
  .intro-text {
    grid-column: 1 / -1;
  }
  .portrait {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(220px, 58%);
  }
  .section-body,
  .footer span,
  .footer a {
    grid-column: 1 / -1;
  }
  .facts {
    row-gap: 14px;
  }
  .facts > div,
  .facts > div:first-child {
    grid-column: 1 / -1;
  }
  .message {
    grid-template-columns: minmax(0, 1fr);
  }
  .capabilities {
    grid-template-columns: 1fr;
  }
  .band-row {
    grid-template-columns: 2.25rem minmax(0, 1fr) 40px;
    row-gap: 4px;
    padding-block: 22px;
  }
  .band-n {
    grid-row: 1;
  }
  .band-role {
    grid-column: 2;
    grid-row: 1;
  }
  .band-org,
  .band-date {
    grid-column: 2;
  }
  .band-toggle {
    grid-column: 3;
    grid-row: 1 / span 3;
  }
  .band-row {
    padding-inline: 20px;
  }
  .band-panel ul {
    padding: 0 20px 26px calc(20px + 2.25rem + 16px);
  }
  .footer {
    row-gap: 6px;
  }
}

[tabindex="-1"]:focus {
  outline: none;
}

/* ==== Playful layer: project demos, certificate frame, logos, per-section motion ==== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Project cards: copy left, live demo right ------------------------ */

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}
.card-stack li {
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--card-ink) 18%, transparent);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--card-muted);
}
.card-repo {
  display: inline-block;
  margin-top: 22px;
  font-size: 0.9375rem;
  text-decoration-color: color-mix(in srgb, var(--card-ink) 35%, transparent);
}

.demo {
  --demo-accent: #93a1ff;
  align-self: start;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--card-ink) 10%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card-ink) 4%, transparent);
  font-size: 0.8125rem;
}
.demo-label {
  color: var(--card-muted);
}
.demo-note {
  font-size: 0.75rem;
  color: var(--card-muted);
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg button {
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--card-ink) 18%, transparent);
  border-radius: 999px;
  background: none;
  color: var(--card-ink);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-out);
}
.seg button:hover {
  transform: translateY(-2px);
}
.seg button.is-on {
  border-color: var(--demo-accent);
  background: var(--demo-accent);
  color: #111214;
}

/* RAG */
.rag-q {
  min-height: 2.6em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.3;
}
.filings {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}
.filings li {
  display: grid;
  padding: 6px 6px 5px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--card-ink) 6%, transparent);
  font-size: 0.625rem;
  line-height: 1.25;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.4s var(--ease-out), opacity 0.3s ease;
}
.filings li b {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filings li span {
  color: var(--card-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.motion .rag[data-step="1"] .filings li {
  animation: scan-tile 0.9s ease calc(var(--i) * 40ms) both;
}
.rag[data-step="2"] .filings li:not(.is-hit),
.rag[data-step="3"] .filings li:not(.is-hit),
.rag[data-step="4"] .filings li:not(.is-hit) {
  opacity: 0.45;
}
.filings li.is-hit {
  background: var(--demo-accent);
  color: #111214;
  transform: scale(1.08);
}
.filings li.is-hit span {
  color: #111214;
}
@keyframes scan-tile {
  40% {
    background: color-mix(in srgb, var(--demo-accent) 45%, transparent);
  }
}
.rag-out {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.chunks {
  display: grid;
  gap: 4px;
  align-content: center;
}
.chunks i {
  height: 10px;
  border-radius: 3px;
  background: var(--demo-accent);
  opacity: 0;
  transform: translateX(-24px) scaleX(0.4);
  transition: opacity 0.4s ease calc(var(--k) * 90ms), transform 0.5s var(--ease-out) calc(var(--k) * 90ms);
}
.rag[data-step="3"] .chunks i,
.rag[data-step="4"] .chunks i {
  opacity: 0.85;
  transform: none;
}
.answer {
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-ink) 7%, transparent);
  font-size: 0.875rem;
  line-height: 1.45;
}
.answer p {
  animation: fade 0.6s ease both;
}
.answer .dim {
  color: var(--card-muted);
}
.cite {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--demo-accent);
  color: #111214;
  font-size: 0.6875rem;
}
.bars {
  display: grid;
  gap: 6px;
}
.bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
}
.bar span {
  color: var(--card-muted);
}
.bar i {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--demo-accent) calc(var(--v) * 100%), color-mix(in srgb, var(--card-ink) 8%, transparent) 0);
  transition: background 0.6s var(--ease-out);
}
.bar b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Road */
.road-svg {
  display: block;
  width: 100%;
  height: auto;
}
.asphalt {
  fill: #2b2d33;
}
.edge {
  stroke: #e9eaee;
  stroke-width: 3;
  opacity: 0.55;
}
.lane {
  stroke: #ffd166;
  stroke-width: 3;
  stroke-dasharray: 18 16;
  opacity: 0.6;
}
.shadow {
  fill: #000;
  opacity: 0.35;
}
.crack {
  fill: none;
  stroke: #0e0f12;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pothole {
  fill: #18191d;
  stroke: #3d4047;
  stroke-width: 2;
}
.pothole-in {
  fill: #0e0f12;
}
.scan {
  fill: var(--demo-accent);
  opacity: 0;
}
.motion .road.is-seen .scan {
  animation: scan 3.2s ease-in-out infinite;
}
@keyframes scan {
  0% {
    transform: translateY(0);
    opacity: 0.9;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(297px);
    opacity: 0;
  }
}
.box {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}
.box.is-on {
  opacity: 1;
  transform: none;
}
.motion .road:not(.is-seen) .box {
  opacity: 0;
}
.road.is-seen .box.is-on {
  transition-delay: calc(var(--i) * 0.25s + 0.3s);
}
.box rect {
  fill: none;
  stroke: var(--c);
  stroke-width: 2;
}
.box .tag {
  fill: var(--c);
  stroke: none;
}
.box text {
  fill: #111214;
  font: 600 10px var(--sans);
}
.classes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.classes button {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--card-ink) 14%, transparent);
  border-radius: 10px;
  background: none;
  color: var(--card-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}
.classes button:hover {
  transform: translateY(-2px);
}
.classes button[aria-pressed="false"] {
  opacity: 0.4;
}
.classes i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
  grid-row: span 2;
}
.classes b {
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--card-muted);
}
.thr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  color: var(--card-muted);
}
.thr input {
  accent-color: var(--demo-accent);
  width: 100%;
}
.thr b {
  color: var(--card-ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.metrics div {
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-ink) 6%, transparent);
}
.metrics dt {
  font-size: 0.6875rem;
  color: var(--card-muted);
}
.metrics dd {
  font-size: 1.125rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

/* Site versions */
.browser {
  overflow: hidden;
  border-radius: 12px;
  background: #0e0f12;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 0.6875rem;
  color: var(--card-muted);
}
.browser-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3c42;
}
.browser-bar span {
  margin-left: 8px;
}
.mock {
  display: grid;
  gap: 10px;
  height: 220px;
  padding: 14px;
  background: var(--bg);
  animation: mock-in 0.6s var(--ease-out) both;
}
@keyframes mock-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
.m-nav {
  height: 8px;
  width: 40%;
  border-radius: 4px;
  background: var(--ink);
  opacity: 0.8;
}
.m-hero,
.m-row {
  display: grid;
  gap: 8px;
}
.m-hero i,
.m-row i {
  border-radius: 6px;
  background: var(--b);
}
.m-hero i:first-child {
  background: var(--ink);
}
.m-hero i:nth-child(2) {
  background: var(--a);
}
/* Each layout gets a rough sketch of how that version was arranged. */
.mock-cards .m-hero {
  grid-template-columns: 1fr;
}
.mock-cards .m-hero i {
  height: 14px;
}
.mock-cards .m-hero i:first-child {
  height: 30px;
  width: 70%;
}
.mock-cards .m-row {
  grid-template-columns: repeat(3, 1fr);
}
.mock-cards .m-row i {
  height: 80px;
  background: #fff;
  border: 2px solid var(--a);
}
.mock-split .m-hero {
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 46px 46px;
}
.mock-split .m-hero i:last-child {
  grid-row: span 2;
  grid-column: 2;
  grid-row-start: 1;
}
.mock-split .m-row {
  grid-template-columns: 1fr 1fr;
}
.mock-split .m-row i {
  height: 50px;
}
.mock-split .m-row i:last-child {
  display: none;
}
.mock-editorial .m-hero {
  grid-template-columns: 1fr;
}
.mock-editorial .m-hero i:first-child {
  height: 54px;
}
.mock-editorial .m-hero i:nth-child(2) {
  height: 4px;
}
.mock-editorial .m-hero i:last-child {
  display: none;
}
.mock-editorial .m-row {
  grid-template-columns: repeat(3, 1fr);
}
.mock-editorial .m-row i {
  height: 90px;
  border-radius: 0;
  border-top: 2px solid var(--ink);
}
.mock-console .m-hero {
  grid-template-columns: 1fr 1.1fr;
}
.mock-console .m-hero i:first-child {
  height: 30px;
  align-self: end;
}
.mock-console .m-hero i:nth-child(2) {
  height: 100px;
  grid-column: 2;
  grid-row: span 2;
  background: var(--b);
  border: 2px solid var(--a);
}
.mock-console .m-hero i:last-child {
  height: 30px;
  background: var(--a);
  opacity: 0.4;
}
.mock-console .m-row {
  grid-template-columns: repeat(3, 1fr);
}
.mock-console .m-row i {
  height: 46px;
}
.mock-stage .m-hero {
  grid-template-columns: 1fr;
  height: 130px;
  position: relative;
  border-radius: 8px;
  background: var(--b);
  padding: 12px;
  align-content: end;
}
.mock-stage .m-hero i:first-child {
  height: 12px;
  width: 50%;
  background: #e9eaee;
}
.mock-stage .m-hero i:nth-child(2) {
  height: 12px;
  width: 36%;
}
.mock-stage .m-hero i:last-child {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px dashed #e9eaee;
  background: none;
  opacity: 0.5;
}
.mock-stage .m-row {
  grid-template-columns: repeat(3, 1fr);
}
.mock-stage .m-row i {
  height: 36px;
  background: #d6d8db;
}
.mock-playful .m-hero {
  grid-template-columns: 1fr 1fr;
}
.mock-playful .m-hero i {
  height: 60px;
  border-radius: 14px;
}
.mock-playful .m-hero i:first-child {
  background: #15161a;
}
.mock-playful .m-hero i:last-child {
  grid-column: span 2;
  height: 14px;
  background: var(--a);
  width: 60%;
}
.mock-playful .m-row {
  grid-template-columns: repeat(3, 1fr);
}
.mock-playful .m-row i {
  height: 40px;
  border-radius: 999px;
}
.mock-playful .m-row i:nth-child(2) {
  background: #c3d6d3;
}
.mock-playful .m-row i:nth-child(3) {
  background: #ddd5c9;
}
.versions {
  display: grid;
  gap: 2px;
}
.versions button {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--card-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.versions button:hover,
.versions button[aria-current] {
  background: color-mix(in srgb, var(--card-ink) 7%, transparent);
  color: var(--card-ink);
}
.versions i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.versions small {
  font-size: 0.6875rem;
  color: var(--card-muted);
}

/* ---- Certificates: list plus a tilting frame ------------------------- */

.certs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 48px;
  align-items: start;
}
.cert-list .entry {
  position: relative;
  padding-left: 18px;
  cursor: default;
  transition: padding-left 0.4s var(--ease-out);
}
.cert-list .entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%) scale(0);
  transition: transform 0.4s var(--ease-out);
}
.cert-list .entry.is-active {
  padding-left: 30px;
}
.cert-list .entry.is-active::before {
  transform: translateY(-50%) scale(1.6);
}
.cert-list .entry.is-active .entry-title {
  color: var(--accent);
}
.entry-thumb {
  display: none;
}
.cert-stage {
  position: sticky;
  top: 110px;
  perspective: 1100px;
}
.cert-tilt {
  transition: transform 0.35s var(--ease-out);
  transform-style: preserve-3d;
}
.cert-img {
  display: block;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  animation: cert-in 0.6s var(--ease-out) both;
}
@keyframes cert-in {
  from {
    opacity: 0;
    transform: rotateY(-18deg) translateX(30px) scale(0.96);
  }
}
.cert-empty {
  display: grid;
  gap: 8px;
  align-content: center;
  aspect-ratio: 1.9;
  padding: 32px;
  background: linear-gradient(135deg, #1f3a6b, #2b5797);
  color: #fff;
}
.cert-empty span {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.2;
}
.cert-empty small {
  opacity: 0.75;
}

/* ---- Publications: titles get a highlighter sweep --------------------- */

#publications .entry-title a {
  background: linear-gradient(color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 22%, transparent)) no-repeat 0 85% / 100% 0.45em;
}
.motion #publications .entry-title a {
  background-size: 0% 0.45em;
  transition: background-size 1.2s var(--ease-out) 0.3s;
}
.motion #publications .entry[data-in] .entry-title a {
  background-size: 100% 0.45em;
}

/* ---- Interests: colourful chips that pop in and wobble on hover -------- */

.interests li {
  padding: 12px 20px;
  border: 0;
  background: var(--tint-1);
  color: var(--band-ink);
  font-size: 1.0625rem;
}
.interests li:nth-child(4n + 2) {
  background: var(--tint-2);
}
.interests li:nth-child(4n + 3) {
  background: var(--tint-3);
}
.interests li:nth-child(4n + 4) {
  background: color-mix(in srgb, #ff8a5c 40%, var(--paper));
}
.motion .interests li:hover {
  animation: wobble 0.5s ease;
}
@keyframes wobble {
  30% {
    transform: rotate(-4deg) scale(1.06);
  }
  60% {
    transform: rotate(3deg) scale(1.04);
  }
}
.motion [data-reveal="pop"] {
  opacity: 0;
  transform: scale(0.5) rotate(-8deg);
  transition: opacity 0.4s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--d, 0ms);
}
.motion [data-reveal="pop"][data-in] {
  opacity: 1;
  transform: none;
}

/* ---- Experience bands slide in from alternating sides ----------------- */

.motion [data-reveal="slide"] {
  opacity: 0;
  transform: translateX(calc(var(--dir) * 80px));
  transition: opacity 0.8s ease, transform 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.motion [data-reveal="slide"][data-in] {
  opacity: 1;
  transform: none;
}

/* ---- Logo marquee ------------------------------------------------------ */

.marquee {
  display: grid;
  gap: 12px;
  margin-top: 48px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-row {
  overflow: hidden;
}
.marquee-row ul {
  display: flex;
  gap: 10px;
  width: max-content;
}
.motion .marquee-row ul {
  animation: marquee 38s linear infinite;
}
.motion .marquee-row.is-reverse ul {
  animation-direction: reverse;
}
.marquee:hover ul {
  animation-play-state: paused;
}
@keyframes marquee {
  to {
    transform: translateX(calc(-50% - 5px));
  }
}
.marquee li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.9375rem;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
}
.marquee li:hover {
  transform: translateY(-3px) rotate(-2deg);
  border-color: var(--ink);
}
.tile {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f4f5f7;
}
.tile b {
  font-weight: 500;
  color: #17181b;
}
.logo {
  width: 18px;
  height: 18px;
  background: var(--hex);
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}
.marquee li.dup {
  display: flex;
}
:root:not(.motion) .marquee li.dup {
  display: none;
}
:root:not(.motion) .marquee-row ul {
  flex-wrap: wrap;
  width: auto;
}

/* ---- Contact: magnetic pill links --------------------------------------- */

.magnet {
  display: inline-block;
  padding: 16px 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.35s var(--ease-out), background-color 0.25s ease, color 0.25s ease;
}
.magnet:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---- Small screens for the playful layer ------------------------------- */

@media (max-width: 900px) {
  .certs {
    grid-template-columns: 1fr;
  }
  .cert-stage {
    display: none;
  }
  .entry-thumb {
    display: block;
    width: min(100%, 360px);
    margin-top: 12px;
    border-radius: 8px;
  }
}
@media (max-width: 760px) {
  .filings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .demo {
    padding: 14px;
  }
}

@media (max-width: 999px) {
  .cards > .card:nth-child(n) {
    grid-column: 1 / -1;
  }
}

#capabilities .capabilities {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  #capabilities .capabilities {
    grid-template-columns: 1fr;
  }
}
