@charset "UTF-8";

/* ---------- Tokens ---------- */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f5f2eb;
  --text: #1c1a17;
  --muted: #625d55;
  --border: #e8e3d8;
  --accent: #c2410c;
  --accent-deep: #c2410c;
  --accent-strong: #7c2d12;
  --accent-soft: #fff1e6;
  --chip-border: #c2410c;
  --chip-text: #9a3412;
  --neon: #ff6a1a;
  --plant: #4a7c59;
  --plant-soft: #e8f1ea;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(40 30 15 / 0.05), 0 8px 24px -10px rgb(40 30 15 / 0.14);
  --shadow-lg: 0 2px 4px rgb(40 30 15 / 0.05), 0 24px 48px -18px rgb(40 30 15 / 0.24);
  --glow: 0 0 0 1px color-mix(in srgb, var(--neon) 25%, transparent), 0 8px 28px -6px color-mix(in srgb, var(--neon) 45%, transparent);

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #050407;
  --surface: #14111b;
  --surface-2: #1b1724;
  --text: #f0eaff;
  --muted: #a8a0ba;
  --border: #2a2436;
  --accent: #b890ff;
  --accent-deep: #7c3aed;
  --accent-strong: #e4d3ff;
  --accent-soft: #211a30;
  --chip-border: #8a63e6;
  --chip-text: #c4b1ef;
  --neon: #b566ff;
  --plant: #86c29a;
  --plant-soft: #182a22;
  --on-accent: #16092c;
  --shadow: 0 1px 2px rgb(5 0 15 / 0.4), 0 8px 24px -8px rgb(5 0 15 / 0.6);
  --shadow-lg: 0 2px 4px rgb(5 0 15 / 0.4), 0 24px 48px -16px rgb(40 0 90 / 0.6);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: clip;
  transition: background-color 0.3s, color 0.3s;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--text);
  text-wrap: balance;
}

p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

/* Sections the rail moves focus to (so Tab carries on from there) shouldn't get a ring */
[tabindex="-1"]:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

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

[id] {
  scroll-margin-top: 110px;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  view-transition-name: site-nav;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  transition: color 0.2s, background-color 0.2s;
}

/* Reserves room for the wider of a link's two translations (data-w), so switching language doesn't shift the nav */
.nav-links a[data-w] {
  display: grid;
  justify-items: center;
}

.nav-links a[data-w]::before {
  content: attr(data-w);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.1rem;
  height: 3px;
  border-radius: 3px;
  background: var(--accent-deep);
  box-shadow: 0 0 12px color-mix(in srgb, var(--neon) 70%, transparent);
  view-transition-name: nav-indicator;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), background-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: rotate(18deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Language toggle: a hairline flag and its code, showing the language you'd switch to */
.lang-toggle {
  display: inline-grid;
  align-items: center;
  height: 40px;
  margin: 0 -0.6rem 0 -0.9rem;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 600 0.72rem/1 var(--font-body);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s;
  flex-shrink: 0;
}

.lang-toggle:hover {
  color: var(--text);
}

/* Both labels share one cell, so DA and EN take the same width and the nav doesn't shift */
.lang-toggle > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.lang-toggle svg {
  width: 19px;
  height: auto;
  opacity: 0.85;
}

.lang-toggle .lang-to-en,
:root[lang="da"] .lang-toggle .lang-to-da {
  visibility: hidden;
}

:root[lang="da"] .lang-toggle .lang-to-en {
  visibility: visible;
}

/* Phones skip the blur: redoing it over the moving scene every frame is what makes cheap ones stutter */
@media (max-width: 760px) {
  .site-nav {
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 720px) {
  .nav-inner {
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding-block: 0.6rem 0.2rem;
  }

  .brand-mid {
    display: none;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }

  /* Shrinks on narrow phones so all four links fit without a sideways scroll */
  .nav-links a {
    padding: 0.5rem clamp(0.35rem, 1.8vw, 0.6rem);
    font-size: clamp(0.8rem, 3.7vw, 0.9rem);
  }

  .nav-links a[aria-current="page"]::after {
    left: clamp(0.35rem, 1.8vw, 0.6rem);
    right: clamp(0.35rem, 1.8vw, 0.6rem);
  }
}

/* ---------- Page shell (this is what slides) ---------- */
.page {
  view-transition-name: page;
}

main {
  display: block;
}

.section {
  padding-block: clamp(2.5rem, 5.5vw, 4.25rem);
}

.section + .section {
  padding-top: 0;
}

[data-github-section][hidden] + .section {
  padding-top: clamp(2.5rem, 5.5vw, 4.25rem);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 700;
}

.lead {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--muted);
  max-width: 62ch;
}

/* ---------- Buttons ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s var(--ease-out);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Chips & tags ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--chip-border) 40%, transparent);
  color: var(--chip-text);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.25s, border-color 0.25s, background-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-out);
}

.chip:hover {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--neon) 85%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--neon) 22%, transparent), color-mix(in srgb, var(--neon) 6%, transparent));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 0 12px -2px color-mix(in srgb, var(--neon) 70%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.12);
  transform: translateY(-1px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--plant);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 2s var(--ease-out) infinite;
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}

/* Light mode: a firmer edge and deeper shadow so white cards lift off the cream page */
:where(:root[data-theme="light"]) .card {
  border-color: #dcd5c6;
  box-shadow: 0 1px 3px rgb(40 30 15 / 0.08), 0 10px 28px -10px rgb(40 30 15 / 0.22);
}

.card.spotlight {
  --mx: 50%;
  --my: 50%;
}

.card.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--mx) var(--my),
    color-mix(in srgb, var(--accent) 14%, transparent),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
  pointer-events: none;
}

.card.spotlight:hover::before {
  opacity: 1;
}

/* Light mode: project cards get no cursor spotlight */
:root[data-theme="light"] .card.project.spotlight:hover::before {
  opacity: 0;
}

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 4.75rem) clamp(2rem, 4.5vw, 3.5rem);
}

.hero-name {
  margin: 1.4rem 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

:root[data-theme="dark"] .hero-name {
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero h1 .accent {
  font-style: italic;
  color: var(--accent-deep);
}

.hero .lead {
  margin-bottom: 2rem;
}

.portrait {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 310px);
}

.portrait-mark {
  position: absolute;
  top: 6%;
  left: 7%;
  width: 30%;
  height: auto;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgb(168 85 247 / 0.9)) drop-shadow(0 0 14px rgb(168 85 247 / 0.5));
}

.portrait-mark path {
  fill: none;
  stroke: #c9b2ff;
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.9s var(--ease-out);
}

.portrait:hover .portrait-mark path {
  stroke-dashoffset: 0;
}

:root[data-theme="light"] .portrait-mark {
  filter: drop-shadow(0 0 5px rgb(255 106 26 / 0.9)) drop-shadow(0 0 14px rgb(255 106 26 / 0.5));
}

:root[data-theme="light"] .portrait-mark path {
  stroke: #ffc49a;
}

.portrait img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}

.portrait-badge {
  position: absolute;
  right: -12px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--neon) 35%, var(--border));
  box-shadow: var(--shadow-lg), 0 0 20px -8px color-mix(in srgb, var(--neon) 60%, transparent);
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text);
  animation: float 6s ease-in-out infinite;
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.portrait-badge strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.portrait-badge span span {
  color: var(--accent-deep);
  font-weight: 500;
}

.portrait:hover .portrait-badge {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-color: color-mix(in srgb, var(--neon) 80%, transparent);
  box-shadow: var(--shadow-lg), 0 0 28px -4px color-mix(in srgb, var(--neon) 70%, transparent);
}

@keyframes float {
  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "status photo"
      "title  photo"
      "lead   lead"
      "cta    cta";
    column-gap: 1.25rem;
    row-gap: 0;
    align-items: start;
  }

  .hero-text {
    display: contents;
  }

  .hero .status { grid-area: status; justify-self: start; }
  .hero h1 { grid-area: title; }
  .hero .lead { grid-area: lead; }
  .hero .btn-row { grid-area: cta; }

  .portrait {
    grid-area: photo;
    width: clamp(92px, 26vw, 150px);
    justify-self: end;
  }

  .portrait img {
    border-radius: 18px;
  }

  .portrait-badge {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero .status {
    font-size: 0.75rem;
    margin-bottom: 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 600px) {
  .portrait-badge {
    right: -8px;
  }
}

/* ---------- Home: scenery (scene.js, art from tools/gen-scene.mjs) ---------- */
/* The stage tucks up under the see-through nav so the sky runs to the top edge.
   No isolation here: the pinned scene's z-index -1 must place it behind the whole page, not just
   behind the hero (an isolated stage would be painted over every plain section after it). */
.hero-stage {
  position: relative;
  margin-top: -62px;
  padding-top: 62px;
  min-height: max(100svh, 620px);
}

.hero-stage .hero {
  padding-bottom: max(clamp(2rem, 4.5vw, 3.5rem), 28svh);
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  animation: scene-in 1.4s var(--ease-out) both;
}

@keyframes scene-in {
  from { opacity: 0; }
}

/* A soft wash behind the hero text; scene.js fades it out (--scrim) as you scroll away */
.scene::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: var(--scrim, 1);
  background: radial-gradient(55% 50% at 27% 42%, color-mix(in srgb, var(--bg) 42%, transparent), transparent 75%);
}

:root[data-theme="light"] .scene::before {
  background: radial-gradient(55% 55% at 27% 42%, color-mix(in srgb, var(--bg) 78%, transparent), transparent 78%);
}

/* A veil in the page colour; scene.js raises it (--dim) whenever text is on screen */
.scene-dim {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: var(--bg);
  opacity: calc(var(--dim, 0) * 0.66);
}

:root[data-theme="light"] .scene-dim {
  opacity: calc(var(--dim, 0) * 0.74);
}

.scene-fx {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Three scenes are stacked; a later one fades in over the previous as its part of the page arrives,
   settling from a slight zoom so the handover feels like a slow camera move rather than a cut. */
.scene-chapter {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease, visibility 0s;
}

.scene-chapter.is-shown {
  opacity: 1;
}

/* Once fully covered, a scene stops being painted */
.scene-chapter.is-covered {
  visibility: hidden;
  transition: opacity 1.6s ease, visibility 0s 1.6s;
}

.scene-set {
  position: absolute;
  inset: 0;
  transform: scale(1.05);
  transition: opacity 0.9s ease, visibility 0.9s, transform 2.4s var(--ease-out);
}

.scene-chapter.is-shown > .scene-set {
  transform: none;
}

:root[data-theme="light"] .scene-night,
:root[data-theme="dark"] .scene-day {
  opacity: 0;
  visibility: hidden;
}

/* Layers are a little wider than the screen so the pointer drift never shows an edge */
.scene-layer {
  position: absolute;
  inset: 0 -32px;
  transform-origin: 50% 66%;
  will-change: transform;
}

.scene-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Gaps between parts of the page where the new landscape has the screen to itself */
.scene-break {
  min-height: 30svh;
}

@media (max-width: 600px) {
  .scene-break {
    min-height: 22svh;
  }
}

/* ---------- Home: quick facts ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  display: block;
  height: 100%;
  padding: 1.35rem 1.4rem;
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), border-color 0.25s, box-shadow 0.3s;
}

.stat:hover {
  transform: translateY(-4px);
}

.stat-value {
  display: block;
  font-variant-numeric: lining-nums;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stat {
    padding: 1.1rem;
  }

  .stat-value {
    font-size: 1.6rem;
  }
}

/* ---------- Home: about me ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.split-aside {
  position: sticky;
  top: 100px;
}

.prose {
  max-width: 68ch;
}

.prose > p:first-child::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.1em;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent-deep);
  font-weight: 700;
}

.personal-note {
  padding: 1.5rem 1.6rem;
  margin-top: 2rem;
  background: var(--plant-soft);
  border: none;
  box-shadow: none;
}

.personal-note h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.personal-note p:last-child {
  margin-bottom: 0;
}

.callout {
  background: none;
  color: var(--text);
  font-weight: 500;
}

.prose a {
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.brand-word {
  display: inline-block;
  line-height: 1;
  vertical-align: -0.05em;
  color: var(--text);
}

.brand-qilej {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.55em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.brand-tackly {
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.45em;
}

.brand-learnhub,
.tile-learnhub .tile-name {
  background: linear-gradient(90deg, rgb(42 125 155), rgb(87 199 133), rgb(237 229 83));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-learnhub {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3em;
}

:root[data-theme="light"] .brand-learnhub {
  background-image: linear-gradient(90deg, #1f6f8b, #2f9e63, #a8950f);
}

.pull-quote {
  position: relative;
  margin: 2.5rem 0;
  padding-left: 2.6rem;
}

.pull-quote::before {
  content: "\201C";
  position: absolute;
  left: -0.2rem;
  top: -1.1rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 5rem;
  line-height: 1;
  color: var(--accent);
}

.pull-quote p {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}

.reach-out {
  display: inline-block;
  font-family: "Caveat", "Segoe Print", cursive;
  font-weight: 700;
  font-size: 1.55em;
  line-height: 1;
  white-space: nowrap;
  /* Room for the handwritten "!" and descenders that reach past the letter box; otherwise the
     dark mode's gradient text (clipped to this box) cuts them off */
  padding: 0.1em 0.15em 0.15em 0;
  margin: -0.1em -0.15em -0.15em 0;
  transform-origin: left 70%;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.8, 0.5, 1),
    background-position 0.5s var(--ease-out);
}

/* Hover: the word grows and tilts with a springy wobble instead of underlining */
.prose a.reach-out:hover {
  text-decoration: none;
  transform: rotate(-4deg) scale(1.12);
}

/* Dark: the letters themselves fade from a dark ember to bright orange
   (pure black would vanish on the dark background) */
:root[data-theme="dark"] .prose a.reach-out {
  /* Twice as wide as the word: the first half is the resting look, the second half the brighter hover look */
  background: linear-gradient(100deg, #8a2c0c 0%, #c2410c 20%, #fb923c 50%, #fdba74 75%, #fb923c 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:root[data-theme="dark"] .prose a.reach-out:hover {
  background-position: 100% 0;
}

.prose a.brand-learnhub:hover {
  text-decoration-color: rgb(87 199 133);
}

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

  .split-aside {
    position: static;
  }
}

/* ---------- Home: storytelling ---------- */
.facts {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * clamp(3rem, 9vw, 7rem));
}

.stat-line {
  display: flex;
  margin-bottom: 0.7rem;
}

.stat-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--neon) 60%, transparent), transparent);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.stat:hover .stat-line::after {
  transform: scaleX(1);
}

.word {
  display: inline-block;
  vertical-align: top;
}

.word > span {
  display: inline-block;
}

.reveal-ready .reveal .word > span {
  opacity: 0.4;
  transform: translateY(0.3em);
  transition: opacity 0.7s ease calc(0.1s + var(--i) * 0.05s), transform 0.8s var(--ease-out) calc(0.1s + var(--i) * 0.05s);
}

.reveal-ready .reveal.in .word > span {
  opacity: 1;
  transform: none;
}

.pull-quote p {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
}

.story-ready .qw > span {
  opacity: 0.45;
  transition: opacity 0.35s ease, text-shadow 0.35s ease;
}

.story-ready .qw.is-lit > span {
  opacity: 1;
}

:root[data-theme="dark"].story-ready .qw.is-lit > span {
  text-shadow: 0 0 18px color-mix(in srgb, var(--neon) 45%, transparent);
}

/* ---------- Projects ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-head .section-title {
  margin-bottom: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, border-color 0.2s;
}

.project:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--neon) 30%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.project-media img.contain {
  object-fit: contain;
  padding: 1.25rem;
}

.project:hover .project-media img {
  transform: scale(1.05);
}

.project-media.placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--accent) 12%, transparent) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--accent) 12%, transparent) 23px 24px),
    var(--surface-2);
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 600;
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.35rem 1.35rem;
}

.project-body h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

.project-body p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

:root[data-theme="light"] .project-link {
  color: var(--muted);
  transition: color 0.2s;
}

:root[data-theme="light"] .project:hover .project-link {
  color: var(--text);
}

.project-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease-out);
}

.project:hover .project-link svg {
  transform: translate(2px, -2px);
}

.project .chips {
  gap: 0.35rem;
}

.project .chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* The portfolio opens with the featured projects; "Show all" or a filter reveals the rest */
.work-lead {
  margin-bottom: 1.5rem;
}

#work .filters {
  margin-bottom: 1.75rem;
}

.project-grid.is-collapsed > .project:not([data-featured]) {
  display: none;
}

.show-all {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.filter {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.project[hidden] {
  display: none;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.feature {
  padding: 1.6rem;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-size: 1.08rem;
}

.feature p {
  font-size: 0.975rem;
  color: var(--muted);
  margin-bottom: 0;
}

@media (min-width: 700px) {
  .project-featured {
    grid-column: span 2;
  }

  .project-featured .project-media {
    aspect-ratio: 16 / 5;
  }
}

.project-body .project-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.tile-kattis .tile-name {
  font-family: inherit;
  font-size: 1.9rem;
  color: #8cc7a4;
}

.tile-kattis .tile-sub {
  color: #3fb56e;
  text-transform: none;
  letter-spacing: 0;
}

.code-tile,
.logo-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1.25rem;
}

.code-tile {
  color: #fff;
  background:
    radial-gradient(circle at 18% 15%, rgb(255 255 255 / 0.16), transparent 45%),
    linear-gradient(135deg, var(--t1), var(--t2));
}

.code-tile svg {
  width: 34px;
  height: 34px;
  opacity: 0.9;
  margin-bottom: 0.2rem;
}

.logo-tile img {
  width: auto !important;
  height: 78% !important;
  max-height: 150px;
  object-fit: contain !important;
}

.tile-qilej {
  background: #000;
}

.tile-qilej img {
  height: 100% !important;
  max-height: none;
}

.tile-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.05;
  transition: transform 0.6s var(--ease-out);
}

.project:hover .tile-name {
  transform: scale(1.05);
}

.tile-sub {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}

.code-tile.tile-kattis {
  --t1: #1f1830;
  --t2: #0e0b16;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.code-tile.tile-learnhub {
  background:
    radial-gradient(circle at 80% 110%, rgb(69 184 131 / 0.22), transparent 55%),
    linear-gradient(180deg, #1d3050, #02062f);
  color: #e4e4e4;
}

.tile-learnhub svg {
  color: #45b883;
}

/* ---------- Call to action ---------- */
.cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.75rem 3rem;
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.5rem, 5vw, 3.5rem);
  border-radius: 28px;
  background:
    radial-gradient(110% 150% at 100% 0%, rgb(255 122 38 / 0.5), transparent 55%),
    linear-gradient(135deg, #431407 0%, #7c2d12 55%, #b8420a 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(255 255 255 / 0.16) 1px, transparent 1.5px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to left, #000, transparent 65%);
  mask-image: linear-gradient(to left, #000, transparent 65%);
  pointer-events: none;
}

.cta-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d9c6ff;
}

.cta-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6ee7a0;
  box-shadow: 0 0 0 4px rgb(110 231 160 / 0.2);
}

.cta h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  color: #fff;
  margin-bottom: 0.6rem;
}

.cta p:not(.cta-eyebrow) {
  max-width: 52ch;
  margin-bottom: 0;
  color: rgb(255 255 255 / 0.78);
}

.cta .btn-row {
  flex-direction: column;
  align-items: stretch;
}

.cta .btn {
  justify-content: center;
}

:root[data-theme="light"] .cta {
  --cta-ink: #431407;
}

:root .cta .btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--cta-ink, #230a47);
  box-shadow: none;
}

:root .cta .btn-primary:hover {
  background: #fff;
  color: var(--cta-ink, #230a47);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgb(0 0 0 / 0.6);
}

:root .cta .btn-ghost {
  background: transparent;
  border-color: rgb(255 255 255 / 0.35);
  color: #fff;
}

:root .cta .btn-ghost:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.7);
}

:root[data-theme="dark"] .cta {
  background:
    radial-gradient(110% 150% at 100% 0%, rgb(181 102 255 / 0.32), transparent 55%),
    linear-gradient(135deg, #12052a 0%, #250b4d 60%, #36126f 100%);
  border: 1px solid rgb(225 215 255 / 0.18);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), var(--shadow);
}

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

  .cta .btn-row {
    flex-direction: row;
  }
}

/* ---------- Resume: one CV sheet ---------- */
/* Sidebar (photo, contact, languages) on the left, content on the right, on a single
   sheet that sits on the page like a printed CV. Prints as one clean document (see Print). */
.cv-wrap {
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem);
}

.cv {
  --side: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: clip;
}

:root[data-theme="dark"] .cv {
  --side: rgb(255 255 255 / 0.025);
  background: linear-gradient(180deg, #0d0a13 0%, #07050b 100%);
  border-color: rgb(225 215 255 / 0.14);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(0 0 0 / 0.6), 0 0 40px -20px color-mix(in srgb, var(--neon) 40%, transparent);
}

:root[data-theme="dark"] .cv-side {
  --accent: var(--accent-deep);
}

.cv-side {
  background: var(--side);
  border-right: 1px solid var(--border);
  padding: 2.25rem 1.75rem;
}

/* The sidebar's content stays in view while the main column scrolls past */
.cv-side-inner {
  position: sticky;
  top: 90px;
}

.cv-side img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 26px;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
}

.cv-side h2 {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}

.cv-side .role {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.cv-side h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.75rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.cv-main {
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4.5vw, 3.5rem);
}

/* No divider under the intro: the first section heading (Profile) draws its own line */
.cv-header {
  margin-bottom: 2.5rem;
}

.cv-header h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.5rem);
  font-weight: 800;
}

.cv-header .lead {
  margin-bottom: 0;
}

/* Just an icon and "PDF", tucked into the card's top-right corner above the headline */
.cv-print {
  position: absolute;
  top: 1.1rem;
  right: clamp(1.5rem, 4.5vw, 3.5rem);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.7;
  text-decoration: none;
  transition: color 0.2s;
}

.cv-print:hover {
  color: var(--accent);
}

.cv-print svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--ease-out);
}

.cv-print:hover svg {
  transform: translateY(2px);
}

.resume-main > section {
  margin-bottom: 2.75rem;
}

.resume-main > section:last-child {
  margin-bottom: 0;
}

.resume-main h2 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resume-main h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1.5rem 2rem;
}

.skill-group h3,
.strength h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.skill-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-words li {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.9;
  white-space: nowrap;
}

.strengths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.75rem 2.25rem;
}

.strength p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.details {
  margin: 0;
  display: grid;
  gap: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.details div {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0.65rem;
  align-items: start;
}

.details svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  margin-top: 1px;
}

.details dt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.details .print-only {
  display: none;
}

.details dd {
  margin: 0;
  word-break: break-word;
}

.details a {
  color: var(--text);
  text-decoration: none;
}

.details a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.lang-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.lang-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.dots {
  display: inline-flex;
  gap: 4px;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.dots i.on {
  background: var(--accent);
}

.cert-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.cert-list li {
  display: flex;
  gap: 0.5rem;
}

.cert-list li::before {
  content: "\2713";
  color: var(--plant);
  font-weight: 700;
}

.check-list {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.check-list li {
  position: relative;
  padding-left: 1rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Sub-points under a point (e.g. details under Tackly): a little tighter, with a hollow bullet */
.check-list.check-sub {
  margin-top: 0.4rem;
  gap: 0.35rem;
}

.check-sub li::before {
  background: transparent;
  border: 1.5px solid var(--accent);
  box-sizing: border-box;
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border));
  border-radius: 2px;
}

.timeline > li {
  position: relative;
  padding-bottom: 1.6rem;
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 1px);
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
}

.timeline h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.timeline .org {
  color: var(--muted);
  margin-bottom: 0.2rem;
  font-size: 0.975rem;
}

.timeline .when {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
}

/* Narrow screens: one column, with the title first, then the sidebar, then the sections
   (screen only: an A4 page is narrower than 900px but should keep both columns) */
@media screen and (max-width: 900px) {
  .cv {
    grid-template-columns: 1fr;
  }

  .cv-main {
    display: contents;
  }

  .cv-header {
    order: -1;
    margin: 0;
    /* Extra room on top so the PDF link sits above the headline, not beside it */
    padding: 3rem 1.5rem 1.75rem;
    /* Here the header sits above the sidebar, so it keeps a line to separate them */
    border-bottom: 1px solid var(--border);
  }

  .resume-main {
    padding: 2rem 1.5rem;
  }

  .cv-side {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.75rem 1.5rem;
  }

  .cv-side-inner {
    position: static;
  }
}

/* ---------- Hobbies ---------- */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.hobby {
  padding: 1.75rem;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.hobby:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.hobby-art {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 58px;
  height: 58px;
  overflow: visible;
  pointer-events: none;
}

.hobby-art circle,
.hobby-art path {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-base * {
  stroke: color-mix(in srgb, var(--text) 13%, transparent);
}

.art-glow {
  filter: drop-shadow(0 0 4px var(--glow)) drop-shadow(0 0 12px var(--glow));
}

.art-glow * {
  stroke: var(--glow);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.9s var(--ease-out);
}

.hobby:hover .art-glow * {
  stroke-dashoffset: 0;
}

.hobby h2,
.hobby .tagline {
  padding-right: 70px;
}

.hobby h2 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.hobby .tagline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.hobby p:last-child {
  color: var(--muted);
  font-size: 0.975rem;
  margin-bottom: 0;
}

.hobby-gaming { --glow: #b388ff; }
.hobby-ball { --glow: #ff9142; }
.hobby-music { --glow: #5fb3ff; }
.hobby-family { --glow: #ff5c8a; }

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

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
  font-size: 0.925rem;
  color: var(--muted);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem 2rem;
}

.footer-inner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.2s, transform 0.25s var(--ease-out);
}

.footer-links a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer-links svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* The signature shares the pills' line, pushed out to the far right */
.footer-mark-item {
  position: relative;
  justify-self: end;
  display: flex;
  margin-left: clamp(1rem, 4vw, 3rem);
}

.footer-mark {
  width: auto;
  height: 46px;
  visibility: hidden;
}

.footer-mark-item:hover {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--neon) 70%, transparent));
}

:root[data-theme="dark"] .footer-links svg {
  color: var(--accent-deep);
}

/* The signature is painted in the theme's deep accent (violet at night, orange by day). Its colour
   lives inside the SVG file, so it is repainted through a mask and the <img> only holds the space. */
.footer-mark-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-deep);
  -webkit-mask: url("assets/signature.svg") center / contain no-repeat;
  mask: url("assets/signature.svg") center / contain no-repeat;
  opacity: 0.85;
}

.footer-mark-item:hover::before {
  opacity: 1;
}

@media (max-width: 600px) {
  .site-footer {
    border-top: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    column-gap: 1rem;
  }

  .footer-inner > div {
    grid-column: 1 / -1;
  }

  /* Smaller pills, so all three stay on one line next to the signature */
  .footer-links {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .footer-links a {
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    font-size: clamp(0.74rem, 3.4vw, 0.85rem);
    white-space: nowrap;
  }

  .footer-links svg {
    width: 13px;
    height: 13px;
  }

  .footer-mark-item {
    margin-left: 0;
  }
}

/* ---------- Deep-link highlight ---------- */
.prose p:target,
.personal-note:target,
.check-list li:target {
  animation: highlight 2.4s var(--ease-out);
}

.prose p:target,
.check-list li:target {
  border-radius: 8px;
}

@keyframes highlight {
  0%,
  35% {
    background: color-mix(in srgb, var(--neon) 16%, transparent);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--neon) 16%, transparent);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 10px transparent;
  }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  --delay: 0s;
}

.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--delay);
}

.reveal-ready .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Page transitions ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-group(page) {
  animation-duration: 0.55s;
  animation-timing-function: var(--ease-out);
}

::view-transition-group(nav-indicator) {
  animation-duration: 0.55s;
  animation-timing-function: var(--ease-out);
}

html[data-dir="forward"]::view-transition-old(page) {
  animation: 0.55s var(--ease-out) both slide-to-left;
}
html[data-dir="forward"]::view-transition-new(page) {
  animation: 0.55s var(--ease-out) both slide-from-right;
}
html[data-dir="back"]::view-transition-old(page) {
  animation: 0.55s var(--ease-out) both slide-to-right;
}
html[data-dir="back"]::view-transition-new(page) {
  animation: 0.55s var(--ease-out) both slide-from-left;
}

@keyframes slide-to-left {
  to { transform: translateX(-100%); opacity: 0.3; }
}
@keyframes slide-from-right {
  from { transform: translateX(100%); opacity: 0.3; }
}
@keyframes slide-to-right {
  to { transform: translateX(100%); opacity: 0.3; }
}
@keyframes slide-from-left {
  from { transform: translateX(-100%); opacity: 0.3; }
}

.fallback-leave-forward .page { animation: 0.3s ease-in both slide-to-left; }
.fallback-leave-back .page { animation: 0.3s ease-in both slide-to-right; }
.fallback-enter-forward .page { animation: 0.5s var(--ease-out) both slide-from-right; }
.fallback-enter-back .page { animation: 0.5s var(--ease-out) both slide-from-left; }

/* ---------- Dark theme: glass cards and neon accents ---------- */
/* Pitch-black polished glass with a faint violet tint (the green personal note keeps its own look) */
:root[data-theme="dark"] .card:not(.personal-note) {
  --accent: #9466f5;
  --chip-text: #a183f0;
  --chip-border: #7c3aed;
  --glass-edge:
    inset 0 1px 0 rgb(255 255 255 / 0.32),
    inset 0 -1px 0 rgb(255 255 255 / 0.1),
    inset 0 0 0 3px rgb(0 0 0 / 0.55),
    inset 0 0 0 4px rgb(220 205 255 / 0.07);
  background:
    linear-gradient(118deg, rgb(255 255 255 / 0.085) 0%, rgb(255 255 255 / 0.035) 42%, transparent 42.4%),
    linear-gradient(180deg, #0d0a13 0%, #050308 60%, #020103 100%);
  border-color: rgb(225 215 255 / 0.24);
  box-shadow: var(--glass-edge), 0 18px 40px -20px rgb(0 0 0 / 0.9);
}

:root[data-theme="dark"] .project:hover,
:root[data-theme="dark"] .hobby:hover {
  border-color: rgb(225 215 255 / 0.45);
  box-shadow: var(--glass-edge), 0 6px 10px -8px rgb(0 0 0 / 0.9), inset 0 0 22px -6px color-mix(in srgb, var(--neon) 55%, transparent);
}

:root[data-theme="dark"] .project-media {
  --accent: #b890ff;
}

:root[data-theme="dark"] .btn-primary {
  border-color: color-mix(in srgb, var(--neon) 75%, transparent);
  box-shadow: 0 0 16px -8px color-mix(in srgb, var(--neon) 80%, transparent);
}

:root[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #9d5cff, #6a2fd6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 24px -6px color-mix(in srgb, var(--neon) 70%, transparent);
}

:root[data-theme="dark"] .filter[aria-pressed="true"] {
  background: linear-gradient(135deg, #9d5cff, #6a2fd6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 18px -4px color-mix(in srgb, var(--neon) 70%, transparent);
}


/* ---------- Resume: reading effects (story.js) ---------- */
.resume-main h2::after {
  transform-origin: left;
  transition: transform 1.1s var(--ease-out) 0.2s;
}

.reveal-ready .resume-main > section:not(.in) h2::after {
  transform: scaleX(0);
}

.skill-words li,
.check-list li {
  transition: opacity 0.45s ease, transform 0.55s var(--ease-out);
  transition-delay: calc(0.15s + var(--i, 0) * 40ms);
}

.reveal-ready .reveal:not(.in) .skill-words li,
.reveal-ready .reveal:not(.in) .check-list li {
  opacity: 0.4;
  transform: translateY(4px);
}

.dots i {
  transition: opacity 0.35s ease calc(0.3s + var(--i, 0) * 90ms);
}

.reveal-ready .reveal:not(.in) .dots i.on {
  opacity: 0.2;
}

.story-ready .timeline::before {
  background: var(--border);
}

.timeline::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 2px;
  height: calc((100% - 16px) * var(--fill, 0));
  border-radius: 2px;
  z-index: 0;
  background: linear-gradient(var(--neon), var(--accent));
  box-shadow: 0 0 8px color-mix(in srgb, var(--neon) 70%, transparent);
}

:root:not(.story-ready) .timeline::after {
  display: none;
}

/* Dots sit above the fill line */
.timeline > li::before {
  z-index: 1;
  transition: background-color 0.35s, box-shadow 0.35s;
}

.story-ready .timeline > li.is-passed::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--neon) 18%, transparent), 0 0 12px color-mix(in srgb, var(--neon) 55%, transparent);
}

/* ---------- Section rail (right edge) ---------- */
.rail {
  position: fixed;
  z-index: 40;
  right: clamp(10px, 1.6vw, 26px);
  top: 50%;
  transform: translateY(-50%);
}

.rail ol {
  display: grid;
  justify-items: end;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 7px 0 7px 12px;
  color: var(--muted);
  text-decoration: none;
}

.rail-text {
  display: flex;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}

.rail-tick {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.5;
  transition: width 0.45s var(--ease-out), opacity 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.rail a:hover .rail-tick,
.rail a:focus-visible .rail-tick {
  width: 22px;
  opacity: 1;
}

.rail a:hover .rail-text,
.rail a:focus-visible .rail-text {
  opacity: 1;
  transform: none;
}

.rail a[aria-current] {
  color: var(--text);
}

.rail a[aria-current] .rail-tick {
  width: 36px;
  opacity: 1;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}

/* There is only room for the current section's name beside wide layouts */
@media (min-width: 1380px) {
  .rail a[aria-current] .rail-text {
    opacity: 1;
    transform: none;
  }
}

/* The rail lives in the page margin, so it only shows when there is margin to spare */
@media (max-width: 1199px) {
  .rail {
    display: none;
  }
}

/* ---------- Cloth images (cloth.js) ---------- */
.cloth-canvas {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 18px 22px rgb(20 10 30 / 0.28));
}

img.cloth-hidden {
  opacity: 0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  .reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Print ("Download as PDF" on the resume) ---------- */
/* Prints the résumé exactly as it looks on screen in light mode: the desktop layout is laid out at
   screen width and scaled down to fit an A4 page, instead of being restyled for paper. */
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  :root[data-theme="dark"] {
    --bg: #fbfaf6;
    --surface: #ffffff;
    --surface-2: #f5f2eb;
    --text: #1c1a17;
    --muted: #625d55;
    --border: #e8e3d8;
    --accent: #c2410c;
    --accent-deep: #c2410c;
    --accent-strong: #7c2d12;
    --accent-soft: #fff1e6;
    --chip-border: #c2410c;
    --chip-text: #9a3412;
    --neon: #ff6a1a;
    --on-accent: #ffffff;
    color-scheme: light;
  }

  .site-nav,
  .site-footer,
  .theme-toggle,
  .lang-toggle,
  .skip-link,
  .rail,
  .rail-spacer,
  .cta,
  .cv-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* 1000px of screen layout across the printable A4 width (186mm, about 703px) */
  .cv-wrap {
    width: 1000px;
    max-width: none;
    margin: 0;
    padding: 0;
    zoom: 0.703;
  }

  .cv,
  :root[data-theme="dark"] .cv {
    box-shadow: none;
  }

  .cv-side-inner {
    position: static;
  }

  .details .print-only {
    display: grid;
  }

  /* Nothing waits for a scroll animation on paper */
  .reveal-ready .reveal,
  .reveal-ready .reveal .word > span,
  .skill-words li,
  .check-list li,
  .dots i,
  .resume-main h2::after {
    opacity: 1 !important;
    transform: none !important;
  }

  .timeline::after {
    display: none;
  }

  /* Keep headings with what follows, and entries in one piece */
  .resume-main h2 {
    break-after: avoid;
  }

  .timeline > li,
  .strength,
  .skill-group {
    break-inside: avoid;
  }
}
