:root {
  --bg: #fafaf8;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: #e2e8f0;
  --accent: #6c4ad6;
  --dark: #0f172a;
  --font-body: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  --font-pixel: 'Coral Pixels', cursive;
  --transition: all 0.2s ease;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --page-rail: 112px;
  --grid-width: min(calc(100vw - var(--page-rail)), 1280px);
  --grid-col: calc(var(--grid-width) / 6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  body.custom-cursor,
  body.custom-cursor * {
    cursor: none;
  }
}

/* GRID BACKGROUND */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: var(--grid-col) 100%;
  background-position: var(--grid-offset, calc((100vw - var(--grid-width)) / 2)) top;
}

.page-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 28px 80px;
}

.page-wrap.wide {
  max-width: none;
  padding: 0; /* home page only - footer-name-bg provides its own bottom padding */
}

/* ===== FIXED CHROME (home) ===== */
.fixed-topleft {
  position: fixed;
  top: 22px;
  left: 28px;
  z-index: 40;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.fixed-topleft .meta-temp {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.weather-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-muted);
}

.fixed-topright {
  position: fixed;
  top: 20px;
  right: 80px;
  z-index: 40;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--text-soft);
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: var(--transition);
}

.pill-status:hover {
  border-color: var(--text);
  color: var(--text);
}

.pill-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

/* COLLABORATION TOGGLE */
.collab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 7px 9px 7px 16px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.collab-btn:hover {
  border-color: var(--text-muted);
}

.collab-btn .collab-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.collab-btn .collab-switch {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.collab-btn .collab-switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.collab-btn.active {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.collab-btn.active .collab-switch {
  background: var(--accent);
}

.collab-btn.active .collab-switch .knob {
  transform: translateX(16px);
}

/* COLLABORATION MODE - Figma-style selection */
.sel-box {
  position: fixed;
  z-index: 72;
  pointer-events: none;
  border: 1.5px solid #3a7bff;
  display: none;
}

.sel-box.purple {
  border-color: var(--accent);
}

.sel-box .handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fff;
  border: 1.5px solid #3a7bff;
  border-radius: 1px;
}

.sel-box.purple .handle {
  border-color: var(--accent);
}

.sel-box .handle.tl { top: -4px; left: -4px; }
.sel-box .handle.tr { top: -4px; right: -4px; }
.sel-box .handle.bl { bottom: -4px; left: -4px; }
.sel-box .handle.br { bottom: -4px; right: -4px; }
.sel-box .handle.tm { top: -4px; left: 50%; transform: translateX(-50%); }
.sel-box .handle.bm { bottom: -4px; left: 50%; transform: translateX(-50%); }
.sel-box .handle.lm { left: -4px; top: 50%; transform: translateY(-50%); }
.sel-box .handle.rm { right: -4px; top: 50%; transform: translateY(-50%); }

.sel-box .sel-tag {
  position: absolute;
  top: -21px;
  left: -1.5px;
  background: #3a7bff;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

.sel-box.purple .sel-tag {
  background: var(--accent);
}

/* RIGHT SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 56px;
  background: #000;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.sidebar .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  text-decoration: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.2vh, 24px);
}

.sidebar .vert-link {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1.2vh, 0.72rem);
  letter-spacing: 1.6px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  text-transform: uppercase;
  transition: var(--transition);
}

.sidebar .vert-link:hover {
  color: #fff;
}

/* CUSTOM CURSORS */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  pointer-events: none;
  display: none;
  align-items: flex-start;
  gap: 2px;
  transform: translate(-100px, -100px);
  will-change: transform;
}

body.collab .cursor {
  display: flex;
}

body.collab .cursor.guest {
  display: flex;
}

.cursor svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.cursor .tag {
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  padding: 2px 8px;
  border-radius: 0 8px 8px 8px;
  white-space: nowrap;
}

.cursor.you .tag {
  background: var(--dark);
}

.cursor.guest .tag {
  background: var(--accent);
}

/* ===== HOME LAYOUT ===== */
.home {
  position: relative;
  width: var(--grid-width);
  margin: 0 auto;
  padding-top: 100vh;
}

/* HERO */
.hero {
  position: fixed;
  top: 0;
  left: var(--grid-offset, calc((100vw - var(--grid-width)) / 2));
  z-index: 1;
  width: var(--grid-width);
  height: 100vh;
  min-height: 720px;
  max-height: none;
  padding-top: 0;
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(6.2rem, 8.9vw, 10rem);
  line-height: 0.74;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  z-index: 2;
  width: max-content;
  margin: 0 auto;
}

.hero-row {
  position: relative;
  width: 100%;
  margin-top: clamp(148px, 18vh, 178px);
}

.hero-name .line {
  display: block;
}

.hero-name .line-1 {
  max-width: max-content;
}

.hero-name .line-2 {
  margin-top: 0.08em;
  margin-left: clamp(130px, 13vw, 230px);
  position: relative;
  width: 4.85em;
  height: 0.9em;
}

/* "Coral Pixels" is a colour pixel font - the multicoloured look is the
   font itself, rendered statically (no animation), exactly like the reference. */
.pixel-word {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0;
}

/* toggled back to plain text - renders like the rest of the name */
.pixel-word-text {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0;
}

.pixel-layer {
  position: absolute;
  left: 0;
  top: 0;
  line-height: inherit;
  transform-origin: center;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.pixel-layer-text {
  opacity: 0;
  transform: translateY(0.05em) scale(0.985);
}

.line-2.as-text .pixel-layer-pixel {
  opacity: 0;
  transform: translateY(-0.04em) scale(1.015);
}

.line-2.as-text .pixel-layer-text {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.footer-reveal-active .hero-name .line-2 {
  opacity: 0;
  visibility: hidden;
}

/* the little blue switch shown in collaboration mode */
.pixel-toggle {
  position: fixed;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: flex-start;
  width: 64px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #3a7bff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

body.collab .pixel-toggle {
  display: inline-flex;
}

.pixel-toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.pixel-toggle .pix-ico {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 12px;
  height: 12px;
  color: rgba(255, 255, 255, 0.85);
  transition: left 0.26s cubic-bezier(0.4, 0, 0.2, 1), right 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.pixel-toggle.text-mode .knob {
  transform: translateX(36px);
}

.pixel-toggle.text-mode .pix-ico {
  left: 10px;
  right: auto;
}

.hero-blurb {
  position: absolute;
  top: 0;
  left: calc(50% + clamp(48px, 4.4vw, 82px));
  max-width: 360px;
  margin-top: 0;
  font-size: clamp(0.92rem, 0.92vw, 1rem);
  line-height: 1.48;
  color: var(--text-soft);
  z-index: 3;
}

.hero-cta {
  display: flex;
  margin-top: clamp(100px, 12vh, 130px);
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-dark {
  background: var(--dark);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20, 20, 31, 0.25);
}

.scroll-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scroll-hint .arrow {
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ===== HERO ENTRANCE ===== */
@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-name .line-1 {
  animation: hero-enter 0.72s var(--ease-out-expo) both;
  animation-delay: 0.05s;
}

.hero-name .line-2 {
  animation: hero-enter 0.72s var(--ease-out-expo) both;
  animation-delay: 0.15s;
}

.hero-blurb {
  animation: hero-enter 0.65s var(--ease-out-expo) both;
  animation-delay: 0.28s;
}

.hero-cta {
  animation: hero-enter 0.65s var(--ease-out-expo) both;
  animation-delay: 0.42s;
}

.fixed-topleft {
  animation: hero-enter 0.5s var(--ease-out-expo) both;
  animation-delay: 0.6s;
}

.fixed-topright {
  animation: hero-enter 0.5s var(--ease-out-expo) both;
  animation-delay: 0.65s;
}

/* SECTION SCAFFOLD */
.content-reveal {
  position: relative;
  /* Raised above fixed chrome (z-index 40) so content physically covers them on scroll */
  z-index: 50;
  margin-top: 0;
  background-color: var(--bg);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: var(--grid-col) 100%;
  /* Pin grid lines to home's left edge so they align with section CSS columns */
  background-position: calc((100vw - var(--grid-width)) / 2) top;
  /* Stretch to full viewport width so the white overlay covers the fixed hero
     edge-to-edge on both sides, eliminating the right-side gap before the sidebar */
  width: 100vw;
  margin-left: calc(-1 * (100vw - var(--grid-width)) / 2);
  padding-left: calc((100vw - var(--grid-width)) / 2);
  padding-right: calc((100vw - var(--grid-width)) / 2);
  margin-bottom: 58vh;
}

body.overlay-active .hero-cta {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.section {
  position: relative;
  z-index: 2;
  padding: 64px 0;
  border-top: 1px solid var(--line-strong);
  background: transparent;
  backdrop-filter: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 48px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.experience-section {
  padding: 68px 0 76px;
}

.experience-section .section-head {
  margin-bottom: 58px;
}

.experience-section .section-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.experience-section .split {
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}

.experience-section .split-lead {
  grid-column: 1 / 3;
  max-width: 292px;
  font-size: 1rem;
  line-height: 1.45;
}

.experience-section .exp-list {
  grid-column: 3 / 7;
}

/* TWO-COLUMN BODY */
.split {
  display: grid;
  grid-template-columns: 0.9fr 2fr;
  gap: 64px;
}

.split-lead {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.split-lead strong {
  color: var(--text);
  font-weight: 600;
}

/* EXPERIENCE TABLE */
.exp-row {
  display: grid;
  grid-template-columns: 1fr 1.7fr 0.55fr;
  gap: 24px;
  align-items: baseline;
  min-height: 56px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: var(--transition);
}

.exp-row:first-child {
  border-top: 1px solid var(--line);
}

.exp-row:hover {
  background: rgba(108, 74, 214, 0.03);
}

.exp-row:hover .exp-org {
  color: var(--accent);
}

.exp-org {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.exp-org .ext {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: var(--transition);
}

.exp-org:hover .ext {
  color: var(--text);
  transform: translate(2px, -2px);
}

.exp-role {
  font-size: 1rem;
  color: var(--text-soft);
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  text-align: right;
}

/* EXPERTISE */
.expertise-lead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 2.55vw, 2.55rem);
  line-height: 1.48;
  letter-spacing: 0;
  color: var(--text-soft);
}

/* light-blue text highlight, like the reference's selection-style mark */
.hl {
  background-color: #d9e3fc;
  color: inherit;
  padding: 0 0.14em;
  border-radius: 2px;
  line-height: 1.1;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.pillar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.pillar-card {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  min-height: 220px;
  padding: 26px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.22s ease, box-shadow 0.32s var(--ease-out-expo), transform 0.32s var(--ease-out-expo);
  background: transparent;
}

.pillar-card:hover {
  background: transparent;
  border-color: var(--text-muted);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
  transform: translateY(-3px);
}

.pillar-icon {
  width: 66px;
  height: 66px;
  margin-bottom: 14px;
  color: var(--text);
}

.pillar-title {
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}

.pillar-desc {
  max-width: 220px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* PROJECTS / LIST ROWS */
.projects-section {
  padding: 68px 0 88px;
}

.projects-section .section-head {
  margin-bottom: 58px;
}

.projects-section .section-meta,
.talks-section .section-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.projects-split {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}

.projects-intro {
  grid-column: 1 / 3;
  max-width: 300px;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.project-table {
  grid-column: 3 / 7;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr 2.25fr 0.55fr;
  gap: 32px;
  align-items: baseline;
  min-height: 56px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.list-row:first-child {
  border-top: 1px solid var(--line);
}

.list-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.list-desc {
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text-soft);
}

.list-visit {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  transition: var(--transition);
}

.list-visit .ext {
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}

.list-row:hover {
  background: rgba(108, 74, 214, 0.02);
}

.list-row:hover .list-visit {
  color: var(--text);
}

.list-row:hover .list-visit .ext {
  transform: translate(2px, -2px);
}

/* PICK MY BRAIN */
.ask {
  position: relative;
  z-index: 2;
  padding: 90px 0;
  border-top: 1px solid var(--line-strong);
  text-align: center;
  background: transparent;
  backdrop-filter: none;
}

.ask-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text);
  margin-bottom: 16px;
}

.ask-sub {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.ask-chat {
  max-width: 720px;
  max-height: 320px;
  margin: 0 auto 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 4px;
  scrollbar-width: none;
}

.ask-chat::-webkit-scrollbar {
  display: none;
}

.ask-chat[hidden] {
  display: none;
}

.ask-message-row {
  display: flex;
  width: 100%;
}

.ask-message-row.user {
  justify-content: flex-end;
}

.ask-message-row.assistant {
  justify-content: flex-start;
}

.ask-message {
  max-width: min(82%, 610px);
  border-radius: 22px;
  padding: 14px 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}

.ask-message.user {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--accent);
  border-bottom-right-radius: 6px;
}

.ask-message.assistant {
  color: #fff;
  background: var(--accent);
  border-bottom-left-radius: 6px;
  box-shadow: 0 14px 34px rgba(108, 74, 214, 0.16);
}

.ask-message.typing {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 78px;
}

.ask-message.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
  animation: typing-dot 0.9s ease-in-out infinite;
}

.ask-message.typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.ask-message.typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typing-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.ask-box {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 8px 8px 26px;
  transition: var(--transition);
}

.ask-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(108, 74, 214, 0.12);
}

.ask-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  padding: 12px 0;
}

.ask-input::placeholder {
  color: var(--text-dim);
}

.ask-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ask-send:hover {
  transform: scale(1.06);
  background: #5a3bc0;
}

.ask-send:disabled,
.ask-input:disabled {
  cursor: not-allowed;
}

.ask-send:disabled {
  opacity: 0.35;
  transform: none;
}

.ask-foot {
  max-width: 720px;
  margin: 12px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* SKILLS */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
}

.skill-badge img,
.skill-badge svg {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  opacity: 0.55;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.skill-badge:hover img,
.skill-badge:hover svg {
  opacity: 1;
  transform: scale(1.18) translateY(-4px);
}

/* CONTACT */
.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.95rem;
  color: var(--text-soft);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.contact-link:hover {
  border-color: var(--text);
  color: var(--text);
  transform: translateY(-2px);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== PROJECT PAGES ===== */
.project-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 8px 0 48px;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link:hover {
  color: var(--text);
}

.project-header {
  margin-bottom: 56px;
}

.project-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}

.project-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.project-body .section-label {
  display: block;
  margin-bottom: 28px;
}

.project-body p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-soft);
  margin-bottom: 22px;
}

.project-body p:last-child {
  margin-bottom: 0;
}

.project-cta {
  padding-top: 48px;
}

.project-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.95rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: var(--transition);
}

.project-pdf-btn:hover {
  border-color: var(--text);
  color: var(--text);
  transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .experience-section .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .experience-section .split-lead,
  .experience-section .exp-list {
    grid-column: auto;
  }

  .projects-split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .projects-intro,
  .project-table {
    grid-column: auto;
  }

  .hero-blurb {
    position: static;
    max-width: 100%;
    margin-top: 28px;
  }
}

@media (max-width: 600px) {
  :root {
    --page-rail: 20px;
  }

  .page-wrap,
  .page-wrap.wide {
    padding: 72px 20px 60px;
  }

  /* Hide collab button and fixed chrome on mobile */
  .fixed-topright {
    display: none;
  }

  .fixed-topleft {
    font-size: 0.78rem;
    top: 14px;
    left: 16px;
  }

  /* Sidebar smaller on mobile */
  .sidebar {
    width: 40px;
  }

  .sidebar .logo {
    font-size: 1.1rem;
  }

  /* Hero: unstick and stack */
  .hero {
    position: relative;
    left: auto;
    width: 100%;
    height: auto;
    min-height: auto;
    max-height: none;
    padding: 80px 20px 48px;
  }

  .hero-row {
    margin-top: 0;
    flex-direction: column;
    gap: 20px;
  }

  .hero-name {
    font-size: clamp(3.8rem, 16vw, 6rem);
  }

  .hero-name .line-2 {
    margin-left: 0;
  }

  .hero-blurb {
    position: static;
    max-width: 100%;
    font-size: 1rem;
    margin-top: 0;
  }

  .hero-cta {
    margin-top: 40px;
  }

  .home {
    width: auto;
    padding-top: 0;
  }

  .content-reveal {
    margin-top: 0;
    margin-bottom: 50vh;
    width: 100%;
    margin-left: 0;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Sections */
  .section {
    padding: 48px 0;
  }

  .section-head {
    margin-bottom: 28px;
  }

  .section-label {
    font-size: 0.72rem;
  }

  /* Experience */
  .exp-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .exp-date {
    text-align: left;
  }

  /* Projects */
  .list-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .list-visit {
    display: none;
  }

  /* Expertise pillars */
  .pillar-grid {
    grid-template-columns: 1fr;
  }

  /* Pick my brain */
  .ask {
    padding: 48px 0;
  }

  .ask-title {
    font-size: 1.8rem;
  }

  .ask-sub {
    font-size: 0.9rem;
  }

  .ask-chat {
    max-height: 300px;
  }

  .ask-message {
    max-width: 92%;
    font-size: 0.88rem;
  }

  .ask-box {
    padding-left: 16px;
  }

  .ask-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
  }

  /* Cursors off */
  body.custom-cursor,
  body.custom-cursor * {
    cursor: auto;
  }

  .cursor {
    display: none;
  }

  /* Footer */
  .footer-name-bg {
    padding: 28px 20px 24px;
    height: 65vh;
    grid-template-rows: 1fr auto auto;
  }

  .footer-name {
    font-size: clamp(3.5rem, 17vw, 7rem);
  }

  .footer-row {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .footer-middle {
    padding: 16px 0 24px;
  }
}

/* ===== TYPOGRAPHY REFINEMENTS ===== */
h1, h2, h3 {
  text-wrap: balance;
}

.ask-title,
.expertise-lead,
.project-name {
  text-wrap: balance;
}

/* ===== DARK FOOTER NAME ===== */
.footer-name-bg {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1;
  background: #000;
  background-image: linear-gradient(to right, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: var(--grid-col) 100%;
  background-position: var(--grid-offset, calc((100vw - var(--grid-width)) / 2)) top;
  width: 100vw;
  height: 75vh;
  display: grid;
  grid-template-rows: 1fr auto auto;
  padding: clamp(32px, 4vh, 48px) var(--page-rail) clamp(24px, 3vh, 40px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

body.footer-reveal-active .footer-name-bg {
  opacity: 1;
  pointer-events: auto;
}

.footer-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(9rem, 16vw, 22rem);
  color: #ffffff;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  user-select: none;
  align-self: end;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.footer-middle {
  padding: 24px 0 40px;
}

.footer-name-bg .footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-name-bg .footer-link {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  font-family: var(--font-body);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 0;
  padding: 0;
  background: none;
  transition: color 0.18s ease;
}

.footer-name-bg .footer-link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.footer-link-arrow {
  font-size: 0.8rem;
  opacity: 0.7;
}

.footer-back-top {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-family: var(--font-body);
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-back-top:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 32px 0 52px;
  border-top: 1px solid var(--line-strong);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-back {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-back:hover {
  color: var(--text);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .hero-name .line-1,
  .hero-name .line-2,
  .hero-blurb,
  .hero-cta,
  .fixed-topleft,
  .fixed-topright {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pillar-card {
    transition: border-color 0.15s ease;
  }

  .pillar-card:hover {
    transform: none;
    box-shadow: none;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15ms !important;
  }
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line-strong);
  padding: 56px 0 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

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

.footer-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.footer-photos img:hover {
  opacity: 1;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.88rem;
  color: var(--text-soft);
  text-decoration: none;
  background: transparent;
  transition: var(--transition);
}

.footer-link:hover {
  border-color: var(--text);
  color: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-back {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-back:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .footer-photos {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
