:root {
  --paper: #f3ede2;
  --paper-2: #fbf7ef;
  --ink: #1c1b18;
  --muted: #6b655b;
  --line: rgba(28, 27, 24, 0.18);
  --accent: #d9481c;
  --accent-ink: #ffffff;
  --highlight: #f0d98a;
  --peach: #f9dfcd;
  --sage: #d9dfd0;
  --blob: #f1e8da;
  --blob2: #e8dcc9;
  --peach-shade: #f1c3a6;
  --ball-hi: rgba(255, 255, 255, 0.7);
  --green: #2f7d5b;
  --pad: clamp(20px, 5vw, 72px);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
  --paper: #151412;
  --paper-2: #1e1d1a;
  --ink: #f1ebdf;
  --muted: #a39b8d;
  --line: rgba(241, 235, 223, 0.2);
  --accent: #ff7a4d;
  --accent-ink: #151412;
  --highlight: #4a4020;
  --peach: #46302a;
  --sage: #2c352d;
  --blob: #26231f;
  --blob2: #1f1c19;
  --peach-shade: #36231d;
  --ball-hi: rgba(255, 255, 255, 0.16);
  --green: #5cc59a;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}
body.is-loading { overflow: hidden; height: 100vh; }
body.menu-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.9em; background: var(--highlight); padding: 1px 6px; border-radius: 4px; }

/* outlines only while navigating by keyboard (focus.js adds .kb); never after a click or tap */
:focus, :focus-visible { outline: none; }
html.kb :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--highlight); color: var(--ink); }

/* ---------- progress, loader ---------- */
.progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 140; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

.loader { position: fixed; inset: 0; z-index: 300; background: #1c1b18; display: grid; place-items: center; }
.loader__word { font-family: var(--serif); font-size: clamp(56px, 12vw, 160px); color: #f3ede2; line-height: 1; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 120;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px var(--pad);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.nav.is-solid { background: var(--paper); border-bottom-color: var(--line); }
.nav__name { font-family: var(--serif); font-size: 26px; line-height: 1; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.logo-paw { width: 18px; height: 18px; fill: var(--accent); transition: transform 0.4s var(--ease); }
.nav__name:hover .logo-paw { transform: rotate(-24deg) scale(1.25); }
.nav__links { display: flex; gap: clamp(14px, 2.2vw, 32px); font-size: 15px; }
.nav__links a { position: relative; padding: 4px 0; white-space: nowrap; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.3s ease; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }
.nav__right { display: flex; align-items: center; gap: 10px; }
.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
@keyframes pawWiggle {
  0% { transform: rotate(0deg) scale(1); }
  22% { transform: rotate(-24deg) scale(1.36); }
  45% { transform: rotate(16deg) scale(1.22); }
  68% { transform: rotate(-14deg) scale(1.3); }
  100% { transform: rotate(-20deg) scale(1.28); }
}

.cta-paw, .btn-paw {
  width: 15px;
  height: 15px;
  fill: var(--accent);
  transition: transform 0.35s var(--ease), fill 0.25s ease;
  flex-shrink: 0;
}
.nav__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 20px rgba(217, 72, 28, 0.32);
}
.nav__cta:hover .cta-paw,
.btn:hover .btn-paw,
.sheet__resume:hover .cta-paw {
  fill: var(--accent-ink);
  animation: pawWiggle 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.nav__cta:active {
  transform: translateY(0) scale(0.97);
}

.theme { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; position: relative; overflow: hidden; transition: background 0.2s, transform 0.3s var(--ease); }
.theme:hover { background: var(--highlight); transform: rotate(18deg); }
.theme svg { position: absolute; width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; transition: transform 0.5s var(--ease), opacity 0.3s; }
.theme__moon { transform: translateY(140%) rotate(-60deg); opacity: 0; }
[data-theme="dark"] .theme__sun { transform: translateY(-140%) rotate(60deg); opacity: 0; }
[data-theme="dark"] .theme__moon { transform: none; opacity: 1; }
/* sound toggle: one icon at a time, swapped with the same slide as the theme toggle */
.sfx__off { transform: translateY(140%) rotate(-60deg); opacity: 0; }
.sfx.is-muted .sfx__on { transform: translateY(-140%) rotate(60deg); opacity: 0; }
.sfx.is-muted .sfx__off { transform: none; opacity: 1; }

.menu { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); position: relative; }
.menu span { position: absolute; left: 11px; width: 16px; height: 1.8px; background: var(--ink); transition: transform 0.35s var(--ease), top 0.35s var(--ease); }
.menu span:nth-child(1) { top: 15px; }
.menu span:nth-child(2) { top: 22px; }
.menu[aria-expanded="true"] span:nth-child(1) { top: 18.5px; transform: rotate(45deg); }
.menu[aria-expanded="true"] span:nth-child(2) { top: 18.5px; transform: rotate(-45deg); }

.sheet { position: fixed; inset: 0; z-index: 110; background: var(--paper); padding: 110px var(--pad) 40px; visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path 0.55s var(--ease), visibility 0s linear 0.55s; }
.sheet.is-open { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path 0.55s var(--ease), visibility 0s; }
.sheet nav { display: flex; flex-direction: column; gap: 6px; }
.sheet a, .sheet__resume { font-family: var(--serif); font-size: clamp(38px, 10vw, 60px); line-height: 1.15; opacity: 0; transform: translateY(24px); transition: opacity 0.4s, transform 0.5s var(--ease), color 0.2s; text-align: left; }
.sheet.is-open a, .sheet.is-open .sheet__resume { opacity: 1; transform: none; }
.sheet.is-open a:nth-child(2) { transition-delay: 0.05s; } .sheet.is-open a:nth-child(3) { transition-delay: 0.1s; }
.sheet.is-open a:nth-child(4) { transition-delay: 0.15s; } .sheet.is-open a:nth-child(5) { transition-delay: 0.2s; }
.sheet.is-open a:nth-child(6) { transition-delay: 0.25s; } .sheet.is-open .sheet__resume { transition-delay: 0.3s; }
.sheet a:hover, .sheet__resume:hover { color: var(--accent); }
.sheet__resume { display: inline-flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--line); color: var(--accent); }
.sheet__resume .cta-paw { width: 28px; height: 28px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(217, 72, 28, 0.28);
}
.btn:hover .btn-paw {
  fill: var(--accent-ink);
  transform: rotate(-22deg) scale(1.28);
}
.btn:active {
  transform: translateY(0) scale(0.97);
}
.btn--line {
  background: transparent;
  color: var(--ink);
}
.btn--line:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 0 6px 20px rgba(28, 27, 24, 0.2);
}
[data-theme="dark"] .btn--line:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.btn--resume:hover,
[data-theme="dark"] .btn--resume:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(217, 72, 28, 0.35);
}
.btn--gh:hover,
[data-theme="dark"] .btn--gh:hover {
  background: #24292e;
  border-color: #24292e;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- shared ---------- */
.section { padding: clamp(80px, 11vw, 150px) var(--pad); }
.label { font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 40px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.h2 { font-family: var(--serif); font-size: clamp(44px, 7.5vw, 112px); line-height: 1; letter-spacing: -0.01em; font-weight: 400; }
.h3 { font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1.05; }
.line { display: block; overflow: hidden; padding: 0.04em 0 0.1em; margin-bottom: -0.04em; }
.line__in { display: block; }
em { font-style: italic; color: var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 130px var(--pad) 90px; overflow: hidden; }
.hero__hello { font-size: 15px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.hero__title { font-family: var(--serif); font-weight: 400; font-size: clamp(54px, 11vw, 190px); line-height: 0.95; letter-spacing: -0.015em; }
.scribble { position: relative; display: inline-block; font: inherit; color: inherit; line-height: inherit; cursor: pointer; }
.scribble svg { position: absolute; left: -2%; bottom: -0.1em; width: 104%; height: 0.2em; overflow: visible; pointer-events: none; }
.scribble path { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.rotator { display: inline-block; position: relative; overflow: hidden; vertical-align: bottom; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.rotator em { display: inline-block; }
.hero__sub { margin-top: 34px; max-width: 640px; font-size: clamp(18px, 1.7vw, 22px); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 28px; display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.hero__foot .scroll { position: absolute; left: 50%; transform: translateX(-50%); }

.badge { position: absolute; right: var(--pad); top: 130px; width: clamp(110px, 12vw, 170px); aspect-ratio: 1; display: grid; place-items: center; }
.badge__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.badge__ring text { font-size: 14px; font-family: var(--sans); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ink); }
.badge__dot { width: 22%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); animation: beat 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(30px, 5vw, 80px); align-items: start; }
.about__text { font-family: var(--serif); font-size: clamp(28px, 3.3vw, 50px); line-height: 1.15; }
.about__text .w { color: var(--ink); opacity: 0.2; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(50px, 8vw, 100px); border-top: 1.5px solid var(--ink); }
.stat { padding: 26px 20px 8px 0; transition: transform 0.35s var(--ease); }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat:hover { transform: translateY(-5px); }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 7vw, 110px); line-height: 1; color: var(--accent); }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 15px; }

/* ---------- experience ---------- */
.exp__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(30px, 5vw, 80px); align-items: start; }
.timeline { position: relative; padding-left: 38px; }
.timeline__line { position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline__line span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleY(0); transform-origin: 50% 0; }
.job { position: relative; padding-bottom: 54px; }
.job:last-child { padding-bottom: 0; }
.job__dot { position: absolute; left: -38px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); transition: background 0.4s, border-color 0.4s, transform 0.4s var(--ease); }
.job.is-on .job__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.job__date { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.job h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; margin: 6px 0 14px; }
.job h3 span { display: block; font-family: var(--sans); font-size: 17px; color: var(--muted); margin-top: 6px; }
.job li { position: relative; padding-left: 20px; margin-top: 8px; }
.job li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--accent); }
.job__tags { margin-top: 16px; font-size: 14px; color: var(--muted); }


/* ---------- work ---------- */
.work__head { padding-top: 0; padding-bottom: 40px; }
.work__hint { margin-top: 20px; color: var(--muted); }
.work__pin { position: relative; overflow: hidden; }
.work__track {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  padding: 20px var(--pad) 70px;
  width: max-content;
  will-change: transform;
  transform: translateZ(0);
}
.card {
  flex: 0 0 auto; width: min(80vw, 540px); display: flex; flex-direction: column;
  background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden;
  transition: transform 0.4s var(--ease);
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.card:hover { transform: translateY(-8px) rotate(-0.6deg); }
.card__media { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card__body { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; position: relative; }
.card[data-project] .card__body { cursor: pointer; }
.card__no { position: absolute; top: 18px; right: 26px; font-family: var(--serif); font-size: 36px; color: var(--accent); line-height: 1; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.2vw, 44px); line-height: 1; padding-right: 50px; }
.card__kicker { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.card p { font-size: 16px; }
.card .card__tags { color: var(--muted); font-size: 14px; }
.card__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: auto; padding-top: 14px; font-weight: 500; }
.card__links a, .more { border-bottom: 1.5px solid var(--ink); padding-bottom: 1px; transition: color 0.2s, border-color 0.2s; }
.more { color: var(--accent); border-color: var(--accent); }
.card__links a:hover, .more:hover { color: var(--accent); border-color: var(--accent); }
.more::after { content: " +"; display: inline-block; transition: transform 0.35s var(--ease); }
.more:hover::after { transform: rotate(90deg); }

.card--more { background: var(--highlight); }
.card__more { padding: clamp(26px, 4vw, 46px); display: flex; flex-direction: column; gap: 20px; height: 100%; justify-content: center; align-items: flex-start; }
.card__more h3 { font-size: clamp(44px, 5vw, 70px); padding: 0; }
.card__more ul { width: 100%; }
.card__more li a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1.5px solid var(--ink); font-size: 20px; font-weight: 500; transition: padding 0.25s; }
.card__more li a span { font-weight: 400; font-size: 14px; opacity: 0.7; }
.card__more li a:hover { padding-left: 10px; }
.card--more .btn:hover { background: var(--paper); border-color: var(--ink); color: var(--ink); }

.work__ui { position: absolute; left: var(--pad); right: var(--pad); bottom: 22px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.work__ui #workCount { color: var(--ink); font-weight: 500; }
.work__bar { flex: 1; height: 2px; background: var(--line); margin-left: 12px; }
.work__bar span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
@media (min-width: 761px) {
  .work__pin { height: 100vh; display: flex; align-items: center; }
  .work__track { padding-bottom: 90px; }
}

/* ---------- skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(26px, 3.4vw, 52px) clamp(24px, 3vw, 48px); }
.skill { padding-top: 18px; border-top: 1.5px solid var(--ink); }
.skill h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 15px; font-weight: 500; background: transparent; cursor: default; transition: background 0.2s, color 0.2s, transform 0.3s var(--ease); }
.chips li:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-4px) rotate(-2deg); }

/* ---------- beyond ---------- */
.oss { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(30px, 6vw, 90px); align-items: center; }
.oss__sub { margin-top: 26px; max-width: 560px; color: var(--muted); font-size: 18px; }
.oss__link { display: inline-block; margin-top: 22px; font-weight: 500; border-bottom: 1.5px solid var(--ink); transition: color 0.2s, border-color 0.2s; }
.oss__link:hover { color: var(--accent); border-color: var(--accent); }
.prs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 360px; justify-self: end; width: 100%; }
.prs span { aspect-ratio: 1; border-radius: 6px; background: var(--line); transition: background 0.3s, transform 0.3s var(--ease); }
.prs span.is-on { background: var(--accent); }
.prs span:hover { transform: scale(1.18) rotate(6deg); background: var(--green); }

.wins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: clamp(60px, 8vw, 110px); }
.win { padding: 26px 24px 28px; background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 14px; transition: transform 0.4s var(--ease), background 0.3s; }
.win:hover { transform: translateY(-8px) rotate(-1deg); background: var(--highlight); }
.win__tag { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.win h3 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; margin: 8px 0 10px; color: var(--accent); }
.win p:last-child { font-size: 16px; }

/* ---------- chess: Daily 5 Mate Challenge ---------- */
.chess {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  margin-top: clamp(70px, 9vw, 130px);
  margin-bottom: clamp(60px, 8vw, 120px);
  padding: clamp(24px, 4vw, 56px);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: var(--paper-2);
}
@media (max-width: 880px) {
  .chess {
    grid-template-columns: 1fr;
    gap: 36px;
    margin-bottom: 80px;
  }
}
.chess__badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.chess__daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.chess__streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--highlight);
  color: #1c1b18;
  border: 1.5px solid var(--ink);
}
.chess__streak-badge::before {
  content: "♞";
  font-size: 15px;
  line-height: 1;
  color: var(--accent);
}
.chess__text .h3 {
  color: var(--ink);
  margin: 14px 0 0;
  font-size: clamp(38px, 4.6vw, 62px);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}
.chess__desc {
  margin-top: 10px;
  color: var(--muted);
  max-width: 480px;
  font-size: 15.5px;
  line-height: 1.5;
}

/* puzzle tabs / pills */
.chess__pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}
.chess__pills .pill {
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.chess__pills .pill:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.chess__pills .pill.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-2px, -2px);
}
.chess__pills .pill.is-solved {
  background: var(--highlight);
  color: #1c1b18;
  border-color: var(--ink);
}
.chess__pills .pill.is-active.is-solved {
  background: var(--accent);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
/* status card */
.chess__status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--accent);
  margin-bottom: 22px;
}
.chess__turn-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.chess__turn-dot {
  font-size: 15px;
  line-height: 1;
}
.chess__motif {
  font-size: 12px;
  font-weight: 700;
  color: #1c1b18;
  background: var(--highlight);
  border: 1.5px solid var(--ink);
  padding: 3px 11px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* controls */
.chess__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.btn-chess {
  padding: 9px 17px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-chess:hover {
  background: var(--highlight);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-chess:active {
  transform: translate(0, 0);
  box-shadow: none;
}
.btn-chess--next {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
}
.btn-chess--next:hover {
  background: var(--accent);
  border-color: var(--ink);
  color: #fff;
}
.chess__msg {
  min-height: 3.4em;
  padding: 11px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chess__msg.is-success {
  color: var(--ink);
  font-weight: 600;
  border: 1.5px solid var(--ink);
  background: var(--highlight);
}
.chess__msg.is-error {
  color: #8f1d14;
  border: 1.5px solid #d32f2f;
  background: rgba(211, 47, 47, 0.09);
}

/* board wrapper: refined tournament bezel */
.chess__board-wrap {
  position: relative;
  width: min(100%, 450px);
  justify-self: center;
  padding: 0;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  user-select: none;
}
@media (max-width: 880px) {
  .chess__board-wrap {
    justify-self: center;
    margin: 0 auto;
  }
}

/* gchessboard, themed with the site colours */
g-chess-board {
  display: block;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  --square-color-light: #fbe6cc;
  --square-color-dark: var(--accent);
  --square-color-light-hover: #f6d98b;
  --square-color-dark-hover: #e0662f;
  --square-color-light-active: #f0d98a;
  --square-color-dark-active: #d9792f;
  --outline-color-light-active: rgba(28, 27, 24, 0.85);
  --outline-color-dark-active: rgba(28, 27, 24, 0.85);
  --outline-color-focus: var(--ink);
  --inner-border-color: transparent;
  --move-target-marker-color-light-square: rgba(28, 27, 24, 0.32);
  --move-target-marker-color-dark-square: rgba(28, 27, 24, 0.32);
  --arrow-color-primary: rgba(28, 27, 24, 0.75);
  --coords-font-family: var(--sans, "DM Sans", system-ui, sans-serif);
  --coords-font-size: 0.72rem;
}
[data-theme="dark"] g-chess-board {
  --square-color-light: #c9b89c;
  --square-color-dark: #a5441f;
}
g-chess-board.is-shaking {
  animation: boardShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}
@keyframes boardShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}
.chess__last { height: 100%; background: rgba(240, 217, 138, 0.6); }
.chess__check { height: 100%; background: radial-gradient(ellipse at center, #e11d1d 0%, rgba(225, 29, 29, 0.85) 25%, rgba(225, 29, 29, 0) 80%); }

/* ---------- contact ---------- */
.contact { padding-top: clamp(40px, 6vw, 80px); }
.contact__title { font-family: var(--serif); font-size: clamp(50px, 10vw, 160px); line-height: 0.95; letter-spacing: -0.015em; }
.contact__sub { margin-top: 34px; max-width: 540px; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); }
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 30px; }
.contact__mail { display: inline-block; font-family: var(--serif); font-size: clamp(28px, 5vw, 76px); line-height: 1.1; border-bottom: 4px solid var(--accent); padding: 0 4px 6px; transition: background 0.25s, color 0.25s; word-break: break-word; }
.contact__mail:hover { background: var(--accent); color: var(--accent-ink); }
.copy { display: inline-flex; align-items: center; justify-content: center; padding: 14px 26px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 16px; font-weight: 500; transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s ease; }
.copy:hover { background: var(--ink); color: var(--paper); transform: translateY(-3px) scale(1.02); box-shadow: 0 6px 20px rgba(28, 27, 24, 0.2); }
.copy:active { transform: translateY(0) scale(0.97); }
.copy.is-done { background: var(--green); border-color: var(--green); color: var(--paper); }
.socials { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 40px; font-weight: 500; }
.socials a { border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.socials a:hover { color: var(--accent); border-color: var(--accent); }

.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; justify-content: space-between; padding: 26px calc(var(--pad) + clamp(96px, 11vw, 150px)) 26px var(--pad); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer a:hover { color: var(--accent); }

/* ---------- dialog ---------- */
.dialog { margin: auto; width: min(92vw, 640px); max-height: 88vh; overflow: auto; padding: 0; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--paper-2); color: var(--ink); }
.dialog::backdrop { background: rgba(20, 19, 17, 0.55); }
.dialog__close { position: absolute; z-index: 5; top: 14px; right: 16px; width: 38px; height: 38px; border-radius: 50%; font-size: 26px; line-height: 1; border: 1.5px solid var(--ink); display: grid; place-items: center; transition: background 0.2s, color 0.2s, transform 0.3s var(--ease); }
.dialog__close:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }
.dialog__body { padding: clamp(24px, 4vw, 40px); }
.dialog__body h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 52px); line-height: 1; padding-right: 50px; }
.d-kicker { margin-top: 8px; color: var(--muted); font-weight: 500; }
.dialog__body ul { margin-top: 22px; }
.dialog__body li { position: relative; padding-left: 22px; margin-top: 12px; }
.dialog__body li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 2px; background: var(--accent); }
.dialog__body li b { font-weight: 700; }
.d-tags { margin-top: 20px; font-size: 14px; color: var(--muted); }
.d-links { display: flex; gap: 22px; margin-top: 22px; font-weight: 500; }
.d-links a { border-bottom: 1.5px solid var(--ink); transition: color 0.2s, border-color 0.2s; }
.d-links a:hover { color: var(--accent); border-color: var(--accent); }
.d-note { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- resume preview dialog ---------- */
.r-exp {
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
}
.r-exp__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 15px;
}
.r-exp__head span {
  font-size: 13px;
  color: var(--muted);
}
.r-exp p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.chips--resume li {
  font-size: 13.5px;
  padding: 5px 12px;
}
.social-btn {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.social-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
@media (max-width: 600px) {
  }

/* confetti pieces */
.confetti { position: fixed; z-index: 400; left: 0; top: 0; width: 10px; height: 10px; pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .menu { display: block; }
}
@media (max-width: 1000px) {
  .about__grid, .exp__grid, .oss, .chess { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 24px; }
  .skills__grid { grid-template-columns: repeat(2, 1fr); }
  .wins { grid-template-columns: repeat(2, 1fr); }
  .prs, .board { justify-self: start; }
}
@media (max-width: 760px) {
  .badge { display: none; }
  .hero { padding-top: 110px; }
  .nav__cta { display: none; }
  .work__pin { overflow: visible; }
  .work__track { flex-direction: column; width: auto; padding: 10px var(--pad) 40px; }
  .card { width: 100%; }
  .work__ui { display: none; }
}
@media (max-width: 560px) {
  .skills__grid, .wins { grid-template-columns: 1fr; }
  .stat b { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge__ring, .badge__dot, .sq.legal::after { animation: none; }
  .card, .win, .stat, .chips li, .now { transition: none; }
}


/* =====================================================================
   Paws, sparkles and Mango the cat
===================================================================== */
.pawtoggle { padding: 5px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); transition: color 0.2s, border-color 0.2s, background 0.2s; }
.pawtoggle:hover { color: var(--ink); border-color: var(--ink); }
.pawtoggle[aria-pressed="false"] { text-decoration: line-through; }

/* twinkling sparkles in the hero */
.spark { position: absolute; fill: var(--accent); pointer-events: none; transform-origin: 50% 50%; animation: twinkle 3.6s ease-in-out infinite; }
.spark--a { width: 30px; right: 24%; top: 21%; }
.spark--b { width: 18px; right: 12%; top: 46%; fill: var(--green); animation-delay: -1.2s; }
.spark--c { width: 22px; right: 33%; top: 64%; fill: var(--highlight); animation-delay: -2.2s; }
[data-theme="dark"] .spark--c { fill: #c9a94a; }
@keyframes twinkle { 0%, 100% { transform: scale(0.5) rotate(0deg); opacity: 0.5; } 50% { transform: scale(1.15) rotate(35deg); opacity: 1; } }

/* paw prints that "walk" between sections */
.pawwalk {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad);
  height: 70px;
  overflow: hidden;
  position: relative;
  user-select: none;
  content-visibility: auto;
  contain-intrinsic-size: 70px;
  --paw-shadow: rgba(217, 72, 28, 0.4);
  --paw-shadow-soft: rgba(217, 72, 28, 0.18);
  --paw-base-op: 0.38;
}
[data-theme="dark"] .pawwalk {
  --paw-shadow: rgba(255, 122, 77, 0.5);
  --paw-shadow-soft: rgba(255, 122, 77, 0.22);
  --paw-base-op: 0.44;
}
.pawwalk i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(18px, 2vw, 24px);
  height: clamp(18px, 2vw, 24px);
  flex-shrink: 0;
  opacity: var(--paw-base-op);
  transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(0.95);
  animation: pawWalkStep 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.16s);
  transition: opacity 0.3s ease, transform 0.3s var(--ease), filter 0.3s ease;
  will-change: transform, opacity;
}
.pawwalk i:nth-child(odd) {
  --y: -9px;
  --rot: 84deg;
}
.pawwalk i:nth-child(even) {
  --y: 9px;
  --rot: 96deg;
}
.pawwalk svg {
  width: 100%;
  height: 100%;
  fill: var(--accent);
  transition: fill 0.3s ease;
}

@keyframes pawWalkStep {
  0%, 100% {
    opacity: var(--paw-base-op);
    transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(0.94);
    filter: none;
  }
  16% {
    opacity: 0.98;
    transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(1.15);
    filter: drop-shadow(0 2px 6px var(--paw-shadow));
  }
  32% {
    opacity: 0.68;
    transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(1.02);
    filter: drop-shadow(0 1px 3px var(--paw-shadow-soft));
  }
  48% {
    opacity: var(--paw-base-op);
    transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(0.94);
    filter: none;
  }
}

.pawwalk i:hover {
  opacity: 1 !important;
  transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(1.28) !important;
  filter: drop-shadow(0 3px 8px var(--paw-shadow)) !important;
  cursor: pointer;
}

/* footprints that follow the cursor */
.trail-paw { position: fixed; left: 0; top: 0; z-index: 85; width: 22px; height: 22px; pointer-events: none; fill: var(--accent); opacity: 0; animation: trail 1.7s ease-out forwards; }
@keyframes trail { 0% { opacity: 0.4; transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(0.6); } 20% { opacity: 0.35; transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1); } }

/* paws and hearts that pop out of the cat */
.pop { position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; font-size: 18px; line-height: 1; color: var(--accent); animation: popout 1.05s cubic-bezier(.15, .8, .3, 1) forwards; }
.pop svg { width: 22px; height: 22px; fill: currentColor; display: block; }
@keyframes popout { 0% { opacity: 1; transform: translate(var(--x), var(--y)) scale(0.4) rotate(0deg); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))) scale(1.1) rotate(var(--rot)); } }

/* meow rain */
.rain-paw { position: fixed; top: -50px; z-index: 390; width: 26px; height: 26px; fill: var(--accent); pointer-events: none; animation: rain 2.6s linear forwards; }
@keyframes rain { to { transform: translateY(calc(100vh + 80px)) rotate(var(--rot)); } }

/* ---------- Mango ---------- */
.catwrap { position: fixed; right: clamp(6px, 2vw, 26px); bottom: 0; z-index: 90; width: clamp(100px, 11vw, 156px); pointer-events: none; opacity: 0; transform: translateY(60px); transition: opacity 0.7s ease, transform 0.9s var(--ease); }
.catwrap.is-here { opacity: 1; transform: none; }
.cat { display: block; width: 100%; padding: 0; pointer-events: auto; cursor: pointer; transform: translateY(38%); transition: transform 0.6s var(--ease); -webkit-tap-highlight-color: transparent; border-radius: 40% 40% 0 0; }
.cat:hover, .cat:focus-visible, .catwrap.is-up .cat { transform: translateY(6%); }
.cat__svg { display: block; width: 100%; height: auto; overflow: visible; }

.cat__tail { transform-box: fill-box; transform-origin: 12% 96%; animation: wag 1.9s ease-in-out infinite; }
@keyframes wag { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(11deg); } }
.cat__body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.02); } }
.cat__head { transform-box: fill-box; transform-origin: 50% 85%; transform: rotate(var(--tilt, 0deg)); transition: transform 0.3s ease; will-change: transform; }
.cat__eye { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 5.6s infinite; }
@keyframes blink { 0%, 93%, 97%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }
.cat__ear--r { transform-box: fill-box; transform-origin: 25% 100%; animation: twitch 7.5s infinite; }
@keyframes twitch { 0%, 88%, 100% { transform: none; } 91% { transform: rotate(9deg); } 94% { transform: rotate(-5deg); } 97% { transform: rotate(4deg); } }
.cat__pupil { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform 0.12s ease-out; will-change: transform; }
.cat__lid { opacity: 0; }

.catwrap.is-purr .cat__svg { animation: purr 0.11s linear 7; }
@keyframes purr { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(1.6px); } }

.catwrap.is-asleep .cat__eye { animation: none; opacity: 0; }
.catwrap.is-asleep .cat__lid { opacity: 1; }
.catwrap.is-asleep .cat__tail { animation-duration: 5s; }
.catwrap.is-asleep .cat__head { --tilt: 9deg; }
.catwrap.is-asleep .cat { transform: translateY(26%); }

.zzz { position: absolute; right: 14%; top: 4%; font-family: var(--serif); font-style: italic; color: var(--muted); pointer-events: none; }
.zzz span { position: absolute; left: 0; top: 0; opacity: 0; font-size: 18px; }
.catwrap.is-asleep .zzz span { animation: zzz 3s ease-in-out infinite; }
.catwrap.is-asleep .zzz span:nth-child(2) { animation-delay: 1s; font-size: 22px; }
.catwrap.is-asleep .zzz span:nth-child(3) { animation-delay: 2s; font-size: 28px; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 10px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -34px); } }

.cat__bubble {
  position: absolute;
  right: 38%;
  bottom: calc(100% - 6px);
  max-width: min(300px, 78vw);
  width: max-content;
  margin: 0;
  padding: 11px 16px;
  background: var(--paper-2);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 18px 18px 4px 18px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(28, 27, 24, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transform-origin: 100% 100%;
  transition: opacity 0.25s ease, transform 0.4s var(--ease);
}
.cat__bubble.is-on { opacity: 1; transform: none; }
.cat__bubble.is-compact { right: 0; max-width: 190px; font-size: 13px; }
.cat__bubble.is-hidden { visibility: hidden; }
[data-theme="dark"] .cat__bubble { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); }

@media (max-width: 760px) {
  .hero__foot .scroll { display: none; }
  .catwrap { width: 92px; }
  .cat__bubble { right: 14px; max-width: min(260px, calc(100vw - 36px)); font-size: 13px; padding: 10px 14px; }
  .spark--a { right: 10%; top: 17%; }
  .spark--c { display: none; }
  .footer { padding-right: calc(var(--pad) + 96px); }
}
@media (prefers-reduced-motion: reduce) {
  .spark, .cat__tail, .cat__body, .cat__eye, .cat__ear--r, .catwrap.is-purr .cat__svg,
  .catwrap[data-mood="excited"] .cat__svg,
  .catwrap[data-mood="surprised"] .cat__svg,
  .catwrap[data-mood="love"] .e-love path,
  .catwrap[data-mood="sleepy"] .m-open,
  .catwrap[data-mood="annoyed"] .cat__tail,
  .catwrap[data-mood="dizzy"] .cat__head,
  .catwrap[data-mood="sad"] .tear,
  .catwrap.is-asleep .zzz span,
  .cat__svg .spin {
    animation: none !important;
  }
  .pawwalk i {
    animation: none !important;
    opacity: 0.65 !important;
    transform: translateY(var(--y, 0)) rotate(var(--rot, 90deg)) scale(1) !important;
  }
}



/* =====================================================================
   Mango's moods
===================================================================== */
.cat__svg .e-lidhalf, .cat__svg .e-brows, .cat__svg .e-happy, .cat__svg .e-love, .cat__svg .e-dizzy, .cat__svg .blush, .cat__svg .sweat { opacity: 0; transition: opacity 0.2s ease; }
.cat__svg .m { opacity: 0; transition: opacity 0.15s ease; }
.cat__svg .m-smile { opacity: 1; }
.cat__eye ellipse:first-child { transform-box: fill-box; transform-origin: 50% 50%; transition: transform 0.2s ease; }
.pup { transform-box: fill-box; transform-origin: 50% 50%; transition: transform 0.25s ease; }
.cat__ear { transition: transform 0.3s ease; }
.cat__ear--l { transform-box: fill-box; transform-origin: 75% 100%; }
.cat__svg .spin { transform-box: fill-box; transform-origin: 50% 50%; animation: spin-eye 0.7s linear infinite; }
@keyframes spin-eye { to { transform: rotate(360deg); } }

/* night vision: big pupils when the dark theme is on */
.catwrap[data-night="true"] .pup { transform: scale(1.55, 1.12); }

/* happy and excited: ^ ^ eyes, blush, big smile */
.catwrap:is([data-mood="happy"], [data-mood="excited"], [data-mood="love"], [data-mood="dizzy"]) .cat__eye { opacity: 0; animation: none; }
.catwrap:is([data-mood="happy"], [data-mood="excited"]) .e-happy { opacity: 1; }
.catwrap:is([data-mood="happy"], [data-mood="excited"], [data-mood="love"]) .blush { opacity: 0.8; }
.catwrap:is([data-mood="happy"], [data-mood="excited"], [data-mood="love"]) .m-smile { opacity: 0; }
.catwrap:is([data-mood="happy"], [data-mood="excited"], [data-mood="love"]) .m-big { opacity: 1; }
.catwrap[data-mood="happy"] .cat__tail { animation-duration: 0.9s; }
.catwrap[data-mood="excited"] .cat__tail { animation-duration: 0.4s; }
.catwrap[data-mood="excited"] .cat__svg { animation: hop 0.45s ease-in-out 4; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-14px); } }

/* love: heart eyes */
.catwrap[data-mood="love"] .e-love { opacity: 1; }
.catwrap[data-mood="love"] .e-love path { transform-box: fill-box; transform-origin: 50% 60%; animation: heartbeat 0.7s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.22); } }
.catwrap[data-mood="love"] .cat__tail { animation-duration: 2.4s; }

/* surprised: wide eyes, tiny pupils, open mouth, sweat drop */
.catwrap[data-mood="surprised"] .cat__eye ellipse:first-child { transform: scale(1.2); }
.catwrap[data-mood="surprised"] .pup { transform: scale(0.55, 0.6); }
.catwrap[data-mood="surprised"] .m-smile { opacity: 0; }
.catwrap[data-mood="surprised"] .m-open { opacity: 1; }
.catwrap[data-mood="surprised"] .sweat { opacity: 1; }
.catwrap[data-mood="surprised"] .cat__ear--l { transform: rotate(-7deg); }
.catwrap[data-mood="surprised"] .cat__ear--r { animation: none; transform: rotate(7deg); }
.catwrap[data-mood="surprised"] .cat__svg { animation: jolt 0.35s ease-out; }
@keyframes jolt { 0% { transform: translateY(0); } 30% { transform: translateY(-12px); } 100% { transform: translateY(0); } }

/* sleepy: half lids, a yawn, head droop */
.catwrap[data-mood="sleepy"] { --mood-tilt: 7deg; }
.catwrap[data-mood="sleepy"] .e-lidhalf { opacity: 1; }
.catwrap[data-mood="sleepy"] .m-smile { opacity: 0; }
.catwrap[data-mood="sleepy"] .m-open { opacity: 1; animation: yawn 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 20%; }
@keyframes yawn { 0%, 100% { transform: scale(0.5); } 50% { transform: scale(1.15); } }
.catwrap[data-mood="sleepy"] .cat__tail { animation-duration: 4s; }

/* annoyed: heavy lids, brows, flat mouth, ears back, flicking tail */
.catwrap[data-mood="annoyed"] .e-lidhalf, .catwrap[data-mood="annoyed"] .e-brows { opacity: 1; }
.catwrap[data-mood="annoyed"] .m-smile { opacity: 0; }
.catwrap[data-mood="annoyed"] .m-flat { opacity: 1; }
.catwrap[data-mood="annoyed"] .cat__ear--l { transform: rotate(-17deg); }
.catwrap[data-mood="annoyed"] .cat__ear--r { animation: none; transform: rotate(17deg); }
.catwrap[data-mood="annoyed"] .cat__tail { animation: flick 0.32s ease-in-out infinite; }
@keyframes flick { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(7deg); } }

/* curious: head tilt, bigger eyes, one ear up */
.catwrap[data-mood="curious"] { --mood-tilt: 13deg; }
.catwrap[data-mood="curious"] .cat__eye ellipse:first-child { transform: scale(1.1); }
.catwrap[data-mood="curious"] .pup { transform: scale(1.2, 1.05); }
.catwrap[data-mood="curious"] .cat__ear--r { animation: none; transform: rotate(10deg) translateY(-2px); }

/* dizzy: spiral eyes, wobbly mouth, swaying head */
.catwrap[data-mood="dizzy"] .e-dizzy { opacity: 1; }
.catwrap[data-mood="dizzy"] .sweat { opacity: 1; }
.catwrap[data-mood="dizzy"] .m-smile { opacity: 0; }
.catwrap[data-mood="dizzy"] .m-wavy { opacity: 1; }
.catwrap[data-mood="dizzy"] .cat__head { animation: wobble 0.6s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }

/* head tilt now adds the mood tilt on top of the pointer tilt */
.cat__head { transform: rotate(calc(var(--tilt, 0deg) + var(--mood-tilt, 0deg))); }
.catwrap.is-asleep { --mood-tilt: 9deg; }
.catwrap.is-asleep .cat__head { --tilt: 0deg; }

/* =====================================================================
   Loader with a walking cat
===================================================================== */
.loader { overflow: hidden; }
.loader__sub { position: absolute; left: 0; right: 0; top: calc(50% + clamp(40px, 8vw, 100px)); text-align: center; margin: 0; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(243, 237, 226, 0.55); }
.loader__sub::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) {
  .loader__sub::after, .cat__svg .spin { animation: none; }
}

/* the last loader word is the cat's */
.loader__word.is-meow { color: #f08a24; font-style: italic; }

/* sad: for when there is no fish */
.cat__svg .e-sadbrows, .cat__svg .tear { opacity: 0; transition: opacity 0.2s ease; }
.catwrap[data-mood="sad"] { --mood-tilt: -3deg; }
.catwrap[data-mood="sad"] .e-sadbrows, .catwrap[data-mood="sad"] .tear { opacity: 1; }
.catwrap[data-mood="sad"] .tear { animation: tear 1.6s ease-in infinite; }
@keyframes tear { 0% { transform: translateY(0); opacity: 0.9; } 100% { transform: translateY(9px); opacity: 0; } }
.catwrap[data-mood="sad"] .m-smile { opacity: 0; }
.catwrap[data-mood="sad"] .m-sad { opacity: 1; }
.catwrap[data-mood="sad"] .pup { transform: scale(1.2, 1.15); }
.catwrap[data-mood="sad"] .cat__eye ellipse:first-child { transform: scale(1.06); }
.catwrap[data-mood="sad"] .cat__ear--l { transform: rotate(-11deg); }
.catwrap[data-mood="sad"] .cat__ear--r { animation: none; transform: rotate(11deg); }
.catwrap[data-mood="sad"] .cat__tail { animation-duration: 5.5s; }

.loader__sub.is-done::after { content: none; animation: none; }

/* chess section: calmer colours in dark mode */
[data-theme="dark"] .chess { border-color: var(--line); }
[data-theme="dark"] .chess__board-wrap { border-color: var(--line); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .chess__streak-badge,
[data-theme="dark"] .chess__motif { color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .chess__streak-badge::before { color: var(--accent); }
[data-theme="dark"] .chess__pills .pill { border-color: var(--line); }
[data-theme="dark"] .chess__pills .pill.is-solved { color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .chess__pills .pill.is-active,
[data-theme="dark"] .chess__pills .pill.is-active.is-solved { background: #c4421a; color: #fff; border-color: var(--line); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .chess__pills .pill:hover { box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .chess__status-card { border-color: var(--line); box-shadow: 4px 4px 0 #8e3515; }
[data-theme="dark"] .btn-chess { border-color: var(--line); }
[data-theme="dark"] .btn-chess:hover { background: var(--highlight); border-color: var(--line); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .btn-chess--next, [data-theme="dark"] .btn-chess--next:hover { background: #c4421a; color: #fff; border-color: var(--line); }
[data-theme="dark"] .chess__msg.is-success { color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .chess__msg.is-error { color: #ff9a8f; }

/* light/dark switch: circular reveal from the toggle (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
.theme-switching .catwrap, .theme-switching .pawwalk { view-transition-name: none; }

/* "see all projects" card at the end of the work track */
.card__more-lead { font-size: 18px; max-width: 28ch; }
.card--more .btn-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease); }
.card--more .btn:hover .btn-arrow { transform: translateX(4px); }
.card__more-link { font-weight: 500; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.card__more-link:hover { color: var(--accent); border-color: var(--accent); }


/* =====================================================================
   "Right now" card
===================================================================== */
.now { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 26px 24px 18px; background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 14px; transition: transform 0.4s var(--ease); isolation: isolate; }
.now:hover { transform: translateY(-6px) rotate(-0.6deg); }

/* soft shapes tucked into the right side */

.now__spark { position: absolute; fill: var(--accent); pointer-events: none; transform-origin: 50% 50%; animation: twinkle 3.8s ease-in-out infinite; }
.now__spark--1 { width: 14px; left: 8px; top: 26px; }
.now__spark--2 { width: 20px; right: 12%; top: 26px; animation-delay: -1.1s; }
.now__spark--3 { width: 12px; right: 7%; bottom: 36px; fill: var(--green); animation-delay: -2s; }
.now__spark--4 { width: 14px; right: 24%; bottom: 14px; animation-delay: -2.8s; }

.now__title { position: relative; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -0.01em; margin-bottom: 12px; }
.now__title em { position: relative; display: inline-block; padding-right: 0.1em; }
.now__swoosh { position: absolute; left: -2%; bottom: -0.16em; width: 104%; height: 0.22em; overflow: visible; }
.now__swoosh path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 0.9s var(--ease) 0.35s; }
.now__rays { position: absolute; right: -0.55em; top: -0.35em; width: 0.7em; height: 0.7em; overflow: visible; }
.now__rays path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: 0; transition: opacity 0.4s ease 1s; }
.now.is-in .now__swoosh path { stroke-dashoffset: 0; }
.now.is-in .now__rays path { opacity: 1; }

.now__list { list-style: none; position: relative; z-index: 1; max-width: 68%; margin-bottom: 8px; flex: 1; display: flex; flex-direction: column; }
.now__list li { position: relative; flex: 1; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; align-items: center; padding: 11px 0; opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.6s var(--ease); transition-delay: calc(var(--i) * 130ms + 250ms); }
.now__list li + li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.now.is-in .now__list li { opacity: 1; transform: none; }

.now__icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ink); transition: transform 0.4s var(--ease), background 0.3s; }
.now__icon--peach { background: var(--peach); }
.now__icon--sage { background: var(--sage); }
.now__icon svg { width: 27px; height: 27px; fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.now__icon .dot { fill: var(--accent); stroke: none; }
.now__icon .acc { stroke: var(--accent); }
.now__list li:hover .now__icon { transform: rotate(-10deg) scale(1.08); background: var(--highlight); }

.now__label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.now__value { font-size: 16.5px; font-weight: 500; line-height: 1.4; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .now__spark { animation: none; }
  .now__list li, .now__swoosh path, .now__rays path, }

/* soft art in a strip of its own, never behind the text */
.now__bg { position: absolute; right: 0; top: 0; bottom: 0; width: 32%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.now__bg .blob--1 { fill: var(--blob); }
.now__bg .y-shadow { fill: var(--blob2); }
.now.is-in .now:hover .now__spark--2 { right: 16%; top: 18px; }
.now__spark--3 { right: 7%; bottom: auto; top: 34%; }
.now__spark--4 { right: 21%; bottom: 20px; }

/* the little burst after "now" */
.now__rays { right: -0.62em; top: -0.5em; width: 0.8em; height: 0.8em; }
.now__rays path { stroke-width: 2.8; }

@media (max-width: 600px) {
  .now { padding-bottom: 96px; }
  .now__list { max-width: none; }
  .now__bg { top: auto; height: 150px; width: 52%; }
}

/* ---------- the yarn ball ---------- */
.now__bg .ball { fill: var(--peach); }
.now__bg .ball-shade { fill: var(--peach-shade); }
.now__bg .ball-hi { fill: var(--ball-hi); }
.now__bg .ball-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.now__bg .yarn { fill: none; stroke: var(--accent); stroke-width: 2.3; stroke-linecap: round; }
.now__bg .yarn--soft { stroke-width: 1.7; opacity: 0.7; }
.now__bg .yarn--thread { stroke-width: 2.3; stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset 1s var(--ease) 0.9s; }
.now.is-in .now__bg .yarn--thread { stroke-dashoffset: 0; }
.now__bg .yarnball { pointer-events: auto; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.now__bg .yarnball:focus-visible .ball-line { stroke: var(--accent); stroke-width: 3; }
.now__bg .yarnball.is-bouncing { transform-box: fill-box; transform-origin: 50% 100%; animation: yarnhop 0.9s ease-out; }
@keyframes yarnhop { 0% { transform: none; } 12% { transform: scale(1.12, 0.86); } 40% { transform: translateY(-40%) scale(0.95, 1.06); } 70% { transform: none; } 78% { transform: scale(1.1, 0.9); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .now__bg .yarnball.is-bouncing { animation: none; } }


/* =====================================================================
   Education card (laptop on books)
===================================================================== */
/* the card */
.edu { position: relative; overflow: hidden; min-height: 430px; padding: 26px 28px 26px; background: var(--paper-2); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 20px; isolation: isolate; transition: transform 0.4s var(--ease); }
.edu:hover { transform: translateY(-6px) rotate(-0.4deg); }
.edu ul { list-style: none; margin: 0; padding: 0; }

.edu .waves { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.edu .waves .w1 { fill: var(--blob); }
.edu .waves .w2 { fill: var(--blob2); opacity: 0.7; }

.edu .trail { position: absolute; right: 22px; top: 22px; width: 190px; height: auto; z-index: 0; pointer-events: none; }
.edu .trail .tp { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 4 9; opacity: 0.45; }
.edu .trail g { opacity: 0; transition: opacity 0.4s ease; }
.edu.is-in .trail g { opacity: 0.85; }
.edu.is-in .trail g:nth-of-type(1) { transition-delay: 0.5s; } .edu.is-in .trail g:nth-of-type(2) { transition-delay: 0.7s; }
.edu.is-in .trail g:nth-of-type(3) { transition-delay: 0.9s; } .edu.is-in .trail g:nth-of-type(4) { transition-delay: 1.1s; } .edu.is-in .trail g:nth-of-type(5) { transition-delay: 1.3s; }

.edu .st { position: absolute; fill: var(--accent); pointer-events: none; animation: twinkle 3.8s ease-in-out infinite; transform-origin: 50% 50%; }
.edu .s1 { width: 24px; right: 14%; top: 56px; }
.edu .s2 { width: 30px; right: 30%; top: 150px; animation-delay: -1.3s; }
.edu .s3 { width: 18px; right: 20%; top: 38%; fill: var(--sage); animation-delay: -2.4s; }

.edu-tt { position: relative; display: inline-block; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -0.01em; margin-bottom: 16px; }
.edu-tt .ry { position: absolute; right: -0.5em; top: -0.18em; width: 0.58em; height: 0.58em; overflow: visible; }
.edu-tt .ry path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; opacity: 0; transform-origin: 0 100%; transition: opacity 0.3s ease 0.9s; }
.edu.is-in .edu-tt .ry path { opacity: 1; }
.edu-tt .sw { position: absolute; left: 3%; bottom: -0.16em; width: 92%; height: 0.2em; overflow: visible; }
.edu-tt .sw path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; vector-effect: non-scaling-stroke; transition: stroke-dashoffset 1s var(--ease) 0.35s; }
.edu.is-in .edu-tt .sw path { stroke-dashoffset: 0; }

.edu-rows { position: relative; z-index: 1; max-width: 62%; }
.edu-rows::before { content: ""; position: absolute; left: 27px; top: 62px; bottom: 84px; border-left: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); z-index: -1; }
.edu-rows li { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 8px 0 10px; opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 140ms + 300ms); }
.edu.is-in .edu-rows li { opacity: 1; transform: none; }
.edu .bub { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; transition: transform 0.45s var(--ease); }
.edu .bub.peach { background: var(--peach); }
.edu .bub.sage { background: var(--sage); }
.edu .bub svg { width: 44px; height: 44px; overflow: visible; }
.edu li:hover .bub { transform: rotate(-10deg) scale(1.1); }
.edu .yr { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.edu .ti { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.12; margin-top: 2px; }
.edu .sc { font-size: 14px; line-height: 1.4; margin-top: 2px; }
.edu .pill { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 999px; background: var(--highlight); font-size: 13.5px; font-weight: 500; color: var(--ink); }

.edu .art { position: absolute; right: 10px; bottom: 4px; width: 46%; max-width: 320px; height: auto; z-index: 1; overflow: visible; opacity: 0; transform: translateY(26px) scale(0.95); transition: opacity 0.6s ease 0.6s, transform 0.8s var(--ease) 0.6s; }
.edu.is-in .art { opacity: 1; transform: none; }
.edu.is-in:hover .art { transform: translateY(-6px) rotate(-1.2deg); transition-delay: 0s; transition-duration: 0.5s; }
.edu .art .sh { fill: var(--blob2); }
.edu .tailwag { transform-box: fill-box; transform-origin: 12% 96%; animation: wag 1.9s ease-in-out infinite; }

@media (max-width: 700px) {
  .labgrid { grid-template-columns: 1fr; }
  .edu { padding: 26px 22px 250px; min-height: 0; }
  .edu-rows { max-width: none; }
  .edu .art { width: 62%; right: 50%; transform: translateX(50%) translateY(26px); }
  .edu.is-in .art { transform: translateX(50%); }
  .edu .trail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .edu .st, .edu .tailwag { animation: none; }
  .edu-rows li, .edu .art, .edu .trail g, .edu-tt .sw path, .edu-tt .ry path { transition: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
}

/* dark theme: keep the dark cap and icons readable */
[data-theme="dark"] .edu .bub.peach { background: #f3d9c6; }
[data-theme="dark"] .edu .bub.sage { background: #cfd9c4; }
[data-theme="dark"] .edu .capg path { stroke: #f1ebdf; stroke-width: 1.6; stroke-linejoin: round; paint-order: stroke; }


/* the illustration lives in a stage so Mango can have his own speech bubble */
.edu-stage { position: absolute; right: 8px; bottom: 2px; width: 40%; max-width: 262px; z-index: 1; }
.edu .art { position: static; right: auto; bottom: auto; width: 100%; max-width: none; }
.edu-bubble { right: -2%; left: auto; top: -14%; bottom: auto; max-width: 200px; transform-origin: 100% 100%; z-index: 3; }
@media (max-width: 700px) {
  .edu-stage { width: 62%; max-width: 320px; right: 50%; transform: translateX(50%); }
  .edu .art, .edu.is-in .art { right: auto; transform: none; }
  .edu.is-in .art { opacity: 1; }
  .edu-bubble { right: -4%; left: auto; top: -10%; max-width: 168px; font-size: 13px; padding: 7px 12px; }
}

/* the floating Mango slips away while the Mango illustration is on screen */
.catwrap.is-here.is-away { opacity: 0; transform: translateY(120px); pointer-events: none; }


/* Mango in the card is petable */
.edu .art--mango { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.kb .edu .art--mango:focus-visible { filter: drop-shadow(0 0 0 var(--accent)); outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.edu .art--mango.is-hop { animation: eduhop 0.6s var(--ease); }
@keyframes eduhop { 0% { transform: none; } 30% { transform: translateY(-16px) scale(0.98, 1.04); } 60% { transform: scale(1.04, 0.96); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .edu .art--mango.is-hop { animation: none; } }


/* ---------- scrollbars ---------- */
:root {
  --sb-size: 10px;
  --sb-thumb: color-mix(in srgb, var(--accent) 55%, var(--paper));
  --sb-thumb-hover: var(--accent);
}

/* Chrome, Edge, Safari: a slim rounded thumb that sits inside a quiet track */
@supports selector(::-webkit-scrollbar) {
  *::-webkit-scrollbar { width: var(--sb-size); height: var(--sb-size); background: transparent; }
  html::-webkit-scrollbar { background: var(--paper); }
  *::-webkit-scrollbar-track { background: transparent; }
  html::-webkit-scrollbar-track { background: var(--paper); }
  *::-webkit-scrollbar-thumb {
    min-height: 56px; min-width: 56px;
    background: var(--sb-thumb);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); background-clip: padding-box; }
  *::-webkit-scrollbar-thumb:active { background: var(--sb-thumb-hover); background-clip: padding-box; border-width: 2px; }
  *::-webkit-scrollbar-corner { background: transparent; }
}

/* Firefox: the standard thin scrollbar in the same colours */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
  html { scrollbar-color: var(--sb-thumb) var(--paper); }
}

/* smooth, contained scrolling inside panels */
.pj-viewer__info-in, .pj-viewer__fallback, .pj-filters { scroll-behavior: smooth; overscroll-behavior: contain; }
@media (prefers-reduced-motion: reduce) { .pj-viewer__info-in, .pj-viewer__fallback, .pj-filters { scroll-behavior: auto; } }

/* Right now and Education sit in different grids, so give them one shared size and shape */
.now, .edu { width: 100%; justify-self: end; border-radius: 18px; }
@media (min-width: 881px) { .about__grid, .exp__grid { align-items: stretch; } .now, .edu { min-height: 0; } }
@media (max-width: 880px) { .now, .edu { justify-self: center; } }

/* ---------- custom orange cursor ---------- */
/* the arrow tip and the fingertip are the click points; the normal cursors are the fallback if an image cannot load */
html { cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M4 3V25L9.6 20L13.4 28.6L17.4 26.8L13.7 18.4H21Z%22 fill=%22%23e8561f%22 stroke=%22%23e8561f%22 stroke-width=%222%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 4 3, auto; }
html[data-theme="dark"] { cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M4 3V25L9.6 20L13.4 28.6L17.4 26.8L13.7 18.4H21Z%22 fill=%22%23ff7a4d%22 stroke=%22%23ff7a4d%22 stroke-width=%222%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 4 3, auto; }
a[href], button:not(:disabled), [role="button"]:not(.pj-t), summary, label[for], select, .scribble, .yarnball, .art--mango, .card[data-project] .card__body, .pj-row__head, .pj-pick, .pj-chip {
  cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M10.5 5.2C10.5 2.6 15.2 2.6 15.2 5.2V12.6C16.2 12 17.6 12.4 18 13.6C19 13.2 20.4 13.7 20.8 15C22 14.7 23.6 15.4 23.6 17V22.5C23.6 26.8 21 29.6 16.8 29.6H15.4C12.6 29.6 11.2 28.5 9.7 26.7L5.6 21.2C4.7 20 6.6 18.4 7.8 19.4L10.5 21.6Z%22 fill=%22%23e8561f%22 stroke=%22%23e8561f%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 12 4, pointer !important;
}
html[data-theme="dark"] :is(a[href], button:not(:disabled), [role="button"]:not(.pj-t), summary, label[for], select, .scribble, .yarnball, .art--mango, .card[data-project] .card__body, .pj-row__head, .pj-pick, .pj-chip) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2232%22 height=%2232%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M10.5 5.2C10.5 2.6 15.2 2.6 15.2 5.2V12.6C16.2 12 17.6 12.4 18 13.6C19 13.2 20.4 13.7 20.8 15C22 14.7 23.6 15.4 23.6 17V22.5C23.6 26.8 21 29.6 16.8 29.6H15.4C12.6 29.6 11.2 28.5 9.7 26.7L5.6 21.2C4.7 20 6.6 18.4 7.8 19.4L10.5 21.6Z%22 fill=%22%23ff7a4d%22 stroke=%22%23ff7a4d%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") 12 4, pointer !important;
}
/* toys: an orange open hand to pick one up and a closed fist while holding it, matching the orange pointer */
.pj-t { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M8 15h16v6.2c0 4.5-3 7.3-7.2 7.3h-1.5c-2.9 0-4.5-1.2-5.9-3.1L8 23z M9.4 22.6 4.9 18.6a1.7 1.7 0 0 1 2.3-2.5L10.6 19z M8 16V8.2a1.7 1.7 0 0 1 3.4 0V16Z M12.2 16V5.2a1.7 1.7 0 0 1 3.4 0V16Z M16.4 16V4.7a1.7 1.7 0 0 1 3.4 0V16Z M20.6 16V6.7a1.7 1.7 0 0 1 3.4 0V16Z' fill='%23e8561f'/%3E%3C/svg%3E") 16 16, grab !important; }
.pj-t.is-held { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M8 15h16v6.2c0 4.5-3 7.3-7.2 7.3h-1.5c-2.9 0-4.5-1.2-5.9-3.1L8 23z M8 16V14.299999999999999a1.7 1.7 0 0 1 3.4 0V16Z M12.2 16V13.299999999999999a1.7 1.7 0 0 1 3.4 0V16Z M16.4 16V13.1a1.7 1.7 0 0 1 3.4 0V16Z M20.6 16V14.1a1.7 1.7 0 0 1 3.4 0V16Z' fill='%23e8561f'/%3E%3C/svg%3E") 16 16, grabbing !important; }
html[data-theme="dark"] .pj-t { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M8 15h16v6.2c0 4.5-3 7.3-7.2 7.3h-1.5c-2.9 0-4.5-1.2-5.9-3.1L8 23z M9.4 22.6 4.9 18.6a1.7 1.7 0 0 1 2.3-2.5L10.6 19z M8 16V8.2a1.7 1.7 0 0 1 3.4 0V16Z M12.2 16V5.2a1.7 1.7 0 0 1 3.4 0V16Z M16.4 16V4.7a1.7 1.7 0 0 1 3.4 0V16Z M20.6 16V6.7a1.7 1.7 0 0 1 3.4 0V16Z' fill='%23ff7a4d'/%3E%3C/svg%3E") 16 16, grab !important; }
html[data-theme="dark"] .pj-t.is-held { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M8 15h16v6.2c0 4.5-3 7.3-7.2 7.3h-1.5c-2.9 0-4.5-1.2-5.9-3.1L8 23z M8 16V14.299999999999999a1.7 1.7 0 0 1 3.4 0V16Z M12.2 16V13.299999999999999a1.7 1.7 0 0 1 3.4 0V16Z M16.4 16V13.1a1.7 1.7 0 0 1 3.4 0V16Z M20.6 16V14.1a1.7 1.7 0 0 1 3.4 0V16Z' fill='%23ff7a4d'/%3E%3C/svg%3E") 16 16, grabbing !important; }
@media (pointer: coarse) { html { cursor: auto; } }

/* ---------- contact: email on the left, quick message form on the right ---------- */
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: clamp(28px, 5vw, 80px); align-items: stretch; }
.contact__grid .contact__title { font-size: clamp(48px, 8.3vw, 136px); }
.contact__left { display: flex; flex-direction: column; }
.contact__left .socials { margin-top: auto; padding-top: 28px; }
.contact__grid .contact__sub { margin-top: 26px; }
.contact__grid .msgform { margin-top: 0; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; }
@media (max-width: 900px) { .contact__grid .contact__title { font-size: clamp(50px, 12vw, 90px); } .contact__grid .msgform { margin-top: 10px; } }
.contact__grid .contact__mail { font-size: clamp(24px, 3.2vw, 52px); }
.msgform {
  display: grid;
  gap: 14px;
  margin-top: 34px;
  padding: 26px 24px 28px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper-2);
}
.msgform__title { position: relative; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -0.01em; margin-bottom: 4px; color: var(--ink); }
.msgform__title em { position: relative; display: inline-block; padding-right: 0.1em; }
.msgform__title .now__swoosh path { stroke-dashoffset: 0; }
.msgform__title .now__rays path { opacity: 1; }
.msgform__sub { margin-top: -4px; color: var(--muted); font-size: 16px; }
.msgform__field { display: grid; gap: 6px; }
.msgform__field span { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.msgform input[type="text"], .msgform input[type="email"], .msgform textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.msgform__field--grow { grid-template-rows: auto minmax(0, 1fr); }
.msgform__field--grow textarea { height: 100%; min-height: 112px; resize: none; }
.msgform input:focus, .msgform textarea:focus { outline: none; border-color: var(--accent); background: var(--paper-2); }
.msgform input::placeholder, .msgform textarea::placeholder { color: var(--muted); opacity: 0.7; }
.msgform [aria-invalid="true"] { border-color: #d32f2f; }
.msgform__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.msgform__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.msgform__send[disabled] { opacity: 0.6; pointer-events: none; }
.msgform__status { font-size: 14.5px; font-weight: 500; flex: 1 1 160px; }
.msgform__status.is-ok { color: var(--green); }
.msgform__status.is-error { color: #d32f2f; }
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } .msgform { margin-top: 10px; } }

/* soft shapes tucked into the corners, like the Right now and Education cards */
.msgform__waves { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.msgform__waves .w1 { fill: var(--blob); }
.msgform__waves .w2 { fill: var(--blob2); opacity: 0.7; }
.msgform__star { position: absolute; fill: var(--accent); pointer-events: none; z-index: -1; animation: twinkle 3.8s ease-in-out infinite; transform-origin: 50% 50%; }
.msgform__star--1 { width: 20px; right: 9%; top: 24px; }
.msgform__star--2 { width: 14px; right: 18%; top: 42%; fill: var(--green); animation-delay: -1.6s; }
.msgform__star--3 { width: 16px; left: 8%; bottom: 22px; animation-delay: -2.6s; }
@media (prefers-reduced-motion: reduce) { .msgform__star { animation: none; } }

/* ---------- one button language ----------
   Large: .btn, .copy (16px, 14px 26px).  Small: .nav__cta, .pj-link, .btn-chess (14.5px, 9px 18px).
   Filled buttons turn orange on hover, outline buttons fill with ink, and both lift. No offset shadows. */
.btn-chess {
  padding: 9px 18px;
  font-size: 14.5px;
  font-weight: 500;
  background: transparent;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.btn-chess:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(28, 27, 24, 0.2); }
.btn-chess:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn-chess--next { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-chess--next:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(217, 72, 28, 0.28); }
[data-theme="dark"] .btn-chess:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
[data-theme="dark"] .btn-chess--next, [data-theme="dark"] .btn-chess--next:hover { color: #151412; }

.chess__pills .pill { transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s; }
.chess__pills .pill:hover { transform: translateY(-2px); box-shadow: none; border-color: var(--accent); }
.chess__pills .pill.is-active, .chess__pills .pill.is-active.is-solved { box-shadow: none; transform: none; }
[data-theme="dark"] .chess__pills .pill:hover, [data-theme="dark"] .chess__pills .pill.is-active, [data-theme="dark"] .chess__pills .pill.is-active.is-solved { box-shadow: none; }

/* achievement cards: the same soft corner shapes and sparkles as Right now and Education */
.win { position: relative; overflow: hidden; isolation: isolate; }
.win::before, .win::after { content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; }
.win::before { right: -34%; top: 22%; width: 72%; height: 130%; background: var(--blob); }
.win::after { left: -22%; bottom: -52%; width: 58%; height: 86%; background: var(--blob2); opacity: 0.7; }
.win__star { position: absolute; z-index: -1; width: 16px; right: 12%; top: 20px; fill: var(--accent); pointer-events: none; animation: twinkle 3.8s ease-in-out infinite; transform-origin: 50% 50%; }
.win:nth-child(2) .win__star { right: 20%; top: auto; bottom: 22px; width: 13px; fill: var(--green); animation-delay: -1.4s; }
.win:nth-child(3) .win__star { right: 9%; top: 26px; width: 18px; animation-delay: -2.2s; }
.win:nth-child(4) .win__star { right: 16%; top: auto; bottom: 26px; width: 14px; animation-delay: -0.8s; }
@media (prefers-reduced-motion: reduce) { .win__star { animation: none; } }

/* "There's more" card: heading, text and one tidy row of actions */
.card__more { gap: 16px; }
.card__more-lead { max-width: 30ch; margin-bottom: 4px; }
.card__more-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.card__more-link { padding-bottom: 1px; }

/* chess card: loose organic blobs behind the content, in the same colours as the other cards */
.chess { position: relative; overflow: hidden; isolation: isolate; }
.chess::before, .chess::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.chess::before { right: -9%; bottom: -34%; width: 46%; height: 78%; background: var(--blob); border-radius: 58% 42% 51% 49% / 46% 57% 43% 54%; transform: rotate(-12deg); }
.chess::after { left: -11%; top: -30%; width: 38%; height: 62%; background: var(--blob2); opacity: 0.65; border-radius: 44% 56% 62% 38% / 55% 41% 59% 45%; transform: rotate(18deg); }
.chess__text, .chess__board-wrap { position: relative; }
/* achievement cards: small, loose blobs, a different pair in a different place on each card */
.win::before, .win::after { top: auto; right: auto; bottom: auto; left: auto; }
.win:nth-child(1)::before { right: -12%; bottom: -34%; width: 40%; height: 74%; background: var(--blob); border-radius: 58% 42% 51% 49% / 46% 57% 43% 54%; transform: rotate(-14deg); }
.win:nth-child(1)::after { left: 34%; bottom: -46%; width: 24%; height: 50%; background: var(--blob2); opacity: 0.6; border-radius: 44% 56% 62% 38% / 55% 41% 59% 45%; transform: rotate(20deg); }
.win:nth-child(2)::before { right: -16%; top: -30%; width: 42%; height: 70%; background: var(--blob); border-radius: 41% 59% 47% 53% / 62% 44% 56% 38%; transform: rotate(32deg); }
.win:nth-child(2)::after { left: -10%; bottom: -38%; width: 34%; height: 62%; background: var(--blob2); opacity: 0.6; border-radius: 62% 38% 45% 55% / 40% 58% 42% 60%; transform: rotate(-22deg); }
.win:nth-child(3)::before { left: -12%; bottom: -30%; width: 38%; height: 66%; background: var(--blob); border-radius: 52% 48% 38% 62% / 57% 39% 61% 43%; transform: rotate(24deg); }
.win:nth-child(3)::after { right: -9%; top: 34%; width: 22%; height: 44%; background: var(--blob2); opacity: 0.6; border-radius: 37% 63% 55% 45% / 48% 60% 40% 52%; transform: rotate(-10deg); }
.win:nth-child(4)::before { right: 6%; top: -34%; width: 30%; height: 62%; background: var(--blob); border-radius: 63% 37% 56% 44% / 43% 52% 48% 57%; transform: rotate(-30deg); }
.win:nth-child(4)::after { right: -10%; bottom: -34%; width: 36%; height: 64%; background: var(--blob2); opacity: 0.6; border-radius: 48% 52% 36% 64% / 59% 43% 57% 41%; transform: rotate(12deg); }

/* a screenshot that could not load: show the project name on a plain card instead */
.img-missing { position: relative; display: grid; place-items: center; background: var(--paper-2); }
.img-missing::after { content: attr(data-fallback); padding: 0 18px; font-family: var(--serif); font-size: clamp(22px, 2.4vw, 34px); line-height: 1.1; text-align: center; color: var(--muted); }
.img-missing::before { content: "Preview unavailable"; position: absolute; bottom: 12px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); opacity: 0.8; }

/* keep the page scrollbar's space reserved so opening and closing a dialog never shifts the layout or flashes a scrollbar */
html { scrollbar-gutter: stable; }
