/* ==========================================================================
   Dona Marabe — personal site
   Palette from the brand sheet, Karla throughout, flat bricks.
   ========================================================================== */

:root {
  --cream: #F9F3EA;
  --paper: #FFFDF9;
  --ink: #494C50;
  --ink-deep: #303236;
  --yellow: #FBBC04;
  --red: #E43127;
  --green: #61AE46;
  --blue: #4285F4;
  --navy: #0F2A47;

  --red-dark: #B0231A;
  --yellow-dark: #D89A00;
  --green-dark: #468A30;
  --blue-dark: #2E64C0;
  --cream-dark: #D9CFBF;

  --line: rgba(73, 76, 80, 0.16);
  --radius: 4px;
  --nav-h: 64px;
  --gutter: clamp(20px, 5vw, 96px);
  --max: 1680px;

  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-xs: 0.8125rem;
  --fs-h3: 1.125rem;
  --fs-h2: clamp(1.75rem, 3.2vw, 2.5rem);
  --fs-h1: clamp(2.5rem, 5.4vw, 4.25rem);

  /* brick scale in the hero, and when docked beside a title */
  --bs: 1.4;
  --dock: 0.62;

  /* tab studs on top of flat bricks (front view) */
  --tab: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 12' preserveAspectRatio='none'%3E%3Cpath d='M16 12V4a4 4 0 0 1 4-4h24a4 4 0 0 1 4 4v8z'/%3E%3C/svg%3E");
}

@media (max-width: 720px) {
  :root { --bs: 0.9; --dock: 0.5; --nav-h: 58px; --fs-body: 0.9375rem; }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; color: var(--ink-deep); line-height: 1.15; font-weight: 800; }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

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

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink-deep); color: #fff; padding: 8px 14px; border-radius: var(--radius);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ==========================================================================
   The flat brick (front view): colour body, tab studs, darker bottom edge.
   Used for every card. Pick a colour with .b-red / .b-yellow / .b-green /
   .b-blue / .b-white / .b-gray.
   ========================================================================== */
.brick {
  /* colours come from a .b-* class on the brick or any ancestor */
  --stud-w: 64px; --stud-h: 12px;
  position: relative;
  margin-top: var(--stud-h);
  background: linear-gradient(90deg, var(--b1, #FFFFFF), var(--b2, #F3EEE5));
  color: var(--bi, #303236);
  border-radius: 3px;
  box-shadow: inset 0 -5px 0 var(--bd, #D9CFBF);
}
.brick::before {
  content: "";
  position: absolute; left: 8px; right: 8px; bottom: 100%;
  height: var(--stud-h);
  background: linear-gradient(var(--b1, #FFFFFF) 0 62%, var(--bd, #D9CFBF) 62%);
  -webkit-mask: var(--tab) left bottom / var(--stud-w) var(--stud-h) round no-repeat;
          mask: var(--tab) left bottom / var(--stud-w) var(--stud-h) round no-repeat;
  pointer-events: none;
}
.brick h2, .brick h3, .brick h4 { color: inherit; }
.brick--sm { --stud-w: 34px; --stud-h: 7px; box-shadow: inset 0 -3px 0 var(--bd, #D9CFBF); }

.b-red    { --b1: #EA473C; --b2: #D82C22; --bd: #A51F17; --bi: #FFFFFF; }
.b-yellow { --b1: #FFCB2E; --b2: #FBBC04; --bd: #D89A00; --bi: #2A2400; }
.b-green  { --b1: #7CC460; --b2: #61AE46; --bd: #468A30; --bi: #0E1F08; }
.b-blue   { --b1: #A6CBFF; --b2: #7DB1FA; --bd: #3F7FE0; --bi: #0F2A47; }
.b-white  { --b1: #FFFFFF; --b2: #F3EEE5; --bd: #D9CFBF; --bi: #303236; }
.b-gray   { --b1: #55595E; --b2: #44474B; --bd: #2A2C2F; --bi: #F3EEE5; }

/* a printed image tile set into a brick face */
.inset { padding: 10px; }
.inset img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }

.chip {
  display: inline-block; font-weight: 700; font-size: var(--fs-xs);
  padding: 2px 8px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.1);
}
.b-red .chip, .b-gray .chip { background: rgba(255, 255, 255, 0.18); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.nav.is-solid {
  background: rgba(249, 243, 234, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-home {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 800; font-size: 1rem; color: var(--ink-deep);
}
.nav-home img { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 6px 10px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; font-size: var(--fs-small);
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 3px; border-radius: 2px;
  background: var(--c, var(--ink)); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.is-current::after { transform: scaleX(1); }
.nav-links a[data-color="red"] { --c: var(--red); }
.nav-links a[data-color="blue"] { --c: var(--blue); }
.nav-links a[data-color="yellow"] { --c: var(--yellow); }
.nav-links a[data-color="green"] { --c: var(--green); }
.nav-links a[data-color="gray"] { --c: var(--ink); }
.nav-links a[data-color="navy"] { --c: var(--navy); }

.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 4px 10px; font-weight: 700; font-size: var(--fs-small); cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 6px var(--gutter) 18px;
    background: var(--cream); box-shadow: 0 12px 24px rgba(0,0,0,.08);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav.is-open { background: var(--cream); }
  .nav.is-open .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 10px 0; font-size: 1rem; }
  .nav-links a::after { left: 0; right: auto; width: 28px; }
}

/* ==========================================================================
   Bricks drawn as SVG (bricks.js)
   ========================================================================== */
.brick-svg { display: block; width: 100%; height: auto; overflow: visible; }
.brick-svg text { font-family: "Karla", system-ui, sans-serif; }
.cloud-svg { display: block; width: 100%; height: auto; }

/* ==========================================================================
   Hero — centred column, bricks scattered across the baseplate
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--nav-h) + clamp(16px, 4vh, 40px)) 0 clamp(24px, 5vh, 48px);
  display: flex; flex-direction: column; justify-content: center;
  background-color: var(--cream);
  background-image: radial-gradient(circle at 50% 50%, rgba(73, 76, 80, 0.07) 4.5px, transparent 5px);
  background-size: 28px 28px;
  background-position: 14px 14px;
  overflow: hidden;
}
.hero-center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: calc(600px + 2 * var(--gutter));
}
.hero-name {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 22px 0 14px;
}
.hero-name .w { display: inline-block; white-space: nowrap; }
.hero-name .ch { display: inline-block; will-change: transform; }
.hero-name .w:nth-child(1) .ch:nth-child(1) { color: var(--red); }
.hero-lead {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.55;
  max-width: 46ch;
  color: var(--ink);
  margin-bottom: 0;
}

/* portrait on a flat blue plate */
.hero-portrait { margin: 0; position: relative; width: min(280px, 32svh, 70vw); }
.plate {
  padding: 10px;
  border-radius: 4px;
  --stud-w: 40px; --stud-h: 9px;
  background: linear-gradient(90deg, #5B96F6, #4285F4);
  box-shadow: inset 0 -5px 0 var(--blue-dark);
  transform: rotate(-2deg);
}
.plate::before { background: linear-gradient(#6FA2F7 0 62%, var(--blue-dark) 62%); }
.slides { position: relative; aspect-ratio: 1 / 1; border-radius: 2px; overflow: hidden; background: var(--navy); }
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slides img:not(.is-active) { visibility: hidden; }
.slide-cells { position: absolute; inset: 0; display: grid; pointer-events: none; }
.slide-cell { background-repeat: no-repeat; border-radius: 2px; }
.slide-dots { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.slide-dots button {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  border: 0; padding: 0;
  background: var(--cream-dark);
  transition: background-color .2s ease, transform .2s ease;
}
.slide-dots button:hover { transform: scale(1.15); }
.slide-dots button[aria-current="true"] { background: var(--yellow); }

.perch { position: absolute; z-index: 3; }
.perch-cloud { width: 150px; left: -150px; top: -62px; animation: drift 7s ease-in-out infinite; }
.perch-blog { right: -30px; top: -26px; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(8px, -6px); }
}

/* the scattered bricks */
.scatter { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hbrick {
  --r: 0deg; --d: 1; --lift: 0px;
  position: absolute;
  /* placed by offset from the centre line, so the gap to the content is the same on every screen */
  left: clamp(72px, calc(50% + var(--ox, 0) * var(--spread, 1) * 1px), calc(100% - 72px));
  top: var(--y);
  margin-left: calc(var(--w, 120) * var(--bs) * -0.5px);
  margin-top: calc(var(--h, 63) * var(--bs) * -0.5px);
  width: calc(var(--w, 120) * var(--bs) * 1px);
  background: none; border: 0; padding: 0;
  cursor: pointer; pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.perch.hbrick { position: absolute; left: auto; margin: 0; }
.perch-blog.hbrick { right: -34px; top: -30px; }
.hbrick:not(.rendered) {
  width: auto; padding: 8px 14px; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-weight: 700; margin: 0;
}
.hbrick.rendered .hb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hb-inner {
  display: block; position: relative;
  transform:
    translate(calc(var(--px, 0) * var(--d) * 1px), calc(var(--py, 0) * var(--d) * 1px + var(--lift)))
    rotate(var(--r));
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.hbrick:hover .hb-inner, .hbrick:focus-visible .hb-inner { --lift: -8px; }
.hbrick:active .hb-inner { --lift: -2px; transition-duration: .1s; }
.hbrick:focus-visible { outline: none; }
.hbrick:focus-visible .hb-solid { outline: 3px solid var(--blue); outline-offset: 5px; border-radius: 4px; }
.hb-solid, .hb-ghost { display: block; transition: opacity .3s ease, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.hb-ghost { position: absolute; inset: 0; opacity: 0; color: var(--ink); }
.hbrick.is-docked .hb-solid { opacity: 0; transform: scale(.7); }
.hbrick.is-docked .hb-ghost { opacity: .5; }
.deco { width: calc(var(--w) * var(--bs) * 0.85px); pointer-events: none; cursor: default; }

.pile-foot {
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; min-height: 34px;
  font-size: var(--fs-small);
}
.pile-hint { margin: 0; font-weight: 600; }
.pile-reset {
  background: none; border: 2px dashed var(--ink); border-radius: var(--radius);
  padding: 4px 12px; font-weight: 700; cursor: pointer; font-size: var(--fs-small);
}
.pile-reset:hover { border-style: solid; }
.pile-reset[hidden] { display: none; }

/* narrower laptops: pull the bricks in a little */
@media (max-width: 1280px) { .scatter { --spread: 0.86; } }

/* phones: the column comes first, bricks scatter in a field below it */
@media (max-width: 860px) {
  .hero { justify-content: flex-start; }
  .scatter { position: relative; inset: auto; height: 300px; margin-top: 12px; order: 2; }
  .hbrick { left: var(--mx); top: var(--my, var(--y)); }
  .deco-desk { display: none; }
  .perch-cloud { width: 84px; left: -34px; top: -34px; }
  .perch-blog.hbrick { right: -24px; top: -24px; }
}

/* flying brick */
.flyer {
  position: fixed; left: 0; top: 0; z-index: 90;
  pointer-events: none;
  will-change: transform;
  transform-origin: 50% 50%;
}

/* ==========================================================================
   Floating astronaut: "Email me"
   ========================================================================== */
.astro {
  position: fixed; right: clamp(12px, 3vw, 32px); bottom: clamp(12px, 3vw, 28px); z-index: 70;
  width: 86px;
  text-decoration: none; color: var(--ink-deep);
  transition: transform .5s cubic-bezier(.5, -0.4, .5, 1.4), opacity .4s ease;
}
.astro.is-away { transform: translate(40px, 160px) rotate(25deg); opacity: 0; pointer-events: none; }
.astro-dock { position: relative; height: 170px; margin-top: 18px; }
.astro.is-docked { position: absolute; right: auto; bottom: auto; left: 120px; top: 34px; width: 100px; transition: none; }
.astro.is-moving { transition: none; }
.astro-body { display: block; animation: float 5s ease-in-out infinite; transform-origin: 50% 40%; }
.astro svg { display: block; width: 100%; height: auto; overflow: visible; }
.astro .wave { transform-origin: 87px 92px; transform-box: view-box; }
.astro:hover .wave, .astro:focus-visible .wave { animation: wave .9s ease-in-out; }
.astro-bubble {
  position: absolute; right: 70%; top: -6px;
  white-space: nowrap;
  background: var(--paper); color: var(--ink-deep);
  font-weight: 800; font-size: var(--fs-small);
  padding: 6px 12px; border-radius: 4px;
  box-shadow: inset 0 -3px 0 var(--cream-dark), 0 0 0 1.5px var(--cream-dark);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.astro-bubble::after {
  content: ""; position: absolute; right: -6px; bottom: 10px;
  border: 6px solid transparent; border-left-color: var(--paper); border-right: 0;
}
.astro:hover .astro-bubble { transform: translateY(-3px) scale(1.05); }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-18deg); }
  60% { transform: rotate(12deg); }
}
@media (max-width: 720px) {
  .astro { width: 50px; }
  .astro.is-docked { width: 76px; left: 110px; top: 40px; }
  .astro-dock { height: 140px; }
  .astro-bubble { right: 0; top: -30px; font-size: 0.75rem; padding: 3px 8px; }
  .astro-bubble::after { right: 14px; bottom: -6px; border: 6px solid transparent; border-top-color: var(--paper); border-bottom: 0; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(56px, 8vw, 104px) 0; position: relative; }
.sec-head { margin-bottom: clamp(28px, 4vw, 44px); max-width: 720px; }
.sec-title {
  display: flex; align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: 14px;
}
.sec-title-text { display: inline-block; min-width: 0; }
.sec-intro { font-size: clamp(1rem, 1.3vw, 1.0625rem); max-width: 56ch; }

/* socket beside each title */
.slot {
  position: relative;
  display: inline-block;
  flex: none;
  width: calc(var(--w, 120) * var(--dock) * 1px);
  color: var(--ink);
}
.slot-ghost { display: block; opacity: .35; transition: opacity .3s ease; }
.slot.is-docked .slot-ghost { opacity: 0; }
.slot-brick { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; }
.on-dark .slot { color: var(--cream); }

/* ---------- Highlights: full-bleed colour bands, one screen each, snapping ---------- */
.highlights { padding-bottom: 0; }
.hl-panel {
  height: calc(100svh - var(--nav-h));
  min-height: 480px;
  background: linear-gradient(90deg, var(--b1), var(--b2));
  color: var(--bi);
  overflow: hidden;
}
.hl-panel h3 { color: inherit; }
.hl-card { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hl-media { position: relative; overflow: hidden; min-height: 0; }
.hl-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hl-text {
  padding: clamp(28px, 5vw, 96px) var(--gutter);
  display: flex; flex-direction: column; justify-content: center;
}
.hl-count { font-size: var(--fs-xs); font-weight: 700; opacity: .75; margin-bottom: 14px; }
.hl-text .chip { align-self: flex-start; margin-bottom: 14px; }
.hl-text h3 { font-size: clamp(1.75rem, 3.6vw, 3.25rem); letter-spacing: -0.035em; line-height: 1.02; margin-bottom: 16px; max-width: 18ch; }
.hl-text p { max-width: 54ch; font-size: clamp(1rem, 1.2vw, 1.125rem); }
.hl-text ul { margin: 12px 0 0; padding-left: 1.1em; font-size: 0.9375rem; max-width: 60ch; }
.hl-text li { margin-bottom: 5px; }
.b-red .chip { background: rgba(255, 255, 255, 0.18); }
.hl-stack { display: flex; align-items: center; justify-content: center; padding: 48px; }
/* a little pile of front-view bricks; DOM order is bottom-up so upper bricks cover lower studs */
.stack { display: flex; flex-direction: column-reverse; align-items: center; width: min(420px, 70%); padding-top: 14px; }
.stack > .brick { display: block; height: 76px; margin-top: 0; --stud-h: 14px; --stud-w: 76px; }

.hl-dots {
  position: fixed; right: clamp(10px, 2vw, 24px); top: 50%; z-index: 55;
  display: flex; flex-direction: column; gap: 10px;
  transform: translate(30px, -50%); opacity: 0; pointer-events: none;
  transition: transform .35s ease, opacity .35s ease;
}
.hl-dots.is-on { transform: translate(0, -50%); opacity: 1; pointer-events: auto; }
.hl-dots button {
  width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--cream-dark);
  transition: transform .25s ease, background-color .25s ease;
}
.hl-dots button[aria-current="true"] { background: var(--ink-deep); transform: scale(1.25); }

@media (max-width: 760px) {
  .hl-panel { height: auto; min-height: calc(100svh - var(--nav-h)); }
  .hl-card { grid-template-columns: 1fr; grid-template-rows: 38svh auto; }
  .hl-media { grid-row: 1; }
  .hl-stack { padding: 28px 28px 0; }
  .stack { width: 60%; }
  .stack > .brick { height: 52px; --stud-h: 11px; --stud-w: 60px; }
  .hl-text { padding: 24px var(--gutter) 32px; grid-row: 2; }
  .hl-dots { display: none; }
}

/* ---------- Research (navy) ---------- */
.on-dark { background: var(--navy); color: #DCE3EC; }
.on-dark h2, .on-dark .sec-title { color: #fff; }
.research { overflow: hidden; }
.research::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.045) 4.5px, transparent 5px);
  background-size: 28px 28px;
}
.research .wrap { position: relative; }
.page { display: flex; flex-direction: column; }
.page .inset { aspect-ratio: 16 / 9; padding-bottom: 0; }
.page-body { padding: 18px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.page .chip { align-self: flex-start; margin-bottom: 10px; }
.page h3 { margin-bottom: 8px; }
.page p { font-size: 0.9375rem; }
.page a.link { font-weight: 700; margin-top: auto; padding-top: 10px; display: inline-block; }
.awards { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.awards li { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: baseline; font-size: var(--fs-small); }
.awards b { font-weight: 800; }

.page--feature { flex-direction: row; margin-bottom: 44px; }
.page--feature .inset { flex: 0 0 44%; aspect-ratio: auto; min-height: 320px; padding: 10px 0 15px 10px; }
.page--feature .page-body { padding: 26px 30px 30px; }
.page--feature h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); letter-spacing: -0.02em; }
.paper-list { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: paper; display: grid; gap: 10px; }
.paper-list li {
  counter-increment: paper;
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  font-weight: 600; line-height: 1.4; font-size: 0.9375rem;
}
.paper-list li::before {
  content: counter(paper);
  width: 26px; height: 22px; border-radius: 3px;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 800; font-size: var(--fs-xs);
}
.pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
@media (min-width: 1300px) { .pages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

@media (max-width: 820px) {
  .page--feature { flex-direction: column; }
  .page--feature .inset { min-height: 0; aspect-ratio: 16 / 10; padding: 10px 10px 0; }
  .pages { grid-template-columns: 1fr; }
}

/* ---------- Education: sticky cards that stack as you scroll ---------- */
.ecards { position: relative; }
.ecard {
  position: sticky;
  top: calc(var(--nav-h) + 24px + var(--i) * 18px);
  min-height: min(76svh, 720px);
  display: flex; flex-direction: column;
  margin-bottom: 48px;
  transform-origin: 50% 0;
}
.ecard:last-child { margin-bottom: 0; }
.ecard-head { padding: clamp(22px, 2.6vw, 36px) clamp(22px, 3vw, 44px) 18px; }
.ecard-head .chip { margin-bottom: 12px; }
.ecard-head h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 8px; }
.ecard-head p { max-width: 70ch; font-size: clamp(0.9375rem, 1.1vw, 1.0625rem); opacity: .92; }
.ecard-body {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 36px);
  padding: 0 12px 17px 12px;
  min-height: 0;
}
.ecard-media { position: relative; min-height: 260px; border-radius: 2px; overflow: hidden; }
.ecard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ecard-media .tbrick-mark { position: absolute; inset: 0; min-height: 0; }
.ecard-points { list-style: none; margin: 0; padding: 8px clamp(10px, 2vw, 28px) 20px 0; display: grid; gap: 14px; align-content: start; font-size: 0.9375rem; }
.ecard-points li { padding-left: 16px; position: relative; }
.ecard-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: .5; }
.tbrick-mark {
  display: grid; place-items: center; height: 100%;
  background-color: rgba(0,0,0,.08);
  background-image: radial-gradient(circle, rgba(255,255,255,.25) 6px, transparent 6.5px);
  background-size: 26px 26px;
  font-weight: 800; font-size: clamp(2.5rem, 6vw, 5rem); letter-spacing: -0.05em;
}

@media (max-width: 820px) {
  .ecard { position: relative; top: auto; min-height: 0; margin-bottom: 36px; }
  .ecard-body { grid-template-columns: 1fr; }
  .ecard-media { min-height: 0; aspect-ratio: 16 / 10; }
  .ecard-points { padding: 4px 10px 16px; }
}

/* ---------- Speaking: green rail timeline ---------- */
.talks-wrap { position: relative; }
@media (min-width: 1000px) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: clamp(40px, 6vw, 120px); align-items: start; }
  .split .sec-head { position: sticky; top: calc(var(--nav-h) + 40px); }
}
.talks { list-style: none; margin: 0; padding: 0 0 0 52px; }
.rail {
  position: absolute; left: 12px; top: 6px; bottom: 6px; width: 16px;
  border-radius: 3px;
  background: rgba(97, 174, 70, 0.18);
  overflow: hidden;
}
.rail-fill { position: absolute; inset: 0; background: linear-gradient(90deg, #7CC460, var(--green)); transform-origin: top; }
.talk { position: relative; padding-bottom: clamp(26px, 3.4vw, 38px); }
.talk:last-child { padding-bottom: 0; }
.talk::before {
  /* a 1x1 flat brick marker on the rail */
  content: ""; position: absolute; left: -46px; top: 4px;
  width: 24px; height: 18px; border-radius: 3px;
  background: var(--paper);
  box-shadow: inset 0 -4px 0 var(--cream-dark), 0 0 0 2px var(--green);
  transition: background-color .3s ease, transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.talk.is-lit::before { background: var(--yellow); box-shadow: inset 0 -4px 0 var(--yellow-dark), 0 0 0 2px var(--green); transform: scale(1.12); }
.talk time { display: block; font-weight: 800; color: var(--green-dark); font-size: var(--fs-xs); margin-bottom: 2px; }
.talk h3 { margin-bottom: 2px; }
.talk .org { font-weight: 600; color: var(--ink-deep); margin-bottom: 6px; font-size: 0.9375rem; }
.talk .role {
  display: inline-block; font-size: 0.75rem; font-weight: 700; vertical-align: middle;
  padding: 1px 7px; border-radius: 3px; margin-left: 6px;
  background: rgba(97, 174, 70, 0.16); color: #2f5d20;
}
.talk p:not(.org) { max-width: 62ch; font-size: 0.9375rem; }
.talk--feature h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 4px; }
.talk--feature .translation { font-weight: 700; color: var(--green-dark); margin-bottom: 8px; }

@media (max-width: 620px) {
  .talks { padding-left: 42px; }
  .rail { left: 8px; width: 14px; }
  .talk::before { left: -40px; width: 22px; height: 16px; }
}

/* ---------- Sidequests ---------- */
.sidequests { background: var(--yellow); color: #2a2400; }
.sidequests h2, .sidequests h3 { color: #2a2400; }
.sidequests .slot { color: #2a2400; }
.sq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.sq-col > h3 { font-size: 1.25rem; margin-bottom: 18px; letter-spacing: -0.02em; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px 18px; }
.role-card { padding: 14px 18px 18px; }
.role-card h4 { font-size: 1rem; margin-bottom: 4px; }
.role-card dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; font-size: var(--fs-small); }
.role-card dd { margin: 0; font-weight: 700; white-space: nowrap; }

.bin { padding: 20px 18px 24px; --b1: #303236; --b2: #303236; --bd: #1F2124; }
.bin .b-blue { --b1: #4285F4; --b2: #4285F4; --bd: #2E64C0; --bi: #FFFFFF; }
.bin-group + .bin-group { margin-top: 20px; }
.bin-group h4 { color: #fff; font-size: 0.9375rem; margin-bottom: 8px; }
.parts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 8px; }
.part {
  padding: 5px 12px 8px;
  font-weight: 700; font-size: var(--fs-small); line-height: 1.25;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.part:hover { transform: translateY(-3px); }
.part small { font-weight: 500; opacity: .85; }

@media (max-width: 820px) { .sq-grid { grid-template-columns: 1fr; } }

/* ---------- Footer / contact ---------- */
.footer { background: var(--navy); color: #DCE3EC; padding: clamp(64px, 9vw, 112px) 0 32px; position: relative; overflow: hidden; }
.footer .sec-title { color: #fff; }
.footer--short { padding-top: clamp(48px, 7vw, 80px); }
.contact-line {
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  color: #fff; max-width: 20ch; margin: 24px 0 32px;
}
.footer--short .contact-line { margin-top: 0; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 20px 16px; align-items: center; }
.btn-brick {
  display: inline-flex; align-items: center;
  text-decoration: none; font-weight: 800; font-size: 1rem;
  padding: 10px 22px 15px;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
  --stud-w: 40px; --stud-h: 9px;
}
.btn-brick:hover { transform: translateY(-3px); }
.btn-brick:active { transform: translateY(1px); }
.contact-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.contact-links a { font-weight: 600; text-decoration: none; border-bottom: 2px solid rgba(255,255,255,.3); padding-bottom: 1px; font-size: 0.9375rem; }
.contact-links a:hover { border-color: var(--yellow); color: #fff; }
.footer-base {
  margin-top: clamp(56px, 8vw, 96px); padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center;
  font-size: var(--fs-small);
}
.footer-base a { text-decoration: none; font-weight: 600; }
.footer-base a:hover { color: #fff; text-decoration: underline; }
.footer-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; }
.footer-logo img { width: 26px; height: 26px; }

/* ==========================================================================
   Blog
   ========================================================================== */
.blog-hero {
  padding: calc(var(--nav-h) + clamp(40px, 7vw, 80px)) 0 clamp(32px, 5vw, 56px);
  background-image: radial-gradient(circle at 50% 50%, rgba(73, 76, 80, 0.07) 4.5px, transparent 5px);
  background-size: 28px 28px;
}
.blog-hero .sec-title { font-size: clamp(2.25rem, 5vw, 3.5rem); }
.post-list { list-style: none; margin: 0; padding: 0 0 clamp(64px, 9vw, 112px); display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 36px 24px; align-items: start; }
.post-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.post-card:hover { transform: translateY(-5px) rotate(-.5deg); }
.post-card .inset { aspect-ratio: 16 / 10; padding-bottom: 0; }
.post-card .page-body h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.post-card time { font-size: var(--fs-xs); font-weight: 700; display: block; margin-bottom: 6px; opacity: .85; }
.post-card p { font-size: 0.9375rem; }
.post-card .more { margin-top: auto; padding-top: 12px; font-weight: 800; }
.empty-card {
  border: 2px dashed var(--line); border-radius: var(--radius);
  display: grid; place-items: center; text-align: center; padding: 28px; min-height: 180px;
  font-weight: 600; margin-top: 12px;
}

.post-header { padding: calc(var(--nav-h) + clamp(32px, 6vw, 64px)) 0 24px; }
.post-header .wrap, .post-body .wrap { max-width: 720px; }
.post-header h1 { font-size: clamp(2rem, 4.8vw, 3.25rem); letter-spacing: -0.04em; line-height: 1; margin: 10px 0 14px; }
.post-meta { font-weight: 600; font-size: var(--fs-small); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.back-link { font-weight: 700; text-decoration: none; font-size: var(--fs-small); }
.back-link:hover { color: var(--red); }
.post-cover { max-width: 960px; margin: 0 auto clamp(32px, 5vw, 56px); padding-inline: var(--gutter); }
.post-cover .plate { transform: rotate(-1deg); }
.post-cover img { border-radius: 2px; width: 100%; max-height: 520px; object-fit: cover; }
.post-body { padding-bottom: clamp(64px, 9vw, 112px); }
.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 1.8em 0 0.5em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); margin-inline: auto; max-height: 640px; width: auto; }
.prose figcaption { font-size: var(--fs-small); text-align: center; margin-top: 8px; }
.prose blockquote {
  margin: 1.6em 0; padding: 14px 20px; border-radius: var(--radius);
  background: var(--paper); border-left: 8px solid var(--yellow);
  font-size: 1.1875rem; font-weight: 700; color: var(--ink-deep); line-height: 1.45;
}
.placeholder-note {
  background: rgba(251, 188, 4, 0.18); border: 2px dashed var(--yellow-dark);
  border-radius: var(--radius); padding: 12px 16px; font-size: var(--fs-small); font-weight: 600;
  margin-bottom: 2em;
}

/* ==========================================================================
   Brick-wall page transition
   ========================================================================== */
.wall { position: fixed; inset: 0; z-index: 300; pointer-events: all; overflow: hidden; }
.wall-brick { position: absolute; border-radius: 3px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.2); }
html.wall-in body::after { content: ""; position: fixed; inset: 0; z-index: 299; background: var(--navy); }

/* Before the intro plays, hide the pieces that animate in (only when JS + GSAP run) */
html.js.anim .hero-name .ch,
html.js.anim .hero-lead,
html.js.anim .hero-portrait,
html.js.anim .scatter .hbrick,
html.js.anim .pile-foot,
html.js.anim .astro { opacity: 0; }

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

/* ==========================================================================
   Coming-soon page (index.html)
   ========================================================================== */
.soon {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 48px var(--gutter);
  background-color: var(--cream);
  background-image: radial-gradient(circle at 50% 50%, rgba(73, 76, 80, 0.07) 4.5px, transparent 5px);
  background-size: 28px 28px;
  background-position: 14px 14px;
  overflow: hidden;
}
.soon-scatter { position: absolute; inset: 0; pointer-events: none; }
.soon-deco {
  position: absolute;
  left: clamp(40px, calc(50% + var(--ox, 0) * var(--spread, 1) * 1px), calc(100% - 40px));
  top: var(--y);
  width: calc(var(--w, 60) * 1.3px);
  transform: translate(-50%, -50%) rotate(var(--r));
}
.soon-center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%; max-width: 520px;
}
.soon-cloud { position: absolute; width: 130px; left: -40px; top: -18px; animation: drift 7s ease-in-out infinite; }

/* the self-building tower */
.build { display: flex; flex-direction: column-reverse; align-items: center; width: 240px; height: 190px; justify-content: flex-start; margin-bottom: 22px; }
.build-row { display: flex; justify-content: center; gap: 0; width: 100%; }
.build .brick { display: block; height: 46px; margin-top: 0; --stud-h: 10px; --stud-w: 44px; }
.build-row:first-child { border-bottom: 8px solid var(--cream-dark); border-radius: 0 0 3px 3px; }

.soon-chip { margin: 0 0 12px; background: var(--ink-deep); color: var(--yellow); }
.soon-name { font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -0.045em; line-height: 0.95; margin-bottom: 14px; }
.soon-lead { font-size: 1.0625rem; max-width: 42ch; margin-bottom: 28px; }

.gate { width: 100%; max-width: 400px; }
.gate-label { display: block; font-weight: 700; font-size: var(--fs-small); margin-bottom: 18px; }
.gate-row { display: flex; gap: 10px; align-items: flex-end; }
.gate-input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--ink-deep);
  padding: 12px 14px; border-radius: 4px;
  background: var(--paper);
  border: 2px solid var(--cream-dark);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.04);
  transition: border-color .2s ease;
}
.gate-input:focus { outline: none; border-color: var(--blue); }
.gate-input::placeholder { color: #9a958c; font-weight: 500; }
.gate-btn {
  --stud-w: 36px; --stud-h: 9px;
  font: inherit; font-weight: 800; font-size: 1rem;
  border: 0; cursor: pointer;
  padding: 11px 20px 15px;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.gate-btn:hover { transform: translateY(-3px); }
.gate-btn:active { transform: translateY(1px); }
.gate-msg { min-height: 1.6em; margin: 10px 0 0; font-size: var(--fs-small); font-weight: 600; }
.gate-msg.is-error { color: var(--red-dark); }
.gate-msg.is-ok { color: var(--green-dark); }
.gate-back { margin: 0 0 6px; font-weight: 700; }
.gate-back a { color: var(--blue-dark); }

.soon-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin: 22px 0 0; padding: 0; font-size: var(--fs-small); }
.soon-links a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--cream-dark); }
.soon-links a:hover { border-color: var(--yellow); }

@media (max-width: 1100px) { .soon-scatter { --spread: 0.7; } }
@media (max-width: 620px) {
  .soon-scatter { --spread: 0.42; }
  .soon-deco { width: calc(var(--w, 60) * 0.9px); opacity: .9; }
  .soon-deco:nth-child(4) { display: none; }
  .soon-cloud { width: 90px; left: -6px; top: -10px; }
  .build { transform: scale(.85); margin-bottom: 8px; }
}
