/* One neutral page tone with plain white cards: the old warm beige read as
   yellow next to the white panels. Body copy is darker than before; the old
   grey-blue passed contrast on paper but was tiring in long paragraphs. */
:root {
  --bg: #f3f4f6;
  --bg-soft: rgba(255, 255, 255, 0.66);
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --header-surface: rgba(255, 255, 255, 0.75);
  --header-border: rgba(255, 255, 255, 0.7);
  --text: #10243f;
  --text-soft: #2f3b4c;
  --border: rgba(16, 36, 63, 0.12);
  --border-strong: rgba(13, 75, 217, 0.24);
  --blue: #0d4bd9;
  --blue-deep: #0a2f86;
  --teal: #0b9188;
  --amber: #ffb100;
  --coral: #ff6b4a;
  --shadow: 0 1px 2px rgba(16, 36, 63, 0.05), 0 8px 24px rgba(16, 36, 63, 0.06);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --max-width: 1240px;
  --anchor-offset: 8rem;
  --motobug-width: 40px;
  --motobug-height: 29px;
  --motobug-scale: 1.5;
  --motobug-lane-inset: 18px;
  --motobug-lane-fade: 26px;
  --nav-end-spacer: 0px;
  color-scheme: light;
}

/* Dark mode in neutral near-black rather than saturated navy: navy with a blue
   glow is the stock look of generated sites, and it fought the content. */
:root[data-theme="dark"] {
  --bg: #0c0f14;
  --bg-soft: rgba(26, 31, 40, 0.7);
  --surface: #141821;
  --surface-strong: #1a1f29;
  --header-surface: rgba(14, 17, 23, 0.78);
  --header-border: rgba(255, 255, 255, 0.12);
  --text: #eff3f8;
  --text-soft: #c3cad5;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(104, 164, 255, 0.32);
  --blue: #68a4ff;
  --blue-deep: #9dc2ff;
  --teal: #4fd1c5;
  --amber: #ffd166;
  --coral: #ff8d73;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}

/* Manrope's 400 has thin strokes that tire the eye in long paragraphs; 500 is
   the same face with enough weight to read comfortably. Elements that set
   their own weight (headings, buttons, labels) are unaffected. */
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  color: var(--text);
  overflow-x: hidden;
  isolation: isolate;
  background: var(--bg);
  min-height: 100vh;
}

body,
body::before,
body::after,
.site-header,
.nav a,
.theme-toggle,
.theme-toggle__track,
.theme-toggle__icon,
.theme-toggle__thumb,
.hero-copy,
.hero-panel,
.content-card,
.skill-panel,
.project-card,
.contact-card,
.spotlight,
.timeline-item,
.summary-card,
.profile-figure,
.button,
.quick-links a,
.link-button,
.metric-card,
.tag-cloud span,
.project-media,
.video-list article,
.copy-card,
.site-footer {
  transition:
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    color 240ms ease,
    opacity 240ms ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #0c0f14;
  opacity: 0;
}

:root[data-theme="dark"] body::after {
  opacity: 1;
}

body[id],
header[id],
main[id],
section[id] {
  scroll-margin-top: var(--anchor-offset);
}

/* No background grid: a faint blueprint grid is one of the clearest
   "generated site" signatures, and it added nothing the content needed. */
body::before {
  content: none;
}

main::after {
  content: "";
  display: block;
  height: var(--nav-end-spacer);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
.section,
.site-footer {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  background: var(--header-surface);
  border: 1px solid var(--header-border);
  backdrop-filter: blur(18px);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(16, 36, 63, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
  color: inherit;
  text-decoration: none;
  border-radius: 999px;
}

.brand:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.brand strong,
.brand p {
  margin: 0;
}

.brand-mark {
  display: block;
  width: 2.85rem;
  height: 2.85rem;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(13, 75, 217, 0.18);
  box-shadow: 0 10px 20px rgba(16, 36, 63, 0.12);
}

.brand-mark__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  transform: scale(1.14);
  transform-origin: 50% 46%;
}

.nav {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.nav a.is-active,
.nav a[aria-current="page"] {
  color: var(--blue-deep);
  background: rgba(13, 75, 217, 0.1);
  box-shadow: inset 0 0 0 1px rgba(13, 75, 217, 0.14);
}

.theme-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 3.75rem;
  height: 2.1rem;
  padding: 0.16rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  color: var(--text-soft);
  cursor: pointer;
  box-shadow: none;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--border-strong);
}

.theme-toggle__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.theme-toggle__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  transition:
    opacity 180ms ease,
    color 180ms ease;
}

.theme-toggle__icon svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle__thumb {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: calc(50% - 0.32rem);
  height: calc(100% - 0.32rem);
  border-radius: 50%;
  background: rgba(13, 75, 217, 0.1);
  border: 1px solid rgba(13, 75, 217, 0.14);
  transition:
    transform 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease;
}

:root[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(calc(100% + 0.32rem));
  background: rgba(104, 164, 255, 0.14);
  border-color: rgba(104, 164, 255, 0.2);
}

:root:not([data-theme="dark"]) .theme-toggle__icon--sun,
:root[data-theme="dark"] .theme-toggle__icon--moon {
  color: var(--blue);
  opacity: 1;
}

.motobug-lane {
  position: relative;
  flex: 1 1 12rem;
  align-self: stretch;
  min-width: 10rem;
  min-height: 3.25rem;
  pointer-events: none;
  overflow: visible;
}

.motobug-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right,
      transparent 0,
      #000 var(--motobug-lane-fade),
      #000 calc(100% - var(--motobug-lane-fade)),
      transparent 100%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-image: linear-gradient(to right,
      transparent 0,
      #000 var(--motobug-lane-fade),
      #000 calc(100% - var(--motobug-lane-fade)),
      transparent 100%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

.motobug-runner {
  position: absolute;
  left: 0;
  bottom: 0.25rem;
  width: calc(var(--motobug-width) * var(--motobug-scale));
  height: calc(var(--motobug-height) * var(--motobug-scale));
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.motobug-body {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--motobug-width);
  height: var(--motobug-height);
  transform: scale(var(--motobug-scale));
  transform-origin: left bottom;
  overflow: visible;
  z-index: 1;
}

.motobug-smoke-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.motobug-shadow-sprite,
.motobug-sprite,
.motobug-puff-shadow,
.motobug-puff-sprite {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
}

.motobug-shadow-sprite {
  position: absolute;
  left: 0;
  bottom: -5px;
  width: auto;
  height: auto;
  max-width: none;
  opacity: 0.14;
  filter: brightness(0) saturate(0) contrast(1.08);
  transform-origin: center bottom;
  mix-blend-mode: multiply;
  z-index: 0;
  pointer-events: none;
}

.motobug-puff {
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(8px * var(--motobug-scale));
  height: calc(8px * var(--motobug-scale));
  transform: translate3d(0, 0, 0);
  will-change: transform;
  pointer-events: none;
  z-index: 0;
}

.motobug-puff-body {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  transform: scale(var(--motobug-scale));
  transform-origin: left bottom;
  overflow: visible;
}

.motobug-puff-shadow {
  position: absolute;
  left: 0;
  bottom: 0;
  height: auto;
  max-width: none;
  opacity: 0.12;
  filter: brightness(0.6) saturate(0) contrast(0.88);
  transform: scale(0.64, 0.22);
  transform-origin: center bottom;
  z-index: 0;
  pointer-events: none;
}

:root[data-theme="dark"] .motobug-shadow-sprite {
  opacity: 0;
}

:root[data-theme="dark"] .motobug-puff-shadow {
  opacity: 0 !important;
}

.motobug-sprite,
.motobug-puff-sprite {
  position: absolute;
  left: 0;
  bottom: 0;
  width: auto;
  height: auto;
  max-width: none;
  transform-origin: center bottom;
}

.motobug-sprite {
  z-index: 2;
}

.motobug-puff-sprite {
  z-index: 1;
}

.motobug-runner.is-facing-right .motobug-shadow-sprite {
  transform: scaleX(-1) scaleY(0.46);
}

.motobug-runner.is-facing-left .motobug-shadow-sprite {
  transform: scaleY(0.46);
}

.motobug-runner.is-facing-right .motobug-sprite {
  transform: scaleX(-1);
}

.motobug-runner.is-facing-left .motobug-sprite {
  transform: none;
}

.nav a:hover,
.nav a:focus-visible,
.quick-links a:hover,
.quick-links a:focus-visible,
.project-card a:not(.button):hover,
.project-card a:not(.button):focus-visible,
.contact-links a:hover,
.contact-links a:focus-visible {
  color: var(--blue);
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(13, 75, 217, 0.05);
}

.section {
  padding: 4.35rem 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.9fr);
  gap: 1.6rem;
  align-items: stretch;
  padding-top: 3.75rem;
}

/* One level of cards, opaque, no frosted glass. The hero copy is deliberately
   not in this list: it sits on the page itself, so the photo panel next to it
   is the only card and nothing is nested inside a card inside a card. */
.content-card,
.skill-panel,
.project-card,
.contact-card,
.spotlight,
.timeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.spotlight {
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 1.45vw, 1.95rem);
}

.hero-copy {
  padding: clamp(1.25rem, 1.45vw, 1.95rem) 0;
}

.hero-panel {
  display: grid;
  gap: 0.85rem;
  align-content: space-between;
}

/* Small labels in the body face, sentence case. Spaced-out monospace capitals
   above every heading were the most recognisable template signature. */
.eyebrow {
  margin: 0 0 0.5rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(1.95rem, 4.35vw, 3.45rem);
  max-width: 16ch;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 3.45vw, 2.95rem);
  max-width: 18ch;
  line-height: 1.06;
  text-wrap: balance;
}

/* Tight tracking only suits the large headings; at h3 size the letters touch. */
h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lead,
.hero-copy p,
.section-heading p:not(.eyebrow),
.content-card p,
.timeline-item p,
.project-card p,
.spotlight p,
.contact-card p,
.site-footer p {
  line-height: 1.75;
  color: var(--text-soft);
}

.lead {
  margin: 1.15rem 0 0;
  max-width: 58ch;
  font-size: 1.03rem;
}

.summary-card {
  padding: 1.2rem;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(13, 75, 217, 0.12), rgba(11, 145, 136, 0.08)),
    var(--surface-strong);
  border: 1px solid var(--border-strong);
}

.hero-panel-intro {
  padding: 0.08rem 0.08rem 0;
}

.hero-panel-intro p {
  margin: 0;
}

.hero-panel-intro .eyebrow {
  margin-bottom: 0.3rem;
}

.hero-panel-intro p:not(.eyebrow) {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.profile-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  box-shadow: 0 14px 34px rgba(16, 36, 63, 0.1);
}

.profile-figure::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/justin-laponder-portfolio.jpg") center / cover;
  filter: blur(16px);
  opacity: 0.24;
  transform: scale(1.08);
}

.profile-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 3.4 / 3;
  object-fit: cover;
  object-position: 50% 42%;
  transform: translateY(2%) scale(1.2);
  transform-origin: 50% 42%;
}

.summary-list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
}

.summary-list li+li {
  margin-top: 0.48rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.3rem 0 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  min-height: 3.05rem;
  padding: 0 1.1rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

/* Solid fill, no gradient and no coloured glow underneath. */
.button-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}

:root[data-theme="dark"] .button-primary {
  background: #3f7fda;
  color: #f7fbff;
  box-shadow: none;
}

.button-secondary {
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.button-sm {
  min-height: 2.3rem;
  padding: 0 0.85rem;
  font-size: 0.9rem;
}

.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.project-actions .button {
  display: flex;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  font-size: 0.85rem;
}

.project-actions .button-primary {
  border: 1px solid rgba(157, 194, 255, 0.42);
}

.project-actions .button-secondary {
  background: var(--surface-strong);
}

.project-actions .button:hover {
  transform: translateY(-2px);
}

.button-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.quick-links {
  display: flex;
  gap: 0.9rem 1.2rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-links a,
.link-button {
  font-weight: 700;
  text-decoration: none;
  color: var(--text-soft);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.panel-terminal {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(160deg, #10243f 0%, #17386f 70%, #0b9188 150%);
  color: #f1f7ff;
}

.terminal-bar {
  display: flex;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.1);
}

.terminal-bar span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
}

.terminal-bar span:nth-child(1) {
  background: #ff7a59;
}

.terminal-bar span:nth-child(2) {
  background: #ffcc45;
}

.terminal-bar span:nth-child(3) {
  background: #63e6be;
}

.terminal-body {
  padding: 1rem 1.2rem 1.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.92rem;
  line-height: 1.8;
}

.terminal-body p {
  margin: 0;
}

.terminal-label {
  display: inline-block;
  min-width: 11ch;
  color: #8fdcff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.hero-panel .metric-grid {
  margin-top: 0;
}

.hero-metric-grid {
  gap: 0.75rem;
}

/* Facts as a plain list with a hairline above each, not as cards inside the
   hero card. */
.metric-card {
  padding: 0.7rem 0 0;
  border-radius: 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--border);
}

.metric-card strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  line-height: 1.08;
  color: var(--blue-deep);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.metric-card span {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.hero-panel .metric-card {
  padding: 0.7rem 0 0;
}

.hero-panel .metric-card strong {
  font-size: 0.95rem;
}

.hero-panel .metric-card span {
  margin-top: 0.26rem;
  font-size: 0.88rem;
  line-height: 1.34;
}

/* --------------------------------------------------------------------------
   Lists instead of card grids
   Experience, skills and working method used to be rows of identical rounded
   cards, the same rhythm every section, which is what made the page read as a
   template. They are now typographic lists: a label column and a content
   column, separated by hairlines. Cards are kept for projects, where there is
   an image to frame.
   -------------------------------------------------------------------------- */
.cv-list,
.skill-rows,
.principles {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-rows {
  border-top: 1px solid var(--border);
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.3fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

/* Two columns, so the whole chapter fits one screen like the old card row
   did; each section is meant to be read without scrolling inside it. */
.cv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
}

/* Logo in its own column so the list can be scanned by employer at a glance.
   The logos are the organisations' own marks, set as equal square tiles. */
.cv-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
  /* An item next to a longer one is stretched to the same height; without this
     the extra height is shared out over the rows and pushes the title down. */
  align-content: start;
  padding: 0.95rem 0 1.1rem;
  border-top: 1px solid var(--border);
}

.cv-logo {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}

.cv-when,
.cv-what {
  grid-column: 2;
}

.cv-when {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}

/* Sized to sit between the project-card copy and the hero intro, so these
   lists match the scale of the rest of the site instead of standing out. */
.cv-what h3 {
  font-size: 1.06rem;
}

.cv-what h3 a {
  color: inherit;
  text-decoration: none;
}

.cv-what h3 a:hover,
.cv-what h3 a:focus-visible {
  text-decoration: underline;
}

.cv-role {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue);
}

.cv-what p:not(.cv-role) {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.cv-what p a {
  color: var(--blue);
}

.skill-row {
  padding: 0.9rem 0;
}

.skill-row dt {
  font-size: 0.9rem;
  font-weight: 700;
}

.skill-row dd {
  max-width: 68ch;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.skill-row dd a {
  color: var(--blue);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem;
}

/* Each point opens with the project it comes from, shown the same way as the
   logos under Ervaring, then a rule that lines the three columns up. */
.principles__project {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.principles__project img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--border);
}

.principles__project p {
  display: grid;
  margin: 0;
}

.principles__project strong {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.principles__project span {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.principles__nr {
  display: block;
  margin-bottom: 0.7rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--text);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--blue);
}

.principles h3 {
  margin-bottom: 0.45rem;
  font-size: 1.06rem;
}

.principles > li > p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .principles {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

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

@media (max-width: 700px) {
  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

.section-heading {
  display: grid;
  gap: 0.72rem;
  margin-bottom: 1.75rem;
}

.section-heading .eyebrow,
.section-heading p:not(.eyebrow) {
  margin: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 56ch;
}

.split-section .section-heading {
  margin-bottom: 2.15rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
}

.timeline-year,
.project-meta {
  font-family: "Manrope", sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
}

.timeline-item p,
.project-card p {
  margin: 0.8rem 0 0;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

.card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card,
.skill-panel,
.project-card,
.contact-card {
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.content-card h3,
.skill-panel h3,
.project-card h3,
.contact-card h3 {
  margin-bottom: 0.8rem;
}

.skills-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0 0.78rem;
  border-radius: 999px;
  background: rgba(13, 75, 217, 0.08);
  border: 1px solid rgba(13, 75, 217, 0.14);
  color: var(--blue-deep);
  font-weight: 700;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.current-section {
  padding-top: 2.1rem;
  padding-bottom: 2.35rem;
}

.current-section .section-heading {
  gap: 0.42rem;
  margin-bottom: 0.9rem;
}

.current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.project-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* The blue glow blob that used to sit in the corner of every project card is
   gone. The --featured ::after rules further down only resize it and never set
   content, so switching it off here switches it off everywhere. */
.project-card::after {
  content: none;
}

.project-card>* {
  position: relative;
  z-index: 1;
}

.current-card {
  padding: 0.86rem;
  height: 100%;
  min-width: 0;
}

.current-card .project-top {
  gap: 0.36rem;
}

.current-card .project-meta {
  font-size: 0.84rem;
  letter-spacing: normal;
}

.current-card h3 {
  margin-bottom: 0.42rem;
  font-size: 1.08rem;
  line-height: 1.08;
}

.current-card p {
  margin-top: 0.46rem;
  font-size: 0.9rem;
  line-height: 1.42;
}

.project-media {
  aspect-ratio: 16 / 9;
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid rgba(13, 75, 217, 0.12);
  border-radius: 14px;
  background: rgba(13, 75, 217, 0.06);
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media--bimmy {
  background: #f68ea8;
}

.project-media--voyagevista {
  background: #ff6c13;
}

.current-card .project-media {
  aspect-ratio: 16 / 3.55;
  margin-bottom: 0.58rem;
  border-radius: 12px;
}

.project-media--stauder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.54rem, 1.3vw, 0.88rem);
  background: #050505;
}

.project-media--ios {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0;
  background: transparent;
  border-color: transparent;
}

.project-media--bimmy img,
.project-media--voyagevista img {
  object-fit: cover;
  object-position: center;
}

.project-media--stauder img,
.project-media--ios img {
  object-fit: contain;
  object-position: center;
}

.project-media--ios img {
  width: auto;
  height: 100%;
  max-width: 100%;
}

.project-media--ios img {
  border-radius: 22%;
  box-shadow: 0 6px 16px rgba(16, 36, 63, 0.16);
}

.project-top {
  display: grid;
  gap: 0.5rem;
}

.project-card a:not(.button),
.contact-card a,
.contact-links a,
.copy-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.copy-card {
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.project-card a:not(.button) {
  margin-top: auto;
  padding-top: 1rem;
}

@media (min-width: 981px) and (max-height: 980px) {
  #projecten {
    padding-top: 1.7rem;
    padding-bottom: 1.7rem;
  }

  #projecten .section-heading {
    gap: 0.42rem;
    margin-bottom: 0.95rem;
  }

  #projecten h2 {
    font-size: clamp(1.9rem, 2.45vw, 2.35rem);
    max-width: 20ch;
  }

  #projecten .project-card {
    padding: 0.9rem;
  }

  #projecten .project-media {
    aspect-ratio: 3.25 / 1;
    margin-bottom: 0.62rem;
    border-radius: 11px;
  }

  #projecten .project-meta {
    font-size: 0.75rem;
    letter-spacing: 0.085em;
  }

  #projecten .project-card h3 {
    margin-bottom: 0.45rem;
    font-size: 1.08rem;
  }

  #projecten .project-card p {
    margin-top: 0.55rem;
    font-size: 0.87rem;
    line-height: 1.38;
  }

  #projecten .project-card a:not(.button) {
    padding-top: 0.58rem;
    font-size: 0.94rem;
  }
}

.spotlight {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  background:
    linear-gradient(135deg, rgba(13, 75, 217, 0.11), rgba(11, 145, 136, 0.09)),
    var(--surface);
}

.video-list {
  display: grid;
  gap: 0.9rem;
}

.video-list article {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
}

.video-list span {
  display: block;
  margin-bottom: 0.45rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coral);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.1rem;
  flex-wrap: wrap;
  padding: 0 0 3rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.internetnl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    filter 240ms ease;
}

.internetnl-badge:hover,
.internetnl-badge:focus-visible {
  opacity: 0.86;
  transform: translateY(-1px);
}

.internetnl-badge:focus-visible {
  outline: 3px solid rgba(13, 75, 217, 0.28);
  outline-offset: 4px;
}

.internetnl-badge img {
  display: block;
  width: 140px;
  height: auto;
  max-width: 100%;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  min-width: 220px;
  max-width: min(90vw, 360px);
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(16, 36, 63, 0.94);
  color: #fff;
  box-shadow: 0 14px 30px rgba(16, 36, 63, 0.2);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

@media (min-width: 1600px) {
  :root {
    --max-width: 1300px;
    --anchor-offset: 8.2rem;
    --motobug-scale: 1.55;
  }

  .section {
    padding: 4.6rem 0;
  }

  .hero {
    grid-template-columns: minmax(0, 1.24fr) minmax(312px, 0.82fr);
    gap: 1.85rem;
    padding-top: 4.05rem;
  }

  .spotlight {
    padding: clamp(1.3rem, 1.55vw, 2.05rem);
  }

  h1 {
    font-size: clamp(2.05rem, 4vw, 3.65rem);
  }
}

@media (min-width: 1850px) {
  :root {
    --max-width: 1380px;
    --anchor-offset: 8.4rem;
    --motobug-scale: 1.6;
  }

  .hero {
    grid-template-columns: minmax(0, 1.28fr) minmax(330px, 0.86fr);
    gap: 2rem;
    padding-top: 4.3rem;
  }

  h1 {
    font-size: clamp(2.1rem, 3.6vw, 3.8rem);
  }
}

@media (max-width: 1536px) and (min-width: 981px) {
  :root {
    --max-width: 1160px;
    --anchor-offset: 7.2rem;
    --motobug-scale: 1.4;
  }

  .site-header {
    top: 0.78rem;
    margin-top: 0.78rem;
    padding: 0.64rem 0.82rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1.18fr) minmax(254px, 0.71fr);
    gap: 1rem;
    padding-top: 2.5rem;
  }

  .spotlight {
    padding: clamp(1.02rem, 1.1vw, 1.34rem);
  }

  .hero-panel {
    gap: 0.64rem;
  }

  h1 {
    font-size: clamp(1.68rem, 3.15vw, 2.62rem);
  }

  h2 {
    font-size: clamp(1.7rem, 2.55vw, 2.36rem);
  }

  h3 {
    font-size: 1.16rem;
  }

  .lead {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .summary-card,
  .timeline-item,
  .content-card,
  .skill-panel,
  .project-card,
  .contact-card {
    padding: 1rem;
  }

  .summary-card p {
    line-height: 1.66;
  }

  .button {
    min-height: 2.74rem;
    padding: 0 0.92rem;
    font-size: 0.97rem;
  }

  .hero-actions {
    margin: 0.84rem 0 0.66rem;
  }

  .brand-mark {
    width: 2.72rem;
    height: 2.72rem;
  }

  .nav a {
    font-size: 0.98rem;
  }

  .profile-image {
    aspect-ratio: 3.65 / 3;
  }

  .hero-panel-intro p:not(.eyebrow) {
    font-size: 0.86rem;
    line-height: 1.38;
  }

  .hero-metric-grid {
    gap: 0.66rem;
  }

  .hero-panel .metric-card {
    padding: 0.62rem 0 0;
  }

  .hero-panel .metric-card strong {
    font-size: 0.9rem;
  }

  .hero-panel .metric-card span {
    font-size: 0.84rem;
    line-height: 1.28;
  }
}

@media (max-width: 1366px) and (min-width: 981px) {
  :root {
    --max-width: 1080px;
    --anchor-offset: 6.7rem;
    --motobug-scale: 1.35;
  }

  .section {
    padding: 3.2rem 0;
  }

  .site-header {
    gap: 0.75rem;
    top: 0.72rem;
    margin-top: 0.72rem;
    padding: 0.56rem 0.74rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1.14fr) minmax(236px, 0.66fr);
    gap: 0.78rem;
    padding-top: 2.08rem;
  }

  .spotlight {
    padding: 0.92rem;
  }

  .hero-panel {
    gap: 0.58rem;
  }

  h1 {
    font-size: clamp(1.56rem, 2.7vw, 2.28rem);
    max-width: 14ch;
  }

  h2 {
    font-size: clamp(1.58rem, 2.2vw, 2.14rem);
  }

  h3 {
    font-size: 1.08rem;
  }

  .lead {
    font-size: 0.9rem;
    line-height: 1.54;
  }

  .hero-actions {
    margin: 0.74rem 0 0.58rem;
  }

  .metric-card {
    padding: 0.8rem;
  }

  .summary-card,
  .timeline-item,
  .content-card,
  .skill-panel,
  .project-card,
  .contact-card {
    padding: 0.92rem;
  }

  .summary-card p {
    line-height: 1.6;
  }

  .button {
    min-height: 2.58rem;
    padding: 0 0.84rem;
    font-size: 0.94rem;
  }

  .brand-mark {
    width: 2.62rem;
    height: 2.62rem;
  }

  .nav a {
    font-size: 0.94rem;
  }

  .profile-image {
    aspect-ratio: 3.9 / 3;
  }

  .hero-panel-intro p:not(.eyebrow) {
    font-size: 0.82rem;
    line-height: 1.32;
  }

  .hero-metric-grid {
    gap: 0.58rem;
  }

  .hero-panel .metric-card {
    padding: 0.58rem 0 0;
  }

  .hero-panel .metric-card strong {
    font-size: 0.86rem;
  }

  .hero-panel .metric-card span {
    font-size: 0.8rem;
    line-height: 1.24;
  }
}

@media (max-width: 1100px) and (min-width: 981px) {
  .site-header {
    gap: 0.52rem;
  }

  .brand {
    gap: 0.56rem;
  }

  .brand .eyebrow {
    font-size: 0.78rem;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .brand-mark {
    width: 2.38rem;
    height: 2.38rem;
    border-radius: 50%;
  }

  .motobug-lane {
    flex-basis: 8rem;
    min-width: 7rem;
    min-height: 2.85rem;
  }

  .nav {
    gap: 0.34rem;
  }

  .nav a {
    font-size: 0.86rem;
    padding: 0.34rem 0.46rem;
  }

  .theme-toggle {
    width: 3.1rem;
    height: 1.78rem;
  }
}

@media (max-height: 900px) and (min-width: 981px) {
  :root {
    --anchor-offset: 6.35rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero {
    padding-top: 1.95rem;
  }

  .site-header {
    top: 0.68rem;
    margin-top: 0.68rem;
  }

  .profile-image {
    aspect-ratio: 4.25 / 3;
    object-position: 50% 42%;
    transform-origin: 50% 42%;
  }

  .hero-panel {
    gap: 0.64rem;
  }

  .hero-panel-intro .eyebrow {
    margin-bottom: 0.26rem;
  }

  .hero-panel-intro p:not(.eyebrow) {
    line-height: 1.34;
  }

  .hero-metric-grid {
    gap: 0.62rem;
  }

  .hero-panel .metric-card {
    padding: 0.56rem 0 0;
  }

  .hero-panel .metric-card span {
    margin-top: 0.22rem;
    line-height: 1.22;
  }
}

@media (max-height: 820px) and (min-width: 981px) {
  :root {
    --anchor-offset: 6rem;
  }

  .section {
    padding: 2.75rem 0;
  }

  .hero {
    padding-top: 1.72rem;
  }

  .hero-copy,
  .spotlight {
    padding-top: 0.84rem;
    padding-bottom: 0.84rem;
  }

  .profile-image {
    aspect-ratio: 4.7 / 3;
    object-position: 50% 42%;
    transform-origin: 50% 42%;
  }

  .hero-panel {
    gap: 0.56rem;
  }

  .hero-panel .metric-card {
    padding: 0.5rem 0 0;
  }

  .hero-panel .metric-card span {
    line-height: 1.18;
  }
}

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .site-header {
    border-radius: 28px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .card-grid-3,
  .skills-layout,
  .current-grid,
  .project-grid,
  .spotlight,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .hero-panel .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  /* Collapsing morphs the bar itself into the island: the clip shrinks to a
     pill at the top centre while the full contents fade out underneath. */
  .site-header {
    /* --label-w is the section name's width, set from script.js. The rest of
       the pill is avatar, chevron, gaps and padding: 5.72rem in total. */
    --label-w: 2.8rem;
    --island-w: calc(var(--label-w) + 5.72rem);
    --island-h: 3rem;
    clip-path: inset(0px 0px 0px 0px round 24px);
    transition: clip-path 520ms cubic-bezier(0.32, 1.18, 0.42, 1);
  }

  .site-header.is-mobile-collapsed {
    clip-path: inset(
      0px calc(50% - var(--island-w) / 2) calc(100% - var(--island-h))
      calc(50% - var(--island-w) / 2) round calc(var(--island-h) / 2)
    );
  }

  .site-header > :not(.nav-island) {
    transition:
      opacity 220ms ease 140ms,
      filter 220ms ease 140ms,
      visibility 0s linear 0s;
  }

  .site-header.is-mobile-collapsed > :not(.nav-island) {
    opacity: 0;
    filter: blur(6px);
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 160ms ease,
      filter 160ms ease,
      visibility 0s linear 160ms;
  }
}

@media (max-width: 640px) {
  :root {
    --anchor-offset: 5.6rem;
  }

  .site-header,
  .section,
  .site-footer {
    width: min(calc(100% - 1.2rem), var(--max-width));
  }

  .site-header {
    top: 0.6rem;
    padding: 0.9rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 0.75rem;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.75rem);
    max-width: 16ch;
  }

  h2 {
    font-size: clamp(1.55rem, 6.8vw, 2.15rem);
    max-width: 100%;
    line-height: 1.08;
  }

  .section-heading {
    gap: 0.5rem;
    margin-bottom: 1.35rem;
  }

  .section-heading p:not(.eyebrow) {
    font-size: 0.98rem;
    line-height: 1.62;
  }
}

/* Mobile polish: compact header and better wrapping for long skill labels */
@media (max-width: 640px) {
  .site-header {
    gap: 0.68rem;
    padding: 0.72rem 0.8rem 0.78rem;
    border-radius: 24px;
  }

  .brand {
    gap: 0.58rem;
    padding-right: 4.1rem;
  }

  .brand-mark {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
  }

  .brand .eyebrow {
    font-size: 0.74rem;
  }

  .brand strong {
    font-size: 0.98rem;
    line-height: 1.1;
  }

  .theme-toggle {
    position: absolute;
    top: 0.78rem;
    right: 0.8rem;
    width: 3.05rem;
    height: 1.72rem;
    padding: 0.12rem;
  }

  .theme-toggle__icon svg {
    width: 0.82rem;
    height: 0.82rem;
  }

  .theme-toggle__thumb {
    top: 0.12rem;
    left: 0.12rem;
    width: calc(50% - 0.24rem);
    height: calc(100% - 0.24rem);
  }

  :root[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(calc(100% + 0.24rem));
  }

  .nav {
    width: 100%;
    gap: 0.45rem 0.62rem;
    padding-top: 0.08rem;
  }

  .nav a {
    font-size: 0.96rem;
    line-height: 1.15;
    padding: 0.33rem 0.54rem;
  }

  .tag-cloud {
    align-items: flex-start;
    gap: 0.52rem;
  }

  .tag-cloud span {
    width: fit-content;
    max-width: min(100%, 16rem);
    min-width: 0;
    flex: 0 1 auto;
    white-space: normal;
    font-size: 0.95rem;
    line-height: 1.25;
    min-height: 2rem;
    padding: 0.38rem 0.72rem;
    text-align: left;
  }
}

/* Theme toggle: keep the desktop-style interaction on touch devices, without native tap highlight */
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  background-clip: padding-box;
}

.theme-toggle__track {
  overflow: hidden;
  border-radius: inherit;
}

.theme-toggle:focus {
  outline: none;
}

.theme-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .theme-toggle {
    border-radius: 999px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }
}
.project-card--compass .project-meta {
  font-size: 0.72rem;
  line-height: 1.45;
}

.project-card--compass h3 {
  line-height: 1.12;
}

.project-card--featured {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(260px, 0.78fr);
  gap: clamp(0.9rem, 1.5vw, 1.25rem);
  align-items: center;
  padding: clamp(0.72rem, 1vw, 0.9rem);
  border-color: color-mix(in srgb, var(--blue) 28%, var(--border));
  background:
    linear-gradient(135deg, rgba(13, 75, 217, 0.065), transparent 48%),
    var(--surface);
  box-shadow:
    0 18px 44px rgba(4, 21, 48, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.project-card--featured::after {
  width: 230px;
  height: 230px;
  inset: auto -6% -54% auto;
  opacity: 0.62;
}

.project-card--featured .project-card__content {
  display: grid;
  align-content: center;
  gap: 0.72rem;
  min-width: 0;
  padding: 0.15rem 0.2rem 0.15rem 0;
}

.project-card--featured .project-top {
  gap: 0.42rem;
}

.project-card--featured .project-meta {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
}

.project-card--featured h3 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.72rem);
  line-height: 1.08;
  text-wrap: balance;
}

.project-card--featured .project-card__content > p {
  max-width: 48ch;
  margin: 0;
  font-size: clamp(0.82rem, 0.9vw, 0.92rem);
  line-height: 1.52;
}

.project-card--featured .project-card__contribution {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.05rem;
  color: var(--text-soft);
}

.project-card--featured .project-card__contribution strong {
  color: var(--text);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card--featured .project-card__demo-note {
  padding-top: 0.55rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: color-mix(in srgb, var(--text-soft) 82%, transparent);
  font-size: 0.72rem !important;
  line-height: 1.4 !important;
}


.compass-carousel {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 0.46rem;
  border-radius: 12px;
  outline: none;
}

.compass-carousel:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 34%, transparent);
}

.compass-carousel__viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--border));
  border-radius: 12px;
  background: #0b1019;
  touch-action: pan-y;
  isolation: isolate;
}

.compass-carousel__viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 10, 22, 0.12), transparent 12%, transparent 88%, rgba(3, 10, 22, 0.12)),
    linear-gradient(180deg, rgba(3, 10, 22, 0.06), transparent 18%, transparent 82%, rgba(3, 10, 22, 0.11));
}

.compass-carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.compass-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(12px, 0, 0) scale(0.998);
  pointer-events: none;
  transition:
    opacity 390ms cubic-bezier(0.22, 0.78, 0.2, 1),
    transform 390ms cubic-bezier(0.22, 0.78, 0.2, 1);
  will-change: opacity, transform;
}

.compass-slide.is-active {
  z-index: 2;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.compass-slide.is-preparing-from-left {
  transform: translate3d(-12px, 0, 0) scale(0.998);
}

.compass-slide.is-preparing-from-right {
  transform: translate3d(12px, 0, 0) scale(0.998);
}

.compass-slide.is-leaving-to-left {
  z-index: 1;
  opacity: 1;
  transform: none;
  transition: none;
}

.compass-slide.is-leaving-to-right {
  z-index: 1;
  opacity: 1;
  transform: none;
  transition: none;
}

.compass-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compass-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, rgba(180, 204, 235, 0.18));
  border-radius: 50%;
  background: rgba(8, 18, 34, 0.82);
  color: #dbeafe;
  box-shadow:
    0 8px 22px rgba(2, 10, 24, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.94);
  transition:
    opacity 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.compass-carousel:hover .compass-carousel__arrow,
.compass-carousel:focus-within .compass-carousel__arrow {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.compass-carousel__arrow:hover,
.compass-carousel__arrow:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 70%, #ffffff 10%);
  background: color-mix(in srgb, var(--blue) 24%, rgba(8, 18, 34, 0.96));
  color: #ffffff;
  transform: translateY(-50%) scale(1.055);
}

.compass-carousel__arrow:focus-visible,
.compass-carousel__timer:focus-visible,
.compass-carousel__tabs button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 68%, #ffffff 15%);
  outline-offset: 3px;
}

.compass-carousel__arrow svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.compass-carousel__arrow--previous {
  left: 0.62rem;
}

.compass-carousel__arrow--next {
  right: 0.62rem;
}

.compass-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.34rem 0.38rem 0.34rem 0.44rem;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--border));
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent),
    color-mix(in srgb, var(--surface-strong) 72%, #07111f 28%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root:not([data-theme="dark"]) .compass-carousel__controls {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(242, 247, 255, 0.72)),
    var(--surface);
}

.compass-carousel__tabs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.compass-carousel__tabs::-webkit-scrollbar {
  display: none;
}

.compass-carousel__tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.26rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-family: "Manrope", sans-serif;
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.compass-carousel__tabs button:hover,
.compass-carousel__tabs button:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--border));
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  color: var(--text);
}

.compass-carousel__tabs button.is-active {
  border-color: color-mix(in srgb, var(--blue) 42%, transparent);
  background: color-mix(in srgb, var(--blue) 17%, transparent);
  color: var(--blue-deep);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 8%, transparent);
}

:root[data-theme="dark"] .compass-carousel__tabs button.is-active {
  color: #e7f0ff;
}

.compass-carousel__timer {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.88rem;
  height: 1.88rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--border));
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-strong) 74%, #07111f 26%);
  color: var(--text);
  box-shadow:
    0 6px 16px rgba(2, 10, 24, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

:root:not([data-theme="dark"]) .compass-carousel__timer {
  background: rgba(255, 255, 255, 0.82);
}

.compass-carousel__timer:hover {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--border));
  transform: scale(1.055);
}

.compass-carousel__timer-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.compass-carousel__timer-bg {
  fill: none;
  stroke: color-mix(in srgb, var(--text-soft) 20%, transparent);
  stroke-width: 2.15;
}

.compass-carousel__timer-progress {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-dasharray: 97.39;
  stroke-dashoffset: 97.39;
}

.compass-carousel__timer-icon {
  position: relative;
  z-index: 1;
  width: 0.58rem;
  height: 0.58rem;
  fill: currentColor;
}

.compass-carousel__timer-icon--play {
  display: none;
  margin-left: 0.08rem;
}

.compass-carousel__timer.is-manually-paused .compass-carousel__timer-icon--pause {
  display: none;
}

.compass-carousel__timer.is-manually-paused .compass-carousel__timer-icon--play {
  display: block;
}

@media (max-width: 1180px) {
  .project-grid--portfolio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card--featured {
    width: 100%;
    grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.78fr);
  }

  .project-card--featured h3 {
    font-size: clamp(1.2rem, 2.15vw, 1.55rem);
  }
}

@media (max-width: 820px) {
  .project-card--featured {
    grid-template-columns: 1fr;
    max-width: 720px;
    gap: 0.75rem;
    padding: 0.72rem;
    border-radius: 18px;
  }

  .project-card--featured .project-card__content {
    gap: 0.55rem;
    padding: 0 0.08rem 0.08rem;
  }

  .project-card--featured .project-top {
    gap: 0.34rem;
  }

  .project-card--featured .project-meta {
    font-size: 0.82rem;
    letter-spacing: normal;
  }

  .project-card--featured h3 {
    max-width: none;
    font-size: clamp(1.08rem, 4.6vw, 1.32rem);
    line-height: 1.1;
  }

  .project-card--featured .project-card__content > p {
    max-width: none;
    font-size: 0.81rem;
    line-height: 1.45;
  }

  .project-card--featured .project-card__demo-note {
    font-size: 0.68rem !important;
  }

  .project-card--compass .project-meta {
  font-size: 0.72rem;
  line-height: 1.45;
}

.project-card--compass h3 {
  line-height: 1.12;
}

.project-card--featured {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(260px, 0.78fr);
  gap: clamp(0.9rem, 1.5vw, 1.25rem);
  align-items: center;
  padding: clamp(0.72rem, 1vw, 0.9rem);
  border-color: color-mix(in srgb, var(--blue) 28%, var(--border));
  background:
    linear-gradient(135deg, rgba(13, 75, 217, 0.065), transparent 48%),
    var(--surface);
  box-shadow:
    0 18px 44px rgba(4, 21, 48, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.project-card--featured::after {
  width: 230px;
  height: 230px;
  inset: auto -6% -54% auto;
  opacity: 0.62;
}

.project-card--featured .project-card__content {
  display: grid;
  align-content: center;
  gap: 0.72rem;
  min-width: 0;
  padding: 0.15rem 0.2rem 0.15rem 0;
}

.project-card--featured .project-top {
  gap: 0.42rem;
}

.project-card--featured .project-meta {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
}

.project-card--featured h3 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.72rem);
  line-height: 1.08;
  text-wrap: balance;
}

.project-card--featured .project-card__content > p {
  max-width: 48ch;
  margin: 0;
  font-size: clamp(0.82rem, 0.9vw, 0.92rem);
  line-height: 1.52;
}

.project-card--featured .project-card__contribution {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.05rem;
  color: var(--text-soft);
}

.project-card--featured .project-card__contribution strong {
  color: var(--text);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card--featured .project-card__demo-note {
  padding-top: 0.55rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: color-mix(in srgb, var(--text-soft) 82%, transparent);
  font-size: 0.72rem !important;
  line-height: 1.4 !important;
}


.compass-carousel {
    gap: 0.4rem;
  }

  .project-card--featured .compass-carousel__viewport {
    border-radius: 11px;
  }

  .compass-carousel__arrow {
    width: 2rem;
    height: 2rem;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
  }

  .compass-carousel__arrow--previous {
    left: 0.38rem;
  }

  .compass-carousel__arrow--next {
    right: 0.38rem;
  }

  .compass-carousel__controls {
    gap: 0.32rem;
    padding: 0.3rem 0.32rem 0.3rem 0.36rem;
  }

  .compass-carousel__tabs {
    gap: 0.12rem;
  }

  .compass-carousel__tabs button {
    min-height: 1.58rem;
    padding: 0.22rem 0.46rem;
    font-size: 0.55rem;
  }

  .compass-carousel__timer {
    width: 1.76rem;
    height: 1.76rem;
  }

  .compass-carousel__timer-icon {
    width: 0.54rem;
    height: 0.54rem;
  }
}

@media (max-width: 520px) {
  .project-card--featured {
    padding: 0.62rem;
    gap: 0.66rem;
  }

  .project-card--featured .project-card__content {
    gap: 0.48rem;
  }

  .project-card--featured .project-card__contribution {
    gap: 0.12rem;
  }

  .compass-carousel__tabs button {
    padding-inline: 0.4rem;
    font-size: 0.52rem;
  }
}

@media (hover: none), (pointer: coarse) {
  .compass-carousel__arrow {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .compass-slide,
  .compass-carousel__arrow,
  .compass-carousel__tabs button,
  .compass-carousel__timer {
    transition: none;
  }
}


/* Compass highlight v6: fluid typography without viewport-height shrinking.
   The card scales with available width and is allowed to continue below the fold. */
.project-card--featured {
  width: min(100%, 1200px);
  grid-template-columns: minmax(0, 1.05fr) minmax(350px, 1fr);
  gap: clamp(1rem, 1.7vw, 1.45rem);
  align-items: center;
  padding: clamp(0.78rem, 1.1vw, 0.92rem);
}

.project-card--featured .project-card__content {
  align-content: center;
  gap: clamp(0.72rem, 1vw, 0.85rem);
  padding: clamp(0.2rem, 0.5vw, 0.5rem) clamp(0.12rem, 0.35vw, 0.42rem) 0.2rem 0;
}

.project-card--featured .project-top {
  gap: 0.42rem;
}

.project-card--featured .project-meta {
  font-size: clamp(0.64rem, 0.12vw + 0.6rem, 0.72rem);
  line-height: 1.45;
  letter-spacing: 0.095em;
}

.project-card--featured h3 {
  max-width: none;
  font-size: clamp(1.28rem, 0.9vw + 0.75rem, 1.62rem);
  line-height: 1.08;
}

.project-card--featured .project-card__story {
  gap: clamp(0.68rem, 0.9vw, 0.82rem);
}

.project-card--featured .project-card__story p {
  max-width: none;
  font-size: clamp(0.88rem, 0.18vw + 0.82rem, 0.94rem);
  line-height: 1.54;
}

.project-card--featured .project-card__demo-note {
  margin-top: 0.05rem;
  padding-top: 0.62rem;
  font-size: clamp(0.75rem, 0.08vw + 0.72rem, 0.8rem) !important;
  line-height: 1.45 !important;
}

.project-card--featured .compass-carousel__viewport {
  aspect-ratio: 80 / 43;
}

.project-card--featured .compass-carousel__controls {
  min-height: 2.55rem;
  padding: 0.37rem 0.43rem 0.37rem 0.5rem;
}

.project-card--featured .compass-carousel__tabs button {
  min-height: 1.78rem;
  padding: 0.28rem 0.65rem;
  font-size: clamp(0.62rem, 0.08vw + 0.59rem, 0.68rem);
}

.project-card--featured .compass-carousel__timer {
  width: 1.98rem;
  height: 1.98rem;
}

@media (max-width: 1120px) {
  .project-card--featured {
    width: 100%;
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.9fr);
    gap: 1rem;
  }
}

@media (max-width: 900px) {
  .project-card--featured {
    grid-template-columns: 1fr;
    max-width: 760px;
    gap: 0.9rem;
    padding: clamp(0.7rem, 2.1vw, 0.9rem);
  }

  .project-card--featured .project-card__content {
    gap: 0.72rem;
    padding: 0.1rem 0.12rem 0.15rem;
  }

  .project-card--featured h3 {
    max-width: none;
    font-size: clamp(1.28rem, 3.7vw, 1.65rem);
  }

  .project-card--featured .project-card__story {
    gap: 0.68rem;
  }

  .project-card--featured .project-card__story p {
    max-width: none;
    font-size: clamp(0.94rem, 1.25vw, 1rem);
    line-height: 1.56;
  }

  .project-card--featured .project-card__demo-note {
    font-size: 0.76rem !important;
  }
}

@media (max-width: 560px) {
  .project-card--featured {
    padding: 0.62rem;
    gap: 0.78rem;
  }

  .project-card--featured .project-meta {
    font-size: 0.65rem;
  }

  .project-card--featured h3 {
    font-size: clamp(1.16rem, 6vw, 1.42rem);
  }

  .project-card--featured .project-card__story p {
    font-size: 0.93rem;
    line-height: 1.54;
  }

  .project-card--featured .project-card__demo-note {
    font-size: 0.74rem !important;
  }

  .project-card--featured .compass-carousel__tabs button {
    min-height: 1.72rem;
    padding-inline: 0.52rem;
    font-size: 0.61rem;
  }
}

/* ==========================================================================
   IMAGE MODAL
   ========================================================================== */

.modal {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Glassmorphism backdrop */
.modal::backdrop {
  background: rgba(5, 10, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 300ms ease;
}

/* --backdrop-opacity drops while a finger pulls the image down to dismiss. */
.modal.is-visible::backdrop {
  opacity: var(--backdrop-opacity, 1);
}

/* Container centers everything and allows animation */
.modal__container {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(1rem, 4vh, 2.5rem) clamp(1rem, 3vw, 3rem);
}

/* The image animates itself from script.js (zooming out of the page and back).
   The buttons and caption around it simply fade in and out. */
.modal__close,
.modal__nav,
.modal__text {
  opacity: 0;
  transition-property: opacity, scale, background-color, translate;
  transition-duration: 160ms, 320ms, 160ms, 220ms;
  transition-timing-function: ease, cubic-bezier(0.34, 1.56, 0.64, 1), ease, ease;
}

.modal.is-visible .modal__close,
.modal.is-visible .modal__nav,
.modal.is-visible .modal__text {
  opacity: 1;
  transition-delay: 120ms, 0s, 0s, 0s;
  transition-duration: 280ms, 320ms, 160ms, 220ms;
}

/* Swipes and pulls are handled in script.js; pinch zoom stays available. */
.modal {
  touch-action: pinch-zoom;
}

.modal__ghost {
  position: fixed;
  z-index: 5;
  margin: 0;
  object-fit: contain;
  border-radius: 10px;
  pointer-events: none;
}

.modal__close {
  position: absolute;
  top: clamp(1rem, 2vw, 2rem);
  right: clamp(1rem, 2vw, 2rem);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

.modal__close:hover,
.modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  scale: 1.08;
}

.modal__close svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Lightbox: just the screenshot with its caption below, no card around it.
   Column that fills the screen: the caption takes the height it needs and the
   image shrinks into whatever is left, so nothing ever scrolls or gets cut. */
.modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal__media {
  display: flex;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 0;
  max-width: min(1600px, calc(100vw - 9rem));
  margin: 0;
}

.modal__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.modal__nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  transform: translateY(-50%);
}

.modal.has-gallery .modal__nav {
  display: grid;
}

.modal__nav:hover,
.modal__nav:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  scale: 1.08;
}

/* A press sinks the button in; letting go springs it back. */
.modal__close:active,
.modal__nav:active {
  scale: 0.88;
  transition-duration: 160ms, 90ms, 160ms, 220ms;
}

.modal__nav svg {
  transition: translate 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal__nav--previous:hover svg {
  translate: -2px 0;
}

.modal__nav--next:hover svg {
  translate: 2px 0;
}

.modal__nav svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.modal__nav--previous {
  left: clamp(0.75rem, 2vw, 2rem);
}

.modal__nav--next {
  right: clamp(0.75rem, 2vw, 2rem);
}

.modal__text {
  flex: none;
  display: grid;
  gap: 0.35rem;
  max-width: 90ch;
  text-align: center;
}

.modal__count {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.modal__text h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #ffffff;
}

.modal__description {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
}

.modal__description p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .modal__close,
  .modal__nav,
  .modal__text,
  .modal__nav svg {
    transition-duration: 1ms;
  }
}

@media (max-width: 700px) {
  .modal__media {
    max-width: 100%;
  }

  .modal__nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
}

/* In light mode the lightbox stays light as well: a frosted page colour behind
   the screenshot instead of a dark curtain, with dark text and white buttons. */
:root:not([data-theme="dark"]) .modal::backdrop {
  background: rgba(203, 210, 222, 0.62);
  backdrop-filter: blur(16px) saturate(0.9);
  -webkit-backdrop-filter: blur(16px) saturate(0.9);
}

:root:not([data-theme="dark"]) .modal__close,
:root:not([data-theme="dark"]) .modal__nav {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

:root:not([data-theme="dark"]) .modal__close:hover,
:root:not([data-theme="dark"]) .modal__close:focus-visible,
:root:not([data-theme="dark"]) .modal__nav:hover,
:root:not([data-theme="dark"]) .modal__nav:focus-visible {
  background: #e8eefb;
}

:root:not([data-theme="dark"]) .modal__media img {
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

:root:not([data-theme="dark"]) .modal__count {
  color: var(--blue);
}

:root:not([data-theme="dark"]) .modal__text h3 {
  color: var(--text);
}

:root:not([data-theme="dark"]) .modal__description {
  color: var(--text-soft);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  cursor: default;
}

/* ========================================================================== 
   FINAL RESPONSIVE SYSTEM — verified laptop, tablet, phone and 4K layout
   ========================================================================== */

/* High-resolution displays: slightly larger root type, bounded line lengths. */
@media (min-width: 2200px) {
  html {
    font-size: 17px;
  }

  :root {
    --max-width: 1500px;
  }
}

@media (min-width: 3200px) {
  html {
    font-size: 18px;
  }

  :root {
    --max-width: 1560px;
  }
}

/* Shared action buttons. */
.button,
.contact-action {
  min-width: 0;
  max-width: 100%;
}

.button:focus-visible,
.contact-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
  outline-offset: 3px;
}

:root[data-theme="dark"] .button-primary {
  background: #3f7fda;
  color: #f7fbff;
}

.project-actions,
.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding-top: 1rem;
}

.project-actions .button,
.contact-action {
  display: inline-flex;
  flex: 0 1 auto;
  gap: 0.48rem;
  min-width: 0;
  max-width: 100%;
  min-height: 2.75rem;
  padding-inline: 1rem;
  font-size: 0.88rem;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.button-icon {
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 auto;
}

/* Supplied brand assets used in project and contact buttons. */
.button-logo {
  display: block;
  flex: 0 0 auto;
  width: 1.08rem;
  height: 1.08rem;
  object-fit: contain;
}


.button-logo--discord {
  width: 1.22rem;
  height: 1.05rem;
}

.button-logo--linkedin {
  width: 1.12rem;
  height: 1.12rem;
}

.button-logo-switch {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.button-logo-switch > .button-logo {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.button-logo--theme-dark {
  display: none;
}

:root[data-theme="dark"] .button-logo--theme-light {
  display: none;
}

:root[data-theme="dark"] .button-logo--theme-dark {
  display: block;
}

.button-logo-switch--x {
  width: 1.04rem;
  height: 1.06rem;
}





/* --------------------------------------------------------------------------
   Current projects
   Two columns remain available on normal and 125%-scaled laptops. The layout
   stacks only below 1000 CSS pixels, rather than switching to a phone layout.
   -------------------------------------------------------------------------- */
#nu-bezig.current-section {
  padding-top: clamp(1.7rem, 2.7vw, 2.35rem);
  padding-bottom: clamp(1.9rem, 3vw, 2.65rem);
}

#nu-bezig .section-heading {
  gap: 0.4rem;
  margin-bottom: clamp(0.8rem, 1.25vw, 1.05rem);
}

/* The heading uses the shared section-heading size like every other section. */
#nu-bezig .section-heading h2 {
  max-width: none;
  white-space: normal;
  text-wrap: balance;
}

#nu-bezig .section-heading p:not(.eyebrow) {
  font-size: clamp(0.98rem, 0.2vw + 0.94rem, 1.06rem);
  line-height: 1.45;
}

#nu-bezig .current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.85rem, 1.35vw, 1.2rem);
  align-items: stretch;
}

#nu-bezig .current-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  padding: clamp(0.84rem, 0.8vw, 1rem);
}

#nu-bezig .current-card .project-media {
  width: 100%;
  height: clamp(6.8rem, 8.45vw, 8.35rem);
  aspect-ratio: auto;
  margin-bottom: 0.68rem;
  border-radius: 12px;
}

#nu-bezig .current-card .project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#nu-bezig .current-card .project-top {
  gap: 0.3rem;
}

#nu-bezig .current-card .project-meta {
  font-size: clamp(0.7rem, 0.08vw + 0.68rem, 0.76rem);
  line-height: 1.35;
  letter-spacing: 0.1em;
}

#nu-bezig .current-card h3 {
  margin-bottom: 0.36rem;
  font-size: clamp(1.04rem, 0.22vw + 1rem, 1.16rem);
  line-height: 1.1;
}

#nu-bezig .current-card p {
  max-width: none;
  margin-top: 0.44rem;
  font-size: clamp(0.88rem, 0.12vw + 0.85rem, 0.96rem);
  line-height: 1.42;
}

#nu-bezig .project-actions {
  padding-top: clamp(0.72rem, 1.1vw, 1rem);
}

/* iOS artwork: alpha-following shadow and a soft aura, never a hard box. */
#nu-bezig .project-media--ios {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#nu-bezig .project-media--ios::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: min(46%, 22rem);
  aspect-ratio: 1.28;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(35, 126, 255, 0.22) 0%,
    rgba(35, 126, 255, 0.09) 42%,
    transparent 72%
  );
  filter: blur(9px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#nu-bezig .project-media--ios::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: auto 31% 8%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 8, 25, 0.32), transparent 72%);
  filter: blur(9px);
  pointer-events: none;
}

#nu-bezig .current-card .project-media--ios img {
  position: relative;
  z-index: 1;
  width: auto;
  height: min(86%, 8.1rem);
  max-width: 86%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 12px 15px rgba(3, 18, 48, 0.36));
}

/* Compact laptop mode. This is deliberately height-aware: Windows 125%
   scaling reduces the logical viewport height. It keeps all current-project
   content visible without changing to a mobile layout or hiding any text. */
@media (min-width: 1000px) and (max-height: 790px) {
  .site-header {
    top: 0.55rem;
    margin-top: 0.55rem;
    padding-block: 0.5rem;
  }

  #nu-bezig.current-section {
    padding-top: 0.85rem;
    padding-bottom: 1rem;
  }

  #nu-bezig .section-heading {
    gap: 0.22rem;
    margin-bottom: 0.55rem;
  }

  #nu-bezig .section-heading p:not(.eyebrow) {
    font-size: 0.88rem;
    line-height: 1.3;
  }

  #nu-bezig .current-grid {
    gap: 0.78rem;
  }

  #nu-bezig .current-card {
    padding: 0.68rem 0.72rem;
  }

  #nu-bezig .current-card .project-media {
    height: auto;
    aspect-ratio: 1600 / 355;
    margin-bottom: 0.48rem;
    border-radius: 10px;
  }

  #nu-bezig .current-card .project-top {
    gap: 0.2rem;
  }

  #nu-bezig .current-card .project-meta {
    font-size: 0.68rem;
    line-height: 1.28;
    letter-spacing: 0.095em;
  }

  #nu-bezig .current-card h3 {
    margin-bottom: 0.24rem;
    font-size: 1.04rem;
    line-height: 1.08;
  }

  #nu-bezig .current-card p {
    margin-top: 0.32rem;
    font-size: 0.88rem;
    line-height: 1.36;
  }

  #nu-bezig .project-actions {
    gap: 0.45rem;
    padding-top: 0.48rem;
  }

  #nu-bezig .project-actions .button {
    min-height: 2.45rem;
    padding-inline: 0.82rem;
    font-size: 0.82rem;
  }

  #nu-bezig .button-icon {
    width: 0.95rem;
    height: 0.95rem;
  }

  #nu-bezig .current-card .project-media--ios img {
    height: min(82%, 5.7rem);
    filter: drop-shadow(0 9px 11px rgba(3, 18, 48, 0.34));
  }
}

/* An extra-small-height laptop still keeps the same two-column composition,
   but trims only spacing—not content. */
@media (min-width: 1000px) and (max-height: 650px) {
  #nu-bezig.current-section {
    padding-top: 0.58rem;
    padding-bottom: 0.72rem;
  }

  #nu-bezig .section-heading {
    margin-bottom: 0.42rem;
  }

  #nu-bezig .section-heading .eyebrow {
    font-size: 0.68rem;
  }

  #nu-bezig .current-card {
    padding-block: 0.6rem;
  }

  #nu-bezig .current-card .project-media {
    height: auto;
    aspect-ratio: 1600 / 355;
    margin-bottom: 0.4rem;
  }

  #nu-bezig .current-card p {
    margin-top: 0.26rem;
    font-size: 0.85rem;
    line-height: 1.33;
  }

  #nu-bezig .project-actions {
    padding-top: 0.36rem;
  }

  #nu-bezig .project-actions .button {
    min-height: 2.35rem;
  }
}

/* Tablet and phone: one natural column. This is a layout change only, not a
   forced mobile typography mode at laptop widths. */
@media (max-width: 999px) {
  #nu-bezig .current-grid {
    grid-template-columns: 1fr;
  }

  #nu-bezig .current-card {
    height: auto;
  }

  #nu-bezig .current-card .project-media {
    height: auto;
    aspect-ratio: 1600 / 355;
  }

  #nu-bezig .current-card .project-media--ios img {
    height: clamp(5.8rem, 18vw, 8rem);
  }
}

@media (max-width: 620px) {
  #nu-bezig.current-section {
    padding-top: 1.4rem;
    padding-bottom: 1.85rem;
  }

  #nu-bezig .current-card {
    padding: 0.78rem;
  }

  #nu-bezig .current-card p {
    font-size: 0.92rem;
    line-height: 1.5;
  }
}

@media (max-width: 520px) {
  .project-actions,
  .contact-actions,
  .contact-actions--online {
    flex-direction: column;
    align-items: stretch;
    gap: 0.58rem;
  }

  .project-actions .button,
  .contact-action,
  .contact-actions--online .contact-action {
    width: 100%;
    flex-basis: auto;
    min-height: 2.9rem;
  }

  #nu-bezig .current-card .project-media--ios img {
    height: clamp(5.4rem, 25vw, 6.9rem);
    max-height: 94%;
  }
}

/* --------------------------------------------------------------------------
   Project overview and contact cards
   -------------------------------------------------------------------------- */
#projecten .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

#projecten .project-card {
  min-width: 0;
  height: 100%;
}

#projecten .project-card--featured {
  grid-column: 1 / -1;
}

#contact .contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: stretch;
}

#contact .contact-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

#contact .contact-card p {
  margin-bottom: 0;
}

#contact .contact-action {
  margin-top: 0;
  text-decoration: none;
}

#contact .contact-action.button-primary {
  color: #fff;
}

:root[data-theme="dark"] #contact .contact-action.button-primary {
  color: #f7fbff;
}

#contact .contact-action.button-secondary {
  color: var(--text);
}

.contact-actions--online .contact-action {
  flex: 0 1 auto;
}

@media (max-width: 1199px) {
  #projecten .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #projecten .project-grid > .project-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 25rem);
  }
}

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

  #projecten .project-grid > .project-card:last-child {
    grid-column: auto;
    justify-self: stretch;
    width: auto;
  }
}

@media (max-width: 700px) {
  #contact .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Center the final contact card in its two-column range. */
@media (min-width: 701px) and (max-width: 927px) {
  #contact .contact-grid > .contact-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 24rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .contact-action {
    transition: none;
  }
}

/* Unified icon sizing for all action buttons. Every icon uses the same 1.18rem
   bounding box; object-fit preserves each official logo's aspect ratio. */
.button-icon,
.button-logo,
.button-logo-switch,
.button-logo-switch--x,
.button-logo-switch--linkedin,
.button-logo--discord,
.button-logo--github,
.button-logo--linkedin {
  --button-logo-size: 1.18rem;
  width: var(--button-logo-size);
  height: var(--button-logo-size);
  flex: 0 0 var(--button-logo-size);
}

/* The outlined envelope and the invertocat both leave a lot of their box empty,
   so they get a larger one to sit level with the solid marks. */
.button-icon,
.button-logo--github {
  --button-logo-size: 1.4rem;
}

/* Flex centring aligns each icon's bounding box, but a mark's visual weight is
   its centre of mass, and every one of these sits above its box centre: the
   invertocat is top-heavy, the envelope carries its fold lines in the upper
   half, the InBug's cut-out "in" is bottom-left. Measured as a share of box
   height, the offsets are 3.9% (GitHub), 2.2% (LinkedIn), 1.8% (envelope) and
   0.6% (Discord); at their rendered sizes that is 0.87px down to 0.11px. These
   nudges put every mark's centre of mass on the button's centre line. The X is
   symmetric enough (0.03px) to need none. The App Store "A" is the one that
   sits low instead: its crossbar and feet put the mass 6.2% below the box
   centre (1.17px), so it is lifted. Values are in rem because the offset
   scales with the icon box, which is sized in rem, not with the label. */
.button-logo--github {
  transform: translateY(0.054rem);
}

.button-logo-switch--linkedin {
  transform: translateY(0.026rem);
}

.button-icon {
  transform: translateY(0.025rem);
}

.button-logo--discord {
  transform: translateY(0.007rem);
}

.button-logo--appstore {
  transform: translateY(-0.073rem);
}

/* The line icons share the envelope's box and stroke. The globe is symmetric,
   so it drops the envelope's nudge; the chat bubble's thin tail leaves its
   mass 0.53px above centre, so it moves down by that much. */
.button-icon--globe {
  transform: none;
}

.button-icon--chat {
  transform: translateY(0.033rem);
}

.button-logo {
  object-fit: contain;
}

/* Keep the official LinkedIn logo visually separated from the hero button label. */
.hero-actions .button {
  column-gap: 0.6rem;
}

/* ========================================================================== 
   Compass featured card: neutral light-theme chrome
   Keeps blue only for active/interactive accents instead of every border.
   ========================================================================== */
:root:not([data-theme="dark"]) #projecten .project-card--featured {
  border-color: rgba(16, 36, 63, 0.14);
  background: var(--surface);
  box-shadow:
    0 18px 44px rgba(16, 36, 63, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

:root:not([data-theme="dark"]) #projecten .project-card--featured::after {
  opacity: 0.18;
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__viewport {
  border-color: rgba(16, 36, 63, 0.14);
  box-shadow: none;
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__controls {
  border-color: rgba(16, 36, 63, 0.13);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__tabs button:hover {
  border-color: rgba(16, 36, 63, 0.15);
  background: rgba(16, 36, 63, 0.045);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__tabs button.is-active {
  border-color: rgba(13, 75, 217, 0.22);
  background: rgba(13, 75, 217, 0.075);
  color: var(--blue-deep);
  box-shadow: none;
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__timer {
  border-color: rgba(16, 36, 63, 0.15);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(16, 36, 63, 0.07);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__timer:hover {
  border-color: rgba(13, 75, 217, 0.3);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__arrow {
  border-color: rgba(13, 75, 217, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #15345f;
  box-shadow:
    0 6px 16px rgba(16, 36, 63, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__arrow:hover,
:root:not([data-theme="dark"]) #projecten .compass-carousel__arrow:focus-visible {
  border-color: rgba(13, 75, 217, 0.36);
  background: #eef5ff;
  color: #0f2f57;
}


/* Light-theme secondary project buttons should stay light, not use the dark card tint. */
:root:not([data-theme="dark"]) .project-actions .button-secondary {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(13, 75, 217, 0.24);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(16, 36, 63, 0.06);
}

:root:not([data-theme="dark"]) .project-actions .button-secondary:hover,
:root:not([data-theme="dark"]) .project-actions .button-secondary:focus-visible {
  background: rgba(13, 75, 217, 0.07);
  border-color: rgba(13, 75, 217, 0.34);
}

/* Use LinkedIn's blue InBug in light mode and the supplied white mark in dark mode. */
:root:not([data-theme="dark"]) .button-logo-switch--linkedin .button-logo--theme-light {
  display: block;
}

/* The contact-card LinkedIn button keeps its blue primary fill in both themes,
   so the blue InBug would sink into it. Always show the white mark there. */
:root:not([data-theme="dark"]) .contact-action .button-logo-switch--linkedin .button-logo--theme-light,
:root[data-theme="dark"] .contact-action .button-logo-switch--linkedin .button-logo--theme-light {
  display: none;
}

:root:not([data-theme="dark"]) .contact-action .button-logo-switch--linkedin .button-logo--theme-dark,
:root[data-theme="dark"] .contact-action .button-logo-switch--linkedin .button-logo--theme-dark {
  display: block;
}

/* ========================================================================== 
   iOS current-project artwork
   Keep the media row at a fixed, responsive height. The glow is created only
   with alpha-following drop-shadows on the image, so it cannot create a hard
   rectangular edge or influence the flex layout.
   ========================================================================== */
#nu-bezig .current-card--ios {
  position: relative;
  isolation: isolate;
}

#nu-bezig .project-media--ios::before,
#nu-bezig .project-media--ios::after,
#nu-bezig .current-card--ios::before {
  content: none !important;
  display: none !important;
}

/* Explicit flex sizing prevents the empty iOS media area from stretching to
   fill the height of the equal-height card. */
#nu-bezig .current-card .project-media {
  flex: 0 0 auto;
  min-height: 0;
  height: clamp(7rem, 8.45vw, 8.35rem);
  max-height: 8.35rem;
  aspect-ratio: auto;
}

#nu-bezig .current-card .project-media--ios {
  display: grid;
  place-items: center;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#nu-bezig .current-card .project-media--ios img {
  position: relative;
  z-index: 1;
  width: auto;
  height: min(86%, 7.2rem);
  max-width: 86%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  filter:
    drop-shadow(0 0 10px rgba(35, 126, 255, 0.22))
    drop-shadow(0 0 22px rgba(35, 126, 255, 0.13))
    drop-shadow(0 12px 15px rgba(3, 18, 48, 0.34));
}

/* Windows 125% scaling commonly produces a short logical viewport. Keep both
   project media rows compact, but never let either one grow into the card. */
@media (min-width: 1000px) and (max-height: 790px) {
  #nu-bezig .current-card .project-media {
    flex-basis: auto;
    height: clamp(6.5rem, 8.4vw, 7.55rem);
    max-height: 7.55rem;
    aspect-ratio: auto;
  }

  #nu-bezig .current-card .project-media--ios img {
    height: min(84%, 6.15rem);
    max-height: 90%;
  }
}

@media (max-width: 999px) {
  #nu-bezig .current-card .project-media {
    height: clamp(7rem, 22vw, 8.35rem);
    max-height: 8.35rem;
    aspect-ratio: auto;
  }

  #nu-bezig .current-card .project-media--ios img {
    height: min(86%, 7rem);
    max-height: 92%;
  }
}

@media (max-width: 520px) {
  #nu-bezig .current-card .project-media {
    height: clamp(6.8rem, 29vw, 7.75rem);
  }

  #nu-bezig .current-card .project-media--ios img {
    height: min(84%, 6.35rem);
  }
}

/* ========================================================================== 
   iOS teaser glow — separate aura behind the artwork
   The PNG itself stays completely sharp; only this independent background
   layer is soft. Because the media wrapper allows overflow, the aura fades
   naturally instead of ending at a rectangular boundary.
   ========================================================================== */
#nu-bezig .current-card .project-media--ios {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

#nu-bezig .current-card .project-media--ios::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: clamp(8.5rem, 14vw, 11.5rem);
  height: clamp(5.8rem, 9.5vw, 7.8rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(38, 132, 255, 0.36) 0%,
    rgba(38, 132, 255, 0.22) 30%,
    rgba(38, 132, 255, 0.10) 52%,
    rgba(38, 132, 255, 0.035) 66%,
    transparent 78%
  );
  pointer-events: none;
}

#nu-bezig .current-card .project-media--ios::after {
  content: none !important;
  display: none !important;
}

#nu-bezig .current-card .project-media--ios img {
  position: relative;
  z-index: 1;
  filter: none !important;
  image-rendering: auto;
}

:root:not([data-theme="dark"]) #nu-bezig .current-card .project-media--ios::before {
  background: radial-gradient(
    ellipse at center,
    rgba(38, 132, 255, 0.22) 0%,
    rgba(38, 132, 255, 0.12) 35%,
    rgba(38, 132, 255, 0.045) 58%,
    transparent 78%
  );
}

/* Stronger iOS aura: separate from the PNG so the icon stays crisp. */
#nu-bezig .current-card .project-media--ios {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

#nu-bezig .current-card .project-media--ios::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: clamp(11rem, 34vw, 20rem);
  height: clamp(7rem, 15vw, 11rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(57, 153, 255, 0.68) 0%,
    rgba(35, 126, 255, 0.42) 26%,
    rgba(35, 126, 255, 0.22) 48%,
    rgba(35, 126, 255, 0.08) 66%,
    transparent 82%
  );
  filter: blur(9px);
  opacity: 1;
  pointer-events: none;
}

#nu-bezig .current-card .project-media--ios::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 4%;
  width: clamp(6.8rem, 17vw, 10rem);
  height: clamp(1.1rem, 2.2vw, 1.8rem);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(2, 16, 44, 0.44) 0%,
    rgba(2, 16, 44, 0.18) 48%,
    transparent 78%
  );
  filter: blur(7px);
  pointer-events: none;
}

#nu-bezig .current-card .project-media--ios img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 7px rgba(3, 18, 48, 0.34));
}

:root:not([data-theme="dark"]) #nu-bezig .current-card .project-media--ios::before {
  background: radial-gradient(
    ellipse at center,
    rgba(62, 147, 255, 0.34) 0%,
    rgba(35, 126, 255, 0.20) 34%,
    rgba(35, 126, 255, 0.08) 58%,
    transparent 82%
  );
  filter: blur(10px);
}

/* Final iOS artwork treatment: no external glow or shadow. */
#nu-bezig .current-card .project-media--ios::before,
#nu-bezig .current-card .project-media--ios::after {
  content: none !important;
  display: none !important;
  background: none !important;
  filter: none !important;
  box-shadow: none !important;
}

#nu-bezig .current-card .project-media--ios img {
  filter: none !important;
  box-shadow: none !important;
}

/* ========================================================================== 
   FINAL PROJECT MEDIA SIZING: keep the three project banners the same height
   ========================================================================== */
#projecten .project-media--bimmy,
#projecten .project-media--voyagevista,
#projecten .project-media--llmelt {
  aspect-ratio: 1280 / 394;
}

#projecten .project-media--bimmy img,
#projecten .project-media--voyagevista img {
  object-fit: contain;
  object-position: center;
}

#projecten .project-media--llmelt img {
  object-fit: cover;
  object-position: center;
}


/* ========================================================================== 
   FINAL FIREFOX-SAFE iOS MEDIA POSITIONING
   Size the square artwork from its width and center it absolutely. This avoids
   Firefox resolving percentage-based heights differently inside the flex card.
   ========================================================================== */
#nu-bezig .current-card .project-media--ios {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#nu-bezig .current-card .project-media--ios img {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: clamp(5.4rem, 20vw, 7.2rem);
  height: auto;
  max-width: 86%;
  max-height: 86%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  filter: none !important;
  box-shadow: none !important;
}

@media (min-width: 1000px) and (max-height: 790px) {
  #nu-bezig .current-card .project-media--ios img {
    width: clamp(5.2rem, 7vw, 6.15rem);
  }
}

@media (max-width: 520px) {
  #nu-bezig .current-card .project-media--ios img {
    width: clamp(5.4rem, 25vw, 6.35rem);
  }
}

/* ==========================================================================
   NU BEZIG: one project
   Laid out like the Compass card: a large media panel on one side and the
   text on the other. The panel carries the app icon on a gradient taken from
   the icon's own violet and blue.
   ========================================================================== */
#nu-bezig .current-grid {
  grid-template-columns: minmax(0, 1fr);
}

#nu-bezig .current-card .project-media--ios {
  height: clamp(10rem, 42vw, 13rem);
  max-height: none;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.28), transparent 62%),
    linear-gradient(135deg, #10142a 0%, #161a3a 55%, #0f1d3d 100%);
}

#nu-bezig .current-card .project-media--ios img {
  width: clamp(6rem, 26vw, 7.5rem);
  max-width: 70%;
  max-height: 70%;
  border-radius: 22%;
  box-shadow: 0 18px 40px rgba(6, 8, 24, 0.55) !important;
}

#nu-bezig .current-card__body p:last-child {
  margin-bottom: 0;
}

@media (min-width: 820px) {
  #nu-bezig .current-card--ios {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "media top"
      "media body"
      "media actions";
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    padding: clamp(1rem, 1.5vw, 1.25rem);
  }

  #nu-bezig .current-card .project-media--ios {
    grid-area: media;
    height: auto;
    min-height: 18rem;
    margin: 0;
  }

  #nu-bezig .current-card .project-media--ios img {
    width: clamp(7.5rem, 11vw, 9.5rem);
  }

  #nu-bezig .current-card--ios .project-top {
    grid-area: top;
    padding-top: 0.5rem;
  }

  #nu-bezig .current-card--ios .current-card__body {
    grid-area: body;
  }

  #nu-bezig .current-card--ios .project-actions {
    grid-area: actions;
    align-self: end;
    margin-top: 0;
    padding: 1.25rem 0 0.25rem;
  }
}

:root:not([data-theme="dark"]) #nu-bezig .current-card .project-media--ios {
  background:
    radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.2), transparent 62%),
    linear-gradient(135deg, #eef0ff 0%, #e9ecfb 55%, #e4edff 100%);
}

:root:not([data-theme="dark"]) #nu-bezig .current-card .project-media--ios img {
  box-shadow: 0 16px 34px rgba(30, 34, 80, 0.28) !important;
}

/* The Compass card was capped at 1200px and centred, so it sat indented
   against the full-width cards above and below it. */
@media (min-width: 901px) {
  #projecten .project-card--featured {
    width: 100%;
  }
}

/* Tablet widths stack the header like mobile does, but the theme toggle used
   to fall onto a third row of its own. Pin it beside the name, as on phones. */
@media (min-width: 641px) and (max-width: 980px) {
  .theme-toggle {
    position: absolute;
    top: 1.25rem;
    right: 0.95rem;
  }
}

/* ==========================================================================
   NAV ISLAND
   The label that the header shows once it has morphed into a pill. It sits at
   the top centre of the header, exactly inside the clipped pill.
   ========================================================================== */
.nav-island {
  display: none;
}

@media (max-width: 980px) {
  .nav-island {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    box-sizing: border-box;
    width: var(--island-w);
    height: var(--island-h);
    padding: 0 0.95rem 0 0.42rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--header-border);
    color: var(--text);
    font: 700 1rem/1 "Manrope", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.92);
    transition:
      opacity 140ms ease,
      transform 300ms cubic-bezier(0.32, 1.18, 0.42, 1),
      width 520ms cubic-bezier(0.32, 1.18, 0.42, 1);
  }

  .site-header.is-mobile-collapsed .nav-island {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
    transition:
      opacity 220ms ease 180ms,
      transform 420ms cubic-bezier(0.32, 1.18, 0.42, 1) 120ms,
      width 520ms cubic-bezier(0.32, 1.18, 0.42, 1);
  }

  .nav-island__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-align: left;
  }

  .nav-island__text {
    display: inline-block;
    white-space: nowrap;
    transition:
      opacity 150ms ease,
      filter 150ms ease;
  }

  .nav-island__text.is-swapping {
    opacity: 0;
    filter: blur(4px);
  }

  .nav-island:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -3px;
  }

  .nav-island__avatar {
    flex: 0 0 auto;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
    object-fit: cover;
  }

  .nav-island__chevron {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-soft);
  }
}

@keyframes nav-island-nod {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(3px); }
  55% { transform: translateY(0); }
  75% { transform: translateY(2px); }
}

.nav-island.is-hinting .nav-island__chevron {
  animation: nav-island-nod 700ms ease-in-out 450ms 2;
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .nav-island,
  .site-header.is-mobile-collapsed .nav-island {
    transition-duration: 1ms;
  }

  .nav-island.is-hinting .nav-island__chevron {
    animation: none;
  }
}

/* ==========================================================================
   COMPASS CAROUSEL, iOS STYLE
   Screens slide sideways like pages, the tabs are a segmented control with a
   gliding thumb that fills up while autoplay runs, and the buttons are frosted
   glass with a springy press.
   ========================================================================== */
#projecten .compass-slide {
  opacity: 1;
  visibility: hidden;
  transform: translate3d(100%, 0, 0);
  transition: none;
}

#projecten .compass-slide.is-active {
  z-index: 2;
  visibility: visible;
  transform: none;
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

#projecten .compass-slide.is-preparing-from-left {
  transform: translate3d(-100%, 0, 0);
}

#projecten .compass-slide.is-preparing-from-right {
  transform: translate3d(100%, 0, 0);
}

#projecten .compass-slide.is-leaving-to-left,
#projecten .compass-slide.is-leaving-to-right {
  z-index: 1;
  visibility: visible;
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

#projecten .compass-slide.is-leaving-to-left {
  transform: translate3d(-100%, 0, 0);
}

#projecten .compass-slide.is-leaving-to-right {
  transform: translate3d(100%, 0, 0);
}

/* Controls: no bar around them, just the segmented control and the button. */
#projecten .compass-carousel__controls,
:root:not([data-theme="dark"]) #projecten .compass-carousel__controls {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

#projecten .compass-carousel__tabs {
  position: relative;
  isolation: isolate;
  gap: 0;
  padding: 2px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.24);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__tabs {
  background: rgba(118, 118, 128, 0.12);
}

#projecten .compass-carousel__thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  z-index: 0;
  width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.14),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__thumb {
  background: #ffffff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.12),
    0 3px 1px rgba(0, 0, 0, 0.04);
}

#projecten .compass-carousel__thumb.is-ready {
  transition:
    transform 440ms cubic-bezier(0.34, 1.2, 0.64, 1),
    width 440ms cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Autoplay progress fills the thumb from left to right. */
#projecten .compass-carousel__thumb-progress {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--blue) 26%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
}

#projecten .compass-carousel__tabs button,
#projecten .compass-carousel__tabs button:hover,
#projecten .compass-carousel__tabs button:focus-visible,
#projecten .compass-carousel__tabs button.is-active,
:root:not([data-theme="dark"]) #projecten .compass-carousel__tabs button:hover,
:root:not([data-theme="dark"]) #projecten .compass-carousel__tabs button.is-active {
  position: relative;
  z-index: 1;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#projecten .compass-carousel__tabs button {
  color: var(--text-soft);
  transition: color 200ms ease, scale 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

#projecten .compass-carousel__tabs button:hover,
#projecten .compass-carousel__tabs button.is-active,
:root:not([data-theme="dark"]) #projecten .compass-carousel__tabs button.is-active {
  color: var(--text);
}

#projecten .compass-carousel__tabs button:active {
  scale: 0.94;
}

/* Pause button: a plain glass circle; progress now lives in the thumb. */
#projecten .compass-carousel__timer-ring {
  display: none;
}

#projecten .compass-carousel__timer,
:root:not([data-theme="dark"]) #projecten .compass-carousel__timer {
  border: 0;
  background: rgba(118, 118, 128, 0.24);
  box-shadow: none;
  transform: none;
  transition: background-color 180ms ease, scale 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root:not([data-theme="dark"]) #projecten .compass-carousel__timer {
  background: rgba(118, 118, 128, 0.12);
}

#projecten .compass-carousel__timer:hover {
  scale: 1.06;
}

/* Arrows: frosted glass over the screenshot. */
#projecten .compass-carousel__arrow,
:root:not([data-theme="dark"]) #projecten .compass-carousel__arrow {
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(28, 28, 30, 0.45);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  transform: translateY(-50%);
  transition:
    opacity 200ms ease,
    background-color 180ms ease,
    scale 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

#projecten .compass-carousel__arrow:hover,
#projecten .compass-carousel__arrow:focus-visible,
:root:not([data-theme="dark"]) #projecten .compass-carousel__arrow:hover,
:root:not([data-theme="dark"]) #projecten .compass-carousel__arrow:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(28, 28, 30, 0.62);
  color: #ffffff;
  transform: translateY(-50%);
  scale: 1.06;
}

#projecten .compass-carousel__arrow:active,
#projecten .compass-carousel__timer:active {
  scale: 0.9;
  transition-duration: 200ms, 180ms, 90ms;
}

@media (prefers-reduced-motion: reduce) {
  #projecten .compass-slide.is-active,
  #projecten .compass-slide.is-leaving-to-left,
  #projecten .compass-slide.is-leaving-to-right,
  #projecten .compass-carousel__thumb.is-ready {
    transition: none;
  }
}

/* The pause button belongs to the segmented control: right beside it, just as
   tall, and the pair centred under the screenshot. */
#projecten .compass-carousel__controls {
  justify-content: center;
  align-items: stretch;
  gap: 0.5rem;
}

#projecten .compass-carousel__timer,
#projecten .project-card--featured .compass-carousel__timer {
  width: auto;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
}


/* ==========================================================================
   BLOG
   One featured article: a visual of the jump it is about on the left, the
   summary on the right. Until it is published the card shows a status pill
   instead of a link.
   ========================================================================== */
.blog-card {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.blog-card__visual {
  position: relative;
  display: grid;
  grid-template-columns: auto auto auto;
  align-content: center;
  justify-content: center;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
  min-height: 15rem;
  padding: 2rem;
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--blue) 30%, transparent), transparent 60%),
    #0b1019;
  color: #f2f5fa;
  font-family: "Manrope", sans-serif;
}

.blog-card__from {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: rgba(242, 245, 250, 0.45);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}

.blog-card__arrow {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: rgba(242, 245, 250, 0.6);
}

.blog-card__to {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.blog-card__device {
  grid-column: 1 / -1;
  margin-top: 0.6rem;
  color: rgba(242, 245, 250, 0.6);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.4rem, 3vw, 2.4rem);
}

.blog-card__body h3 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  letter-spacing: -0.02em;
}

.blog-card__body p:not(.project-meta) {
  margin: 0.7rem 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.blog-card__status {
  margin-top: 1.2rem;
  padding: 0.45rem 0.9rem;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .blog-card { grid-template-columns: 1fr; }
  .blog-card__visual { min-height: 11rem; }
}

/* With Blog added the menu has seven items; a tighter gap keeps them on one
   line on desktop. The links' own padding still separates them. */
@media (min-width: 1101px) {
  .site-header .nav {
    gap: 0.3rem;
    flex-wrap: nowrap;
  }
}


/* ==========================================================================
   HERO, CENTRED ON YOU
   The portrait floats in the middle with three widgets around it; the copy
   sits underneath, short. The photo tilts towards the mouse in 3D and the
   widgets drift a little the other way for depth.
   ========================================================================== */
.hero2 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100svh - var(--hero-top, 6rem));
  padding: clamp(0.5rem, 2vh, 1.5rem) 0 clamp(2.6rem, 6vh, 4rem);
  text-align: center;
}

.hero2__stage {
  --photo-h: clamp(10.5rem, 34vh, 22rem);
  position: relative;
  width: min(100%, calc(var(--photo-h) * 0.8 + 22rem));
  height: calc(var(--photo-h) + 1rem);
  perspective: 1000px;
}

.hero2__photo {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  width: calc(var(--photo-h) * 0.8);
  height: var(--photo-h);
  margin-left: calc(var(--photo-h) * -0.4);
  /* script.js eases these two towards the pointer, frame by frame. */
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  animation:
    hero2-pop 900ms cubic-bezier(0.34, 1.4, 0.64, 1) both,
    hero2-float 7s ease-in-out 900ms infinite;
}

.hero2__photo::before {
  content: "";
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 40%, transparent), transparent);
  filter: blur(10px);
}

.hero2__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  border-radius: 1.8rem;
  border: 1px solid var(--border-strong);
  box-shadow: 0 26px 60px rgba(4, 10, 24, 0.35);
}

.hero2__chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.95rem 0.5rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: 0 14px 34px rgba(4, 10, 24, 0.22);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-align: left;
  translate: var(--px, 0px) var(--py, 0px);
  animation:
    hero2-chip-in 800ms cubic-bezier(0.34, 1.5, 0.64, 1) both,
    hero2-float 6s ease-in-out infinite;
}

.hero2__chip img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
}

.hero2__chip strong {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero2__chip small {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.hero2__chip--app {
  top: 8%;
  left: 0;
  animation-delay: 350ms, 0ms;
}

.hero2__chip--now {
  top: 42%;
  right: 0;
  animation-delay: 500ms, -2s;
}

.hero2__chip--study {
  bottom: 6%;
  left: 4%;
  animation-delay: 650ms, -4s;
}

.hero2__live {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
  animation: hero2-blink 1.8s ease-in-out infinite;
}

.hero2__copy {
  max-width: 46rem;
  margin-top: clamp(1rem, 3vh, 2rem);
  animation: hero2-rise 800ms cubic-bezier(0.34, 1.3, 0.64, 1) 250ms both;
}

.hero2__hello {
  margin: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.98rem;
}

.hero2 h1 {
  max-width: 24ch;
  margin: 0.5rem auto 0;
  font-size: clamp(2rem, min(4.6vw, 6.6vh), 3.6rem);
}

.hero2__accent { color: var(--blue); }

.hero2__lead {
  max-width: 54ch;
  margin: clamp(0.6rem, 1.6vh, 1rem) auto 0;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  line-height: 1.6;
}

.hero2__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: clamp(1rem, 2.6vh, 1.6rem);
}

.hero2__actions .button {
  transition: transform 300ms cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 180ms ease, background 180ms ease;
}

.hero2__actions .button:hover { transform: translateY(-2px) scale(1.03); }
.hero2__actions .button:active { transform: scale(0.96); }

.hero2__icon {
  display: grid;
  place-items: center;
  width: 3.05rem;
  height: 3.05rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: transform 300ms cubic-bezier(0.34, 1.5, 0.64, 1), border-color 180ms ease;
}

.hero2__icon:hover { transform: translateY(-2px) scale(1.05); border-color: var(--border-strong); }
.hero2__icon svg { width: 1.2rem; height: 1.2rem; }

/* Scroll hint: a small capsule with a dot that drops, gone once you scroll. */
.hero2__scroll {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  width: 1.5rem;
  height: 2.3rem;
  margin-left: -0.75rem;
  border: 2px solid var(--border-strong);
  border-radius: 999px;
  transition: opacity 300ms ease;
}

.hero2__scroll span {
  position: absolute;
  top: 0.4rem;
  left: 50%;
  width: 0.3rem;
  height: 0.5rem;
  margin-left: -0.15rem;
  border-radius: 999px;
  background: var(--blue);
  animation: hero2-scroll 1.8s ease-in-out infinite;
}

.hero2__scroll.is-hidden { opacity: 0; pointer-events: none; }

@keyframes hero2-pop {
  from { opacity: 0; scale: 0.82; }
  to { opacity: 1; scale: 1; }
}

@keyframes hero2-chip-in {
  from { opacity: 0; scale: 0.6; }
  to { opacity: 1; scale: 1; }
}

/* The bobbing uses transform and the mouse parallax uses translate. On one
   and the same property the animation always wins, and the parallax could
   only jump instead of glide. */
@keyframes hero2-float {
  50% { transform: translateY(-10px); }
}

.hero2__photo { --px: 0px; --py: 0px; }

@keyframes hero2-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes hero2-blink { 50% { opacity: 0.35; } }

@keyframes hero2-scroll {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(0.8rem); }
}

@media (max-width: 760px) {
  .hero2 { padding-bottom: 1.2rem; }

  .hero2__stage {
    --photo-h: clamp(9.5rem, 27vh, 17rem);
    width: 100%;
  }

  .hero2__copy { margin-top: 0.7rem; }
  .hero2 h1 { font-size: clamp(1.7rem, 7.4vw, 2.3rem); }
  .hero2__lead { font-size: 0.93rem; line-height: 1.5; }
  .hero2__actions { margin-top: 0.9rem; }
  .hero2__actions { gap: 0.45rem; }
  .hero2__actions .button { min-height: 2.8rem; padding: 0 0.85rem; font-size: 0.92rem; }
  .hero2__icon { width: 2.8rem; height: 2.8rem; }

  .hero2__chip { padding: 0.4rem 0.7rem 0.4rem 0.4rem; border-radius: 1rem; }
  .hero2__chip img { width: 1.9rem; height: 1.9rem; border-radius: 0.55rem; }
  .hero2__chip strong { font-size: 0.86rem; }
  .hero2__chip small { font-size: 0.7rem; }
  .hero2__chip--app { top: 2%; left: 0; }
  .hero2__chip--now { top: 48%; right: 0; }
  .hero2__chip--study { bottom: 0; left: 0; }
  .hero2__scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero2__photo,
  .hero2__chip,
  .hero2__copy,
  .hero2__live,
  .hero2__scroll span {
    animation: none;
  }
}

/* ==========================================================================
   EXPERIENCE TIMELINE
   A line that rolls out as you scroll; each dot lights up when the line
   reaches it and its card slides in. Across on desktop (oldest left, now on
   the right), down the left on smaller screens.
   ========================================================================== */
.xp {
  --gap: 2.4rem;
  position: relative;
  margin-top: clamp(1.4rem, 4vh, 2.4rem);
}

.xp__track,
.xp__fill {
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: calc(var(--gap) / 2 - 1.5px);
  width: 3px;
  border-radius: 3px;
}

.xp__track { background: var(--border); }

.xp__fill {
  background: var(--blue);
  box-shadow: 0 0 14px color-mix(in srgb, var(--blue) 55%, transparent);
  transform: scaleY(0);
  transform-origin: top center;
}

.xp__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.xp__item {
  position: relative;
  padding: 0 0 1.2rem var(--gap);
}

.xp__dot {
  position: absolute;
  top: 0.15rem;
  left: calc(var(--gap) / 2);
  width: 1.1rem;
  height: 1.1rem;
  margin-left: -0.55rem;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--border);
  scale: 0.7;
  transition: scale 600ms cubic-bezier(0.34, 1.4, 0.64, 1), background-color 300ms ease, box-shadow 400ms ease;
}

.xp__dot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  opacity: 0;
}

.xp__when {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.85rem;
  opacity: 0.45;
  transition: opacity 500ms ease;
}

.xp__when strong { color: var(--text); font-weight: 750; }

.xp__card {
  margin-top: 0.55rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  opacity: 0;
  translate: 0 1.4rem;
  scale: 0.97;
  transition:
    opacity 600ms ease,
    translate 850ms cubic-bezier(0.34, 1.4, 0.64, 1),
    scale 850ms cubic-bezier(0.34, 1.4, 0.64, 1),
    border-color 200ms ease;
}

.xp__card:hover { border-color: var(--border-strong); }

.xp__card img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
}

.xp__card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  font-size: 1.12rem;
}

.xp__card h3 a { color: inherit; text-decoration: none; }
.xp__card h3 a:hover { color: var(--blue); }

.xp__live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.14);
  color: #2fb653;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.xp__live::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  animation: hero2-blink 1.8s ease-in-out infinite;
}

.xp__role {
  margin: 0.2rem 0 0;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 700;
}

.xp__card p:not(.xp__role) {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.xp__item.is-reached .xp__dot {
  scale: 1;
  background: var(--blue);
  box-shadow: 0 0 14px color-mix(in srgb, var(--blue) 60%, transparent);
}

.xp__item.is-reached .xp__dot::after { animation: xp-ping 900ms ease-out; }
.xp__item.is-reached .xp__when { opacity: 1; }
.xp__item.is-reached .xp__card { opacity: 1; translate: 0 0; scale: 1; }

@keyframes xp-ping {
  from { opacity: 0.9; scale: 0.5; }
  to { opacity: 0; scale: 1.8; }
}

@media (min-width: 1000px) {
  .xp__track,
  .xp__fill {
    top: 0.85rem;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 3px;
  }

  .xp__fill { transform: scaleX(0); transform-origin: left center; }

  .xp__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 2.4rem;
  }

  .xp__item { display: flex; flex-direction: column; padding: 0; }
  .xp__item:nth-child(1) { order: 4; }
  .xp__item:nth-child(2) { order: 3; }
  .xp__item:nth-child(3) { order: 2; }
  .xp__item:nth-child(4) { order: 1; }

  .xp__dot { top: calc(0.85rem + 1.5px - 0.55rem - 2.4rem); left: 1.4rem; }
  .xp__card { flex: 1; }

  /* Date and kind on their own lines, so every card starts at the same height. */
  .xp__when strong,
  .xp__when span { display: block; }
  .xp__when span { margin-top: 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .xp__card, .xp__when, .xp__dot { transition: none; }
  .xp__item.is-reached .xp__dot::after, .xp__live::before { animation: none; }
}


/* ==========================================================================
   HERO AND TIMELINE, ROUND 2
   The portrait takes whatever height the screen has left after the copy, up
   to 30rem, so it is big on a big screen and still fits on a laptop. The
   timeline cards are compact: logo beside the title, height of their own.
   ========================================================================== */
.hero2__stage {
  --photo-h: clamp(10.5rem, calc(100svh - 31rem), 30rem);
  width: min(100%, calc(var(--photo-h) * 0.8 + 30rem));
}

.hero2__photo img { border-radius: 2.2rem; }

.xp__list { align-items: start; }

.xp__card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.85rem;
  padding: 1rem 1.05rem;
}

.xp__card img {
  grid-row: span 3;
  width: 2.5rem;
  height: 2.5rem;
}

.xp__card h3 { margin-top: 0; font-size: 1.02rem; line-height: 1.25; }
.xp__role { font-size: 0.85rem; }
.xp__card p:not(.xp__role) { font-size: 0.86rem; line-height: 1.5; }

@media (min-width: 1000px) {
  .xp__card { flex: 0 0 auto; }
}

@media (max-width: 760px) {
  .hero2__stage { --photo-h: clamp(9.5rem, calc(100svh - 29rem), 17rem); }
  .hero2__chip { padding: 0.4rem 0.7rem 0.4rem 0.4rem; border-radius: 1rem; }
  .hero2__chip img { width: 1.9rem; height: 1.9rem; border-radius: 0.55rem; }
  .hero2__chip strong { font-size: 0.86rem; }
  .hero2__chip small { font-size: 0.7rem; }
}


/* ==========================================================================
   HERO, ROUND 3: A BIG PORTRAIT
   The portrait takes most of the screen and fades into the page at its edges;
   the headline overlaps its lower part, like a poster. The widgets float
   around the upper half.
   ========================================================================== */
.hero2 { padding-top: 0; }

.hero2__stage {
  --photo-h: clamp(15rem, calc(100svh - 25rem), 46rem);
  width: min(100%, 64rem);
  height: var(--photo-h);
}

.hero2__photo {
  top: 0;
  width: calc(var(--photo-h) * 1.05);
  max-width: 100%;
  height: var(--photo-h);
  margin-left: calc(min(var(--photo-h) * 1.05, 100%) / -2);
}

.hero2__photo::before { inset: 8% 14% 20%; }

.hero2__photo img {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-position: 50% 22%;
  -webkit-mask-image:
    linear-gradient(to bottom, #000 48%, transparent 96%),
    linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, #000 48%, transparent 96%),
    linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  mask-composite: intersect;
}

.hero2__chip { z-index: 2; }
.hero2__chip--app { top: 12%; left: 0; }
.hero2__chip--now { top: 34%; right: 0; }
.hero2__chip--study { top: 50%; bottom: auto; left: 3%; }

.hero2__copy {
  position: relative;
  z-index: 3;
  margin-top: calc(var(--photo-h) * -0.3);
}

.hero2 h1 { text-shadow: 0 2px 24px var(--bg); }

@media (max-width: 760px) {
  .hero2__stage { --photo-h: clamp(13rem, calc(100svh - 24rem), 26rem); }
  .hero2__photo { width: 100%; margin-left: -50%; }
  .hero2__chip--app { top: 6%; }
  .hero2__chip--now { top: 30%; }
  .hero2__chip--study { top: 54%; }
  .hero2__copy { margin-top: calc(var(--photo-h) * -0.2); }
}

/* ==========================================================================
   TIMELINE, ROUND 3: EVEN CARDS
   ========================================================================== */
@media (min-width: 1000px) {
  .xp__list { align-items: stretch; }
  .xp__card { flex: 1 1 auto; }
}

.xp__when strong { display: flex; align-items: center; gap: 0.45rem; }

/* ==========================================================================
   HOW I WORK: THREE CARDS
   ========================================================================== */
.ways {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: clamp(1.4rem, 4vh, 2.4rem) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.way {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.4rem 1.2rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition:
    transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1),
    border-color 250ms ease,
    box-shadow 250ms ease;
}

.way::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 22%, transparent), transparent);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.way:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px rgba(4, 10, 24, 0.22);
}

.way:hover::after { opacity: 1; }

/* The numbers are outlines that fill up when the card is hovered. The
   stroke is drawn first, at twice the width, and the digit itself on top of
   it in the colour of the card: that covers the stray lines a stroke leaves
   where the font builds a digit from overlapping parts, and leaves one
   clean line of 1.5px around it. --way-fill runs from 0 (card colour) to 1
   (blue); animating that instead of the colour keeps the digits in step
   with the card when the theme changes. */
@property --way-fill { syntax: "<number>"; inherits: true; initial-value: 0; }

.way__nr {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: color-mix(in srgb, var(--blue) calc(var(--way-fill) * 100%), var(--surface));
  -webkit-text-stroke: 3px var(--blue);
  paint-order: stroke fill;
  transition: --way-fill 300ms ease;
}

.way:hover .way__nr { --way-fill: 1; }

.way h3 {
  margin-top: 1rem;
  font-size: 1.2rem;
}

.way p {
  margin: 0.5rem 0 1.3rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.way__from {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}

.way__from img { width: 1.75rem; height: 1.75rem; border-radius: 50%; }

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

@media (prefers-reduced-motion: reduce) {
  .way, .way__nr { transition: none; }
}

/* The portrait itself stays still: it only pops in once and tilts with the
   mouse. Floating is left to the widgets around it. */
.hero2__photo {
  animation: hero2-pop 900ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
}


/* ==========================================================================
   SKILLS: BENTO
   ========================================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(1.4rem, 4vh, 2.4rem);
}

.tile {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1), border-color 250ms ease;
}

.tile--wide { grid-column: span 2; }

.tile::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 20%, transparent), transparent);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.tile:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.tile:hover::before { opacity: 1; }

.tile__icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
}

.tile__icon svg { width: 1.3rem; height: 1.3rem; }

.tile h3 { margin-top: 0.9rem; font-size: 1.2rem; }

.tile__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.tile__chips li {
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  font-size: 0.85rem;
  font-weight: 650;
  transition: border-color 200ms ease, color 200ms ease, transform 300ms cubic-bezier(0.34, 1.5, 0.64, 1);
}

.tile__chips li:hover { border-color: var(--border-strong); color: var(--blue); transform: translateY(-2px); }

.tile__badge {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.4rem 0.8rem;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.tile__badge:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }

@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; }
}

/* ==========================================================================
   PROJECTS: JUSTLIMIT SPOTLIGHT
   ========================================================================== */
@property --spot-x { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --spot-y { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.spot {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
  margin: clamp(1.4rem, 4vh, 2.4rem) 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.spot__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 20rem;
  perspective: 900px;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--blue) 38%, transparent), transparent 62%),
    #0b1019;
}

.spot__art img {
  width: clamp(8rem, 13vw, 11rem);
  border-radius: 23%;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: rotateX(var(--spot-x)) rotateY(var(--spot-y));
  animation: spot-sway 9s ease-in-out infinite;
}

@keyframes spot-sway {
  0%, 100% { --spot-x: 4deg; --spot-y: -12deg; }
  50% { --spot-x: -4deg; --spot-y: 12deg; }
}

.spot__art.is-tilting img {
  animation: none;
  transition: --spot-x 380ms cubic-bezier(0.34, 1.4, 0.64, 1), --spot-y 380ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.spot__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.4rem, 3vw, 2.6rem);
}

.spot__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 650;
}

.spot__live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.14);
  color: #2fb653;
  font-size: 0.72rem;
  font-weight: 800;
}

.spot__live::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  animation: hero2-blink 1.8s ease-in-out infinite;
}

.spot h3 {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  letter-spacing: -0.04em;
}

.spot__lead {
  margin: 0.6rem 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
}

.spot__body > p:not(.spot__meta):not(.spot__lead) {
  margin: 0.6rem 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.spot__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.2rem 0 1.4rem;
  padding: 0;
  list-style: none;
}

.spot__stats li {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 650;
}

.spot__stats strong { color: var(--text); font-weight: 800; }

@media (max-width: 760px) {
  .spot { grid-template-columns: 1fr; }
  .spot__art { min-height: 14rem; }
}

/* ==========================================================================
   PROJECT CARDS: LIFT AND ZOOM
   ========================================================================== */
#projecten .project-grid > .project-card:not(.project-card--featured) {
  transition: transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1), border-color 250ms ease, box-shadow 250ms ease;
}

#projecten .project-grid > .project-card:not(.project-card--featured):hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px rgba(4, 10, 24, 0.22);
}

#projecten .project-grid > .project-card .project-media { overflow: hidden; }

#projecten .project-grid > .project-card .project-media img {
  transition: transform 600ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

#projecten .project-grid > .project-card:not(.project-card--featured):hover .project-media img {
  transform: scale(1.06);
}

/* ==========================================================================
   CONTACT: ONE BIG PANEL
   ========================================================================== */
.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(2.2rem, 6vw, 4.5rem) clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius-lg) * 1.5);
  background:
    radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--blue) 26%, transparent), transparent 70%),
    var(--surface);
  text-align: center;
}

.cta h2 {
  max-width: none;
  margin: 0.4rem auto 0;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.cta > p:not(.eyebrow) {
  margin: 0.8rem auto 0;
  color: var(--text-soft);
  font-size: 1.08rem;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.cta__actions .button {
  transition: transform 300ms cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 180ms ease, background 180ms ease;
}

.cta__actions .button:hover { transform: translateY(-2px) scale(1.03); }
.cta__actions .button:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
  .tile, .tile__chips li, .spot__art img, .spot__live::before,
  #projecten .project-grid > .project-card, #projecten .project-media img, .cta__actions .button {
    animation: none;
    transition: none;
  }
}

/* Icons and logos in the new buttons need room next to the label. */
.cta__actions .button,
.spot .button,
.hero2__actions .button {
  gap: 0.55rem;
}


/* ==========================================================================
   ROUND 5
   ========================================================================== */

/* Hero: the cut-out portrait stands in front of a giant outlined first name,
   on a soft blue glow, and fades out at the bottom into the page. */
.hero2__stage { overflow: visible; }

/* The name is an outline. A stroke on plain text also traces the places
   where the font builds a letter from parts that overlap (the stem of the u
   and the n, the bar of the t), which showed as stray lines inside the
   letters. So it is an SVG: the letters are stroked at twice the width and
   everything inside them is masked away. What is left is one clean line
   around each letter, 2px wide. The box has the size the word has in
   Manrope; the letters are centred in it and may run over its edge. */
.hero2__word {
  position: absolute;
  top: 6%;
  left: 50%;
  z-index: 0;
  translate: -50% 0;
  width: 2.712em;
  height: 0.9em;
  overflow: visible;
  font-family: "Manrope", sans-serif;
  font-size: clamp(5rem, min(17vw, 34vh), 17rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  pointer-events: none;
  user-select: none;
  animation: hero2-rise 1000ms cubic-bezier(0.34, 1.2, 0.64, 1) 150ms both;
}

.hero2__word text { text-anchor: middle; }

.hero2__letters {
  fill: none;
  stroke: color-mix(in srgb, var(--blue) 45%, transparent);
  stroke-width: 4px;
}

.hero2__photo {
  z-index: 1;
  width: calc(var(--photo-h) * 0.99);
  margin-left: calc(min(var(--photo-h) * 0.99, 100%) / -2);
}

.hero2__photo::before {
  inset: 18% 10% 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 45%, transparent), transparent);
  filter: blur(18px);
}

/* The shadow is on the wrapper and the fade on the picture itself. Both on
   the picture cut the shadow off at the picture's edges, which showed as a
   faint box around the portrait on the light theme. */
.hero2__photo picture {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
}

.hero2__photo img {
  object-fit: contain;
  object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  -webkit-mask-composite: source-over;
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-composite: add;
}

.hero2__copy { margin-top: calc(var(--photo-h) * -0.16); }

/* One clear action plus a quiet link instead of three equal buttons. */
.hero2__actions { align-items: center; gap: 1.2rem; }

.hero2__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.hero2__link span { transition: translate 300ms cubic-bezier(0.34, 1.5, 0.64, 1); }
.hero2__link:hover { color: var(--blue); }
.hero2__link:hover span { translate: 4px 0; }

/* "Now" labels in the accent colour, without a green dot. */
.xp__live,
.spot__live {
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
}

.xp__live::before,
.spot__live::before { display: none; }

/* Spotlight icon: keep its proportions and a gentler 3D sway. */
.spot__art { perspective: 1400px; }
.spot__art img { height: auto; aspect-ratio: 1; }

@keyframes spot-sway {
  0%, 100% { --spot-x: 3deg; --spot-y: -7deg; }
  50% { --spot-x: -3deg; --spot-y: 7deg; }
}

/* Compass: two short points instead of three paragraphs. */
.compass-points { margin: 1rem 0 0; display: grid; gap: 0.9rem; }

.compass-points dt {
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 750;
}

.compass-points dd {
  margin: 0.3rem 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .hero2__word { top: 10%; font-size: clamp(4.4rem, 26vw, 8rem); }
  .hero2__photo { width: 100%; margin-left: -50%; }
  .hero2__copy { margin-top: calc(var(--photo-h) * -0.12); }
}

/* Compass gets the same big title as the JustLimit spotlight above it. */
#projecten .project-card--featured h3 {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  letter-spacing: -0.04em;
}

/* Phones: the portrait is as wide as the screen, so the widgets move down onto
   the shoulders, away from the face. Inholland is in the timeline anyway. */
@media (max-width: 760px) {
  .hero2__chip--study { display: none; }
  .hero2__chip--app { top: auto; bottom: 34%; left: 0; }
  .hero2__chip--now { top: auto; bottom: 17%; right: 0; }
}


/* ==========================================================================
   PROJECTS ON THE HOMEPAGE: SHORT CARDS
   Each card is one link to the project's own page: a visual, a title, one
   line and "Lees meer". The two biggest projects get the wide top row.
   ========================================================================== */
.works {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(1.4rem, 4vh, 2.4rem);
}

.work {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition:
    transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1),
    border-color 250ms ease,
    box-shadow 250ms ease;
}

.work--big { grid-column: span 3; }

.work:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px rgba(4, 10, 24, 0.22);
}

.pv {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: #0b1019;
}

.work .pv img { transition: transform 700ms cubic-bezier(0.22, 0.9, 0.3, 1); }
.work:hover .pv img { transform: scale(1.06); }

.pv--icon {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--blue) 40%, transparent), transparent 62%),
    #0b1019;
}

.pv--icon img {
  width: clamp(5.5rem, 9vw, 8rem);
  height: auto;
  border-radius: 23%;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.pv--image img,
.pv--banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pv--image img { object-position: 50% 30%; }

.work:not(.work--big) .pv { aspect-ratio: 1280 / 394; }

.work__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.15rem 1.25rem 1.25rem;
}

.work__meta {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.work__title {
  margin-top: 0.2rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.work--big .work__title { font-size: clamp(1.6rem, 2.4vw, 2rem); }

.work__text {
  margin-top: 0.35rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.work__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.9rem;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 750;
}

.work__more span { transition: translate 300ms cubic-bezier(0.34, 1.5, 0.64, 1); }
.work:hover .work__more span { translate: 5px 0; }

@media (max-width: 900px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work, .work--big { grid-column: span 1; }
  .work--big:first-child { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .works { grid-template-columns: 1fr; }
  .work, .work--big, .work--big:first-child { grid-column: auto; }
}

/* ==========================================================================
   PROJECT PAGES
   ========================================================================== */
.case-page {
  width: min(calc(100% - 2rem), 64rem);
  margin: 0 auto;
  padding: clamp(1.4rem, 4vh, 2.4rem) 0 2rem;
}

/* Back to the overview: the same button as "Lees meer" on the project
   cards, same shape and size. */
.case-back {
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text);
  transition: transform 180ms ease, border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.case-back span { transition: translate 300ms cubic-bezier(0.34, 1.5, 0.64, 1); }
.case-back:hover,
.case-back:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--border-strong));
  background: color-mix(in srgb, var(--blue) 10%, var(--surface-strong));
  color: var(--text);
}
.case-back:hover span { translate: -3px 0; }

@media (prefers-reduced-motion: reduce) {
  .case-back, .case-back span { transition: none; }
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.4rem, 4vw, 3rem);
  margin-top: clamp(1rem, 3vh, 1.8rem);
}

.case-hero h1 {
  max-width: none;
  margin-top: 0.4rem;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.05em;
}

.case-hero__lead {
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.case-hero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.case-hero__actions:empty { display: none; }
.case-hero__actions .button { gap: 0.55rem; }

.case-hero .pv {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.case-hero .pv--banner { aspect-ratio: 1280 / 394; }
.case-hero .pv--icon { perspective: 1400px; }

.case-hero .pv--icon img {
  width: clamp(8rem, 16vw, 12rem);
  transform: rotateX(var(--spot-x)) rotateY(var(--spot-y));
  animation: spot-sway 9s ease-in-out infinite;
}

.case-hero .pv--icon.is-tilting img {
  animation: none;
  transition: --spot-x 380ms cubic-bezier(0.34, 1.4, 0.64, 1), --spot-y 380ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px;
  margin: clamp(1.6rem, 5vh, 2.6rem) 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
}

.case-facts div { padding: 1rem 1.15rem; background: var(--surface); }

.case-facts dt {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.case-facts dd {
  margin: 0.25rem 0 0;
  font-weight: 750;
}

.case-content {
  display: grid;
  gap: clamp(1.6rem, 4vh, 2.4rem);
  max-width: 44rem;
  margin-top: clamp(2rem, 6vh, 3.2rem);
}

.case-block h2,
.case-shots h2 {
  max-width: none;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

.case-block p {
  margin: 0.7rem 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.case-shots { margin-top: clamp(2.4rem, 7vh, 3.6rem); }

.case-shots__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.case-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.case-shot img { display: block; width: 100%; }

.case-shot figcaption {
  padding: 0.9rem 1.05rem 1.05rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.case-shot figcaption strong { display: block; color: var(--text); margin-bottom: 0.2rem; }

.case-note { margin: 0.8rem 0 0; color: var(--text-soft); font-size: 0.85rem; }

.case-next {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: clamp(2.6rem, 8vh, 4rem);
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1), border-color 250ms ease;
}

.case-next span:first-child { color: var(--text-soft); font-size: 0.85rem; font-weight: 700; }
.case-next strong { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.03em; }
.case-next strong span { display: inline-block; transition: translate 300ms cubic-bezier(0.34, 1.5, 0.64, 1); }
.case-next:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.case-next:hover strong span { translate: 6px 0; }

@media (max-width: 760px) {
  .case-hero { grid-template-columns: 1fr; }
  .case-hero .pv { order: -1; }
  .case-shots__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .work, .work .pv img, .work__more span, .case-next, .case-hero .pv--icon img { transition: none; animation: none; }
}


/* ==========================================================================
   ROUND 6
   ========================================================================== */

/* Cards: the title link covers the whole card, the outside link sits on top
   of it, so a card has two targets without nesting links. */
.work { position: relative; }

.work__title {
  margin: 0.2rem 0 0;
  max-width: none;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.work__link { color: inherit; text-decoration: none; }

.work__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.work__link:focus-visible { outline: none; }
.work:has(.work__link:focus-visible) { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 3px; }

.work__text { margin: 0.35rem 0 0; }

.work__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.work__more { padding-top: 0; margin-top: 0; }

.work__action {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 200ms ease, color 200ms ease, transform 300ms cubic-bezier(0.34, 1.5, 0.64, 1);
}

.work__action:hover {
  border-color: var(--border-strong);
  color: var(--blue);
  transform: translateY(-2px);
}

/* Phones: real JustLimit screens in a simple device frame. */
.phone {
  margin: 0;
  overflow: hidden;
  border: 5px solid #1d2331;
  border-radius: 2.1rem;
  background: #05070b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 60px rgba(0, 0, 0, 0.45);
}

.phone img { display: block; width: 100%; height: auto; }

/* On the homepage card one phone rises out of the bottom of the panel. */
.pv--phone {
  display: grid;
  justify-items: center;
  align-items: start;
  padding-top: 1.6rem;
  background:
    radial-gradient(60% 80% at 50% 100%, color-mix(in srgb, var(--blue) 40%, transparent), transparent 70%),
    #0b1019;
}

.pv--phone .phone {
  width: min(46%, 13rem);
  transition: transform 700ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

.work .pv--phone img { transition: none; }
.work:hover .pv--phone img { transform: none; }
.work:hover .pv--phone .phone { transform: translateY(-10px); }

/* On the project page three phones fan out. */
.case-hero .pv--phones {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 0;
  overflow: visible;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--blue) 30%, transparent), transparent);
}

.pv--phones .phone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36%;
  transition: transform 700ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

.pv--phones .phone--0 { transform: translate(-112%, -46%) rotate(-8deg) scale(0.9); }
.pv--phones .phone--1 { z-index: 2; transform: translate(-50%, -52%); }
.pv--phones .phone--2 { transform: translate(12%, -46%) rotate(8deg) scale(0.9); }

.pv--phones:hover .phone--0 { transform: translate(-124%, -48%) rotate(-11deg) scale(0.9); }
.pv--phones:hover .phone--1 { transform: translate(-50%, -56%); }
.pv--phones:hover .phone--2 { transform: translate(24%, -48%) rotate(11deg) scale(0.9); }

/* Skills ribbon: one line that keeps moving, under the hero. */
.ribbon {
  display: flex;
  overflow: hidden;
  margin: clamp(0.5rem, 2vh, 1.2rem) 0 0;
  padding: 0.95rem 0;
  border-block: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.ribbon__track {
  display: flex;
  flex: none;
  gap: 2.6rem;
  margin: 0;
  padding: 0 1.3rem;
  list-style: none;
  animation: ribbon 40s linear infinite;
}

.ribbon__track li {
  display: flex;
  align-items: center;
  gap: 2.6rem;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 700;
  white-space: nowrap;
}

.ribbon__track li::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--blue);
}

.ribbon:hover .ribbon__track { animation-play-state: paused; }

@keyframes ribbon {
  to { transform: translateX(-100%); }
}

@media (max-width: 760px) {
  .pv--phones .phone { width: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  .ribbon__track { animation: none; }
  .pv--phones .phone, .pv--phone .phone { transition: none; }
}


/* ==========================================================================
   ROUND 7: REAL SCREENS IN FRAMES
   Websites sit in a browser window, desktop apps in their own window and
   mobile views in the same phone frame JustLimit uses.
   ========================================================================== */
.win {
  margin: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #0b0f17;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 30px 60px rgba(0, 0, 0, 0.45);
}

.win img { display: block; width: 100%; height: auto; }

.win__bar {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 3.2rem;
  align-items: center;
  height: 1.65rem;
  padding: 0 0.6rem;
  background: #1a2030;
}

.win__dots { display: flex; gap: 0.3rem; }

.win__dots i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #3b4459;
}

.win__url {
  justify-self: center;
  max-width: 100%;
  overflow: hidden;
  padding: 0.1rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #8d97ad;
  font-size: 0.66rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A web page screenshot has no status bar, so the frame adds one with an
   island; otherwise it reads as a rounded bubble instead of a phone. */
.phone--side {
  position: relative;
  padding-top: 0.95rem;
  border-width: 4px;
  border-radius: 1.45rem;
}

.phone--side::before {
  content: "";
  position: absolute;
  top: 0.28rem;
  left: 50%;
  width: 30%;
  height: 0.42rem;
  border-radius: 999px;
  background: #1d2331;
  translate: -50% 0;
}

/* Homepage cards: the screen rises out of the bottom of the panel. */
.pv--stage {
  background:
    radial-gradient(70% 90% at 50% 100%, color-mix(in srgb, var(--blue) 38%, transparent), transparent 70%),
    #0b1019;
}

.work:not(.work--big) .pv.pv--stage { aspect-ratio: 16 / 10; }

.work .pv--stage img { transition: none; }
.work:hover .pv--stage img { transform: none; }

.work .pv--stage .win,
.work .pv--stage .phone {
  position: absolute;
  transition: transform 700ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

.work .pv--single .win { top: 13%; left: 9%; right: 9%; }

.work .pv--combo .win { top: 13%; left: 7%; width: 74%; }
.work .pv--combo .phone { top: 27%; right: 6%; width: 19%; }

.work:hover .pv--stage .win { transform: translateY(-8px); }
.work:hover .pv--combo .phone { transform: translateY(-14px); }

/* Project pages: bigger, with some depth, and they move apart on hover. */
.case-hero .pv--stage {
  aspect-ratio: 5 / 4;
  overflow: visible;
  border: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 30%, transparent), transparent);
  perspective: 1600px;
}

.case-hero .pv--stage .win,
.case-hero .pv--stage .phone {
  position: absolute;
  transition: transform 800ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

.case-hero .pv--single .win {
  top: 50%;
  left: 11%;
  width: 78%;
  transform: translateY(-50%) rotateY(-9deg) rotateX(3deg);
}

.case-hero .pv--single:hover .win { transform: translateY(-50%); }

.case-hero .pv--combo .win { top: 16%; left: 0; width: 86%; }
.case-hero .pv--combo .phone { right: 0; bottom: 4%; width: 27%; }

.case-hero .pv--combo:hover .win { transform: translate(-8px, -6px); }
.case-hero .pv--combo:hover .phone { transform: translate(8px, -10px) rotate(2deg); }

.case-hero .pv--stack .win { width: 82%; }
.case-hero .pv--stack .win--back { top: 9%; left: 0; transform: scale(0.94); transform-origin: top left; }
.case-hero .pv--stack .win--front { right: 0; bottom: 9%; }

.case-hero .pv--stack:hover .win--back { transform: translate(-10px, -10px) scale(0.94); }
.case-hero .pv--stack:hover .win--front { transform: translate(10px, 10px); }

/* App windows are dark on dark: a lighter edge and more glow behind them. */
.win--app {
  box-shadow:
    0 0 0 1px rgba(150, 175, 230, 0.2),
    0 30px 60px rgba(0, 0, 0, 0.5);
}

.case-hero .pv--stack {
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 46%, transparent), transparent);
}

/* Card buttons: "Lees meer" as a quiet button, the outside link as the blue
   button with its logo, like the project buttons used to be. */
.work__foot { gap: 0.6rem; }

.work__foot .button {
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
}

.work__foot .work__more {
  margin: 0;
  padding-top: 0;
  color: var(--text);
}

.work:hover .work__more { border-color: color-mix(in srgb, var(--blue) 55%, var(--border-strong)); }

.work__foot .work__action.button-primary {
  border: 1px solid rgba(157, 194, 255, 0.42);
  color: #fff;
}

.work__foot .work__action.button-primary:hover {
  border-color: rgba(157, 194, 255, 0.7);
  color: #fff;
  transform: translateY(-2px);
}

/* An odd last screenshot takes the full row. */
.case-shot:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) {
  .work .pv--stage .win,
  .work .pv--stage .phone,
  .case-hero .pv--stage .win,
  .case-hero .pv--stage .phone { transition: none; }
}


/* ==========================================================================
   FLIP SWITCH AND LAB
   ========================================================================== */
.nav .flip-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  border: 1px solid var(--border-strong);
  color: var(--text);
  perspective: 300px;
}

.flip-switch__icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  transition: transform 600ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.nav .flip-switch:hover,
.nav .flip-switch:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--border-strong));
  color: var(--blue);
}

.flip-switch:hover .flip-switch__icon,
.flip-switch:focus-visible .flip-switch__icon { transform: rotateY(180deg); }

/* The pointer, the selection box and the fade sit above everything, outside
   the page that turns. */
.flip-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.flip-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  margin: -3px 0 0 -5px;
  fill: #fff;
  stroke: #0b1019;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  opacity: 0;
}

.flip-box {
  position: absolute;
  width: 0;
  height: 0;
  border: 2px solid #fff;
  border-radius: 6px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  opacity: 0;
}

.flip-box.is-snapped {
  border-width: 3px;
  animation: flip-snap 420ms ease-out;
}

@keyframes flip-snap {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9), 0 0 0 0 var(--blue); background: rgba(255, 255, 255, 0.35); }
  100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0), 0 0 60px 10px transparent; }
}

/* The space the sheet turns in: dark, a little lighter in the middle. The
   fade is the same picture, so fading reads as the page leaving that space
   and not as a curtain coming down. */
:root { --flip-void: radial-gradient(110% 85% at 50% 42%, #eef2f8 0%, #c6d0df 78%); }
:root[data-theme="dark"] { --flip-void: radial-gradient(110% 85% at 50% 42%, #111b2e 0%, #04060b 74%); }

.flip-fade {
  position: absolute;
  inset: 0;
  background: var(--flip-void);
  opacity: 0;
}

html.is-flipping,
html.flip-arrive {
  perspective: 1700px;
  background: var(--flip-void) fixed;
}

/* The page as a sheet: a faint edge, and a shadow in the space behind it. */
html.is-flipping body {
  outline: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  outline-offset: -1px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"].is-flipping body { box-shadow: 0 40px 120px rgba(30, 50, 90, 0.28); }

/* Nothing on the page reacts while it turns, and when leaving the real
   pointer makes way for the one in the animation. */
html.flip-busy body {
  pointer-events: none;
  user-select: none;
}

html.flip-leaving,
html.flip-leaving * { cursor: none !important; }

/* Not-yet-revealed parts stay hidden while the page turns. */
[data-flip-hidden] { visibility: hidden !important; transition: none !important; }

/* Focus helpers would otherwise swing into view with the page. */
html.flip-busy .skip-link,
html.flip-arrive .skip-link { visibility: hidden; }

/* Arriving. The script lands the page with its layers; until it takes over
   the page waits out of sight. The script can be a while (slow connection,
   pictures queued ahead of it), so the wait is generous. Only if it never
   comes does the sheet swing in by itself. */
html.flip-arrive { perspective-origin: 50% 50vh; }

html.flip-arrive body {
  transform-origin: 50% 50vh;
  animation: flip-arrive 1000ms cubic-bezier(0.25, 0.6, 0.3, 1) 3000ms both;
}

@keyframes flip-arrive {
  from { transform: rotateY(90deg) scale(0.66); opacity: 0; }
  25% { opacity: 1; }
  to { transform: none; opacity: 1; }
}

/* --------------------------------------------------------------------------
   Lab: the back of the same sheet, with the same colours, type and plain
   background as the front, in both themes. (It once had a graph-paper grid,
   which only ever showed on the light theme.)
   -------------------------------------------------------------------------- */

.lab-page {
  width: min(calc(100% - 2rem), 64rem);
  margin: 0 auto;
  padding: clamp(2rem, 7vh, 4rem) 0 2rem;
}

.lab-hero__text h1 {
  max-width: none;
  margin-top: 0.4rem;
  font-size: clamp(3rem, 9vw, 6rem);
  letter-spacing: -0.05em;
}

.lab-hero__text p:last-child {
  max-width: 34rem;
  margin: 0.8rem 0 0;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(1.6rem, 5vh, 2.8rem);
}

.lab-grid .blog-card { grid-column: 1 / -1; margin: 0; }

.lab-card--soon {
  display: grid;
  place-items: center;
  min-height: 9rem;
  padding: 1.4rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-soft);
  font-weight: 700;
  text-align: center;
}

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

@media (prefers-reduced-motion: reduce) {
  .flip-switch__icon { transition: none; }
}

/* "Hoe ik werk": the project under each card leads to its page, and the
   whole card is the click area, like the project cards above. */
.way__from {
  text-decoration: none;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.way__from::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.way { cursor: pointer; }

.way__arrow {
  display: inline-block;
  margin-left: -0.1rem;
  color: var(--blue);
  transition: translate 250ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.way:hover .way__from {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--border));
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}

.way:hover .way__arrow { translate: 0.2rem 0; }

.way__from:focus-visible { outline: none; }
.way:has(.way__from:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .way__arrow { transition: none; }
}

/* --------------------------------------------------------------------------
   Lab projects. The visual shows how the work goes, step by step, on a line
   with a pulse running down it. Its colours are set here for a dark panel;
   on the light theme the panel in an article is light (see .case-flow).
   -------------------------------------------------------------------------- */
.flow {
  --flow-text: #f2f5fa;
  --flow-soft: rgba(242, 245, 250, 0.62);
  --flow-kind: rgba(242, 245, 250, 0.55);
  --flow-line: rgba(110, 168, 255, 0.35);
  --flow-pulse: #9cc3ff;
  --flow-pulse-glow: rgba(110, 168, 255, 0.7);
  --flow-nr: #0b1019;
  --flow-nr-edge: rgba(110, 168, 255, 0.6);
  --flow-box: rgba(242, 245, 250, 0.04);
  --flow-box-edge: rgba(242, 245, 250, 0.1);
  --flow-key: #3f7fda;
  --flow-key-box: rgba(63, 127, 218, 0.2);
  --flow-key-edge: rgba(110, 168, 255, 0.6);
  position: relative;
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 25rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  color: var(--flow-text);
  text-align: left;
}

/* The line through the step numbers, and the pulse that runs along it. */
.flow::before,
.flow__pulse {
  position: absolute;
  top: 1.2rem;
  bottom: 1.2rem;
  left: 1.05rem;
  translate: -50% 0;
}

.flow::before {
  content: "";
  width: 2px;
  background: var(--flow-line);
}

/* The pulse is a strip as long as the line, with the dot at its top. Moving
   the strip down by its own length takes the dot along the whole line, and
   only a transform changes: the browser can do that without laying the page
   out again in every frame, which moving the dot with `top` made it do. */
.flow__pulse {
  width: 8px;
  pointer-events: none;
  animation: flow-run 3.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.flow__pulse::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--flow-pulse);
  box-shadow: 0 0 14px 3px var(--flow-pulse-glow);
}

@keyframes flow-run {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(calc(100% - 8px)); opacity: 0; }
}

.flow__step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
}

.flow__nr {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1.5px solid var(--flow-nr-edge);
  border-radius: 50%;
  background: var(--flow-nr);
  font-size: 0.85rem;
  font-weight: 800;
}

.flow__box {
  display: block;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--flow-box-edge);
  border-radius: 10px;
  background: var(--flow-box);
}

.flow__kind {
  display: block;
  color: var(--flow-kind);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow__box strong { display: block; margin-top: 0.1rem; font-size: 1rem; }
.flow__box small { display: block; margin-top: 0.15rem; color: var(--flow-soft); font-size: 0.8rem; line-height: 1.4; }

/* The step that makes it 1:1: the game's own driver plays the music. */
.flow__step--key .flow__nr { border-color: var(--flow-key); background: var(--flow-key); color: #fff; }
.flow__step--key .flow__box { border-color: var(--flow-key-edge); background: var(--flow-key-box); }

.case-hero .pv--flow {
  display: grid;
  place-items: center;
  aspect-ratio: auto;
  min-height: 22rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--blue) 30%, transparent), transparent 60%),
    #0b1019;
}

/* The card on the lab overview: like the Note 4 card, but the whole card
   leads to the project page. */
.lab-project {
  position: relative;
  transition: transform 450ms cubic-bezier(0.34, 1.4, 0.64, 1), border-color 250ms ease;
}

.lab-project:hover { transform: translateY(-4px); border-color: var(--border-strong); }

.lab-project__visual { display: grid; grid-template-columns: 1fr; }
.lab-project__visual .flow { max-width: 22rem; }

.lab-project__link { color: inherit; text-decoration: none; }

.lab-project__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.lab-project__link:focus-visible { outline: none; }
.lab-project:has(.lab-project__link:focus-visible) { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 3px; }

.lab-project__more { margin-top: 1.2rem; }
.lab-project:hover .work__more span { translate: 5px 0; }

@media (prefers-reduced-motion: reduce) {
  .flow__pulse { animation: none; opacity: 0; }
  .lab-project { transition: none; }
}

/* The tracks on the Sega Rally page sit right under the facts, over the
   full width, in the live player. */
.case-tracks { margin-top: clamp(2rem, 6vh, 3.2rem); }
.case-tracks > p:not(.case-note) { max-width: 44rem; margin: 0.7rem 0 0; color: var(--text-soft); font-size: 1.05rem; line-height: 1.7; }
.case-tracks .case-note { max-width: 44rem; }

/* The player brings its own layout; here it gets the site's colours, type
   and shapes: dark on the dark theme, light on the light theme (further
   down). The script reads the --sr2006 colours for its drawings and reads
   them again when the theme changes. */
.case-player.sr2006 {
  --sr2006-bg: #0b1019;
  --sr2006-panel: rgba(242, 245, 250, 0.04);
  --sr2006-border: rgba(242, 245, 250, 0.1);
  --sr2006-text: #f2f5fa;
  --sr2006-muted: rgba(242, 245, 250, 0.6);
  --sr2006-accent: #3f7fda;
  --sr2006-line: #6ea8ff;
  --sr2006-mix-line: #f2f5fa;
  --sr2006-dim: rgba(242, 245, 250, 0.12);
  /* On a wide screen: as tall as fits on the screen together with the
     heading and the line of text above it, within limits. */
  --sr2006-height: clamp(24rem, calc(100vh - 17.5rem), 32rem);
  --sr2006-height: clamp(24rem, calc(100svh - 17.5rem), 32rem);
  margin-top: 1rem;
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 60% at 70% 0%, color-mix(in srgb, var(--blue) 24%, transparent), transparent 70%),
    #0b1019;
  font-family: inherit;
  font-size: 0.95rem;
}

.case-player .sr2006-play {
  min-width: 6.5rem;
  height: 2.6rem;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  transition: background-color 180ms ease, transform 180ms ease;
}

.case-player .sr2006-play:hover { background: #4a8ae6; transform: translateY(-2px); }
.case-player .sr2006-title { font-weight: 800; }
.case-player .sr2006-scope { border-radius: 10px; }
.case-player .sr2006-track { border-radius: 10px; font-weight: 700; transition: border-color 180ms ease, background-color 180ms ease; }
.case-player .sr2006-track-c { font-weight: 600; }
.case-player .sr2006-track.is-current { background: rgba(63, 127, 218, 0.2); }
.case-player .sr2006-label { font-weight: 800; }

:root:not([data-theme="dark"]) .case-player.sr2006 {
  --sr2006-bg: var(--surface);
  --sr2006-panel: var(--bg);
  --sr2006-border: rgba(16, 36, 63, 0.12);
  --sr2006-text: #10243f;
  --sr2006-muted: #55627a;
  --sr2006-accent: #0d4bd9;
  --sr2006-line: #0d4bd9;
  --sr2006-mix-line: #10243f;
  --sr2006-dim: rgba(16, 36, 63, 0.14);
  background:
    radial-gradient(70% 60% at 70% 0%, color-mix(in srgb, var(--blue) 8%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}

:root:not([data-theme="dark"]) .case-player .sr2006-play:hover { background: #0a3fb8; }
:root:not([data-theme="dark"]) .case-player .sr2006-track.is-current { background: color-mix(in srgb, var(--blue) 9%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .case-player .sr2006-play, .case-player .sr2006-track { transition: none; }
}

/* Sega Rally: the game box in 3D, from the scans of the front, back and
   spine. It sways a little on its own; drag it to turn it all the way
   round. The script sets the turn; without it the box stands at an angle. */
.case-hero .pv--cover {
  display: grid;
  place-items: center;
  gap: 1rem;
  margin: 0;
  padding: clamp(1.6rem, 4vw, 2.6rem) 0;
  aspect-ratio: auto;
  overflow: visible;
  border: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 30%, transparent), transparent);
}

/* The same glow, as soft on a light page as it is on a dark one. Around a
   narrow object most of it is in view, and at full strength it turned into
   a blue cloud there. */
:root:not([data-theme="dark"]) .case-hero .pv--cover {
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 11%, transparent), transparent);
}

/* Room for the shadow under the box, so the caption stands clear of it. */
.case-hero .pv--cover .box3d { margin-bottom: 1.4rem; }

.pv--cover figcaption {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  text-wrap: balance;
}

/* Where the scans come from, on a line of its own under the caption. */
.pv__source { display: block; margin-top: 0.2rem; font-size: 0.72rem; font-weight: 500; opacity: 0.85; }
.pv--cover figcaption a { text-underline-offset: 2px; white-space: nowrap; }
.pv--cover figcaption a:hover,
.pv--cover figcaption a:focus-visible { color: var(--text); }

.box3d {
  /* Front 1431 x 2000, spine 159 wide (the scans): the real proportions of the box. */
  --w: 17rem;
  --h: calc(var(--w) * 2000 / 1431);
  --d: calc(var(--w) * 159 / 1431);
  width: var(--w);
  height: var(--h);
  perspective: 1400px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.box3d.is-dragging { cursor: grabbing; }
.box3d--small { --w: 10.5rem; cursor: inherit; }
/* On the card the floor shadow would spill out of the picture. */
.box3d.box3d--small::after { display: none; }

.box3d__body {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(24deg);
}

.box3d__face {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--w);
  height: var(--h);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Front and back run 1px past the spine edge, over the spine: where two faces only
   touch, the browser blends both edges with the page and a thin seam shows through. */
.box3d__face--front { left: -1px; width: calc(var(--w) + 1px); transform: translateZ(calc(var(--d) / 2)); border-radius: 0 4px 4px 0; }
.box3d__face--back { left: -1px; width: calc(var(--w) + 1px); transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); border-radius: 4px 0 0 4px; }

/* The spine sits on the left of the front, the opening on the right. The edge faces
   are 1px thicker than the box so they tuck under the covers. */
.box3d__face--spine,
.box3d__face--side {
  left: calc((var(--w) - var(--d)) / 2 - 0.5px);
  width: calc(var(--d) + 1px);
}

.box3d__face--spine { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }

.box3d__face--side {
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
  background: linear-gradient(90deg, #08090c, #23262d 45%, #0d0f13);
}

.box3d__face--top,
.box3d__face--bottom {
  top: calc((var(--h) - var(--d)) / 2 - 0.5px);
  height: calc(var(--d) + 1px);
  background: linear-gradient(#1b1e24, #0b0c10);
}

.box3d__face--top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
.box3d__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); }

/* A soft shadow on the floor under the box. */
.box3d::after {
  content: "";
  display: block;
  width: 80%;
  height: 1.4rem;
  margin: 0.6rem auto 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(4, 10, 24, 0.55), transparent);
  pointer-events: none;
}

:root:not([data-theme="dark"]) .box3d::after {
  background: radial-gradient(closest-side, rgba(16, 36, 63, 0.3), transparent);
}

.lab-project__visual--cover {
  display: grid;
  place-items: center;
  padding: 1.6rem;
}

@media (max-width: 760px) {
  .box3d { --w: 13rem; }
  .box3d--small { --w: 9rem; }
}

/* The step diagram, now inside the part about the driver. */
.case-flow {
  margin: 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--blue) 30%, transparent), transparent 60%),
    #0b1019;
}

/* On the light theme it is a light card like the others on the page: the
   same diagram, in the light colours. */
:root:not([data-theme="dark"]) .case-flow {
  background:
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
}

:root:not([data-theme="dark"]) .case-flow .flow {
  --flow-text: var(--text);
  --flow-soft: var(--text-soft);
  --flow-kind: color-mix(in srgb, var(--text-soft) 82%, transparent);
  --flow-line: color-mix(in srgb, var(--blue) 28%, transparent);
  --flow-pulse: var(--blue);
  --flow-pulse-glow: color-mix(in srgb, var(--blue) 45%, transparent);
  --flow-nr: var(--surface);
  --flow-nr-edge: color-mix(in srgb, var(--blue) 50%, transparent);
  --flow-box: var(--bg);
  --flow-box-edge: var(--border);
  --flow-key: var(--blue);
  --flow-key-box: color-mix(in srgb, var(--blue) 8%, var(--surface));
  --flow-key-edge: color-mix(in srgb, var(--blue) 45%, transparent);
}

/* --------------------------------------------------------------------------
   The Galaxy Note 4 on the lab card, built in 3D like the Sega Rally box:
   153.5 x 78.6 x 8.5 mm. Its metal frame is a closed band around the phone:
   a strip along each side and, round each corner, five narrow strips that
   together make the bend. So it is solid from every side, also seen exactly
   from the edge. Drag to turn it.
   -------------------------------------------------------------------------- */
.blog-card__visual--note4 {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 1.2rem;
}

.note4 {
  --h: 16rem;
  --w: calc(var(--h) * 78.6 / 153.5);
  --d: calc(var(--h) * 8.5 / 153.5);
  --r: calc(var(--w) * 0.11);
  width: var(--w);
  height: var(--h);
  perspective: 1200px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.note4.is-dragging { cursor: grabbing; }

.note4 .box3d__body { transform: rotateX(4deg) rotateY(-18deg); }

.note4__rim,
.note4__face {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
}

/* Every part of the frame faces outward and shows only that side: what
   faces away from the viewer is inside the phone, and the browser does not
   have to draw it. */
.note4__rim,
.note4__side,
.note4__bend {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* The metal that shows round the glass and round the back: brushed, a little
   lighter where the light catches it. */
.note4__rim { background: linear-gradient(100deg, #6f757e, #d9dde2 22%, #8b9199 48%, #e4e7ea 72%, #7a8088); }
.note4__rim--front { transform: translateZ(calc(var(--d) / 2)); }
.note4__rim--back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }

/* The band between them, in 24 parts: a strip along each side and five
   narrow strips round each corner. Every part is as wide as the phone is
   thick (one pixel more, so it closes up with the glass and the back) and
   --len long. All are placed the same way: start in a middle (--cx, --cy),
   turn to face --a (0deg is right, 90deg is down), move --out to the frame
   and stand upright. Placing them with one transform instead of with top
   and left keeps them lined up to the pixel. */
.note4__side,
.note4__bend {
  --thick: calc(var(--d) + 1px);
  --light: #c9cdd2;
  --dark: #848a92;
  --sun: 300deg;
  /* across its thickness the band is rounded: darker towards both edges */
  --round: rgba(24, 28, 34, 0.3), rgba(24, 28, 34, 0) 26%, rgba(255, 255, 255, 0.16) 50%, rgba(24, 28, 34, 0) 74%, rgba(24, 28, 34, 0.3);
  position: absolute;
  top: 0;
  left: 0;
  width: var(--thick);
  height: var(--len);
  background: #b4b9c0;
  transform-origin: 0 0;
  transform: translate(var(--cx), var(--cy)) rotateZ(var(--a)) translateX(var(--out)) rotateY(90deg) translate(-50%, -50%);
}

/* The straight parts start in the middle of the phone and run from where
   one bend ends to where the next begins (and half a pixel further). */
.note4__side { --cx: calc(var(--w) / 2); --cy: calc(var(--h) / 2); }
.note4__side--left { --a: 180deg; --out: calc(var(--w) / 2); --len: calc(var(--h) - 2 * var(--r) + 1px); }
.note4__side--right { --a: 0deg; --out: calc(var(--w) / 2); --len: calc(var(--h) - 2 * var(--r) + 1px); }
.note4__side--top { --a: 270deg; --out: calc(var(--h) / 2); --len: calc(var(--w) - 2 * var(--r) + 1px); }
.note4__side--bottom { --a: 90deg; --out: calc(var(--h) / 2); --len: calc(var(--w) - 2 * var(--r) + 1px); }

/* A bend is a quarter turn in five strips of 18 degrees, from the middle of
   its corner. 0.3129 and 0.9877 are 2 sin 9deg and cos 9deg: how long such
   a strip is and how far out it stands, for a bend of radius 1. */
.note4__bend { --out: calc(var(--r) * 0.9877); --len: calc(var(--r) * 0.3129 + 1px); }
.note4__bend--tl { --cx: var(--r); --cy: var(--r); }
.note4__bend--tr { --cx: calc(var(--w) - var(--r)); --cy: var(--r); }
.note4__bend--br { --cx: calc(var(--w) - var(--r)); --cy: calc(var(--h) - var(--r)); }
.note4__bend--bl { --cx: var(--r); --cy: calc(var(--h) - var(--r)); }

/* The metal is lit from the upper right, like the screen. */
@supports (color: color-mix(in srgb, red, blue)) {
  /* A straight part has one tone, with the soft reflections of brushed
     metal along its length (they fade out towards the bends). */
  .note4__side {
    background:
      linear-gradient(90deg, var(--round)),
      linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2) 24%, rgba(24, 28, 34, 0.1) 50%, rgba(255, 255, 255, 0.2) 76%, rgba(255, 255, 255, 0)),
      color-mix(in srgb, var(--light) calc(50% + 50% * cos(var(--a) - var(--sun))), var(--dark));
  }

  /* A strip of a bend runs from the tone of where it starts to the tone of
     where it ends, 9 degrees to each side of its own direction, so the
     shading goes round the corner without steps. */
  .note4__bend {
    background:
      linear-gradient(90deg, var(--round)),
      linear-gradient(
        180deg,
        color-mix(in srgb, var(--light) calc(50% + 50% * cos(var(--a) - 9deg - var(--sun))), var(--dark)),
        color-mix(in srgb, var(--light) calc(50% + 50% * cos(var(--a) + 9deg - var(--sun))), var(--dark))
      );
  }
}

.note4__face { backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }

.note4__face--front {
  inset: 1.5px;
  background: #07080b;
  box-shadow: inset 0 0 0 1px rgba(242, 245, 250, 0.08);
  transform: translateZ(calc(var(--d) / 2 + 0.5px));
}

.note4__speaker {
  position: absolute;
  top: 4.6%;
  left: 50%;
  width: 18%;
  height: 0.7%;
  border-radius: 999px;
  background: #22262d;
  translate: -50% 0;
}

.note4__selfie {
  position: absolute;
  top: 4.2%;
  left: 68%;
  width: 3.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3a4558, #0b0d12 70%);
}

.note4__screen {
  position: absolute;
  inset: 9% 4.5% 9.5%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.15em;
  border-radius: 2px;
  background:
    radial-gradient(circle at 70% 25%, color-mix(in srgb, var(--blue) 45%, transparent), transparent 60%),
    #0b1019;
  color: #f2f5fa;
  font-family: "Manrope", sans-serif;
  /* Everything on the screen is sized from the phone's height, so a larger
     phone shows the same screen, only bigger. */
  font-size: calc(var(--h) / 16);
  text-align: center;
}

.note4__status {
  position: absolute;
  top: 0.7em;
  right: 1em;
  color: rgba(242, 245, 250, 0.6);
  font-size: 0.5em;
  font-weight: 700;
}

.note4__from {
  color: rgba(242, 245, 250, 0.45);
  font-size: 0.95em;
  font-weight: 800;
  text-decoration: line-through;
  text-decoration-thickness: 0.13em;
}

.note4__arrow { color: rgba(242, 245, 250, 0.6); font-size: 0.9em; line-height: 1; }
.note4__to { font-size: 1.75em; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.note4__os { margin-top: 0.5em; color: rgba(242, 245, 250, 0.65); font-size: 0.6em; font-weight: 700; }

/* The physical home button under the screen. */
.note4__home {
  position: absolute;
  bottom: 3.1%;
  left: 50%;
  width: 24%;
  height: 3.6%;
  border-radius: 999px;
  background: #0d0f13;
  box-shadow: inset 0 0 0 1px rgba(242, 245, 250, 0.14);
  translate: -50% 0;
}

/* The back: the leather-look plastic with its fine dots, the camera, and
   the flash with the heart rate sensor under it. */
.note4__face--back {
  inset: 1.5px;
  background:
    radial-gradient(circle, rgba(242, 245, 250, 0.06) 0.6px, transparent 0.9px) 0 0 / 4px 4px,
    linear-gradient(160deg, #23262c, #121418);
  transform: rotateY(180deg) translateZ(calc(var(--d) / 2 + 0.5px));
}

.note4__camera {
  position: absolute;
  top: 7%;
  left: 50%;
  width: 26%;
  height: 8.5%;
  border-radius: 0.45rem;
  background:
    radial-gradient(circle at 50% 50%, #2d3a52 0 18%, #07080b 19% 34%, #3a3f48 35% 40%, transparent 41%),
    linear-gradient(#1a1d22, #0e1013);
  box-shadow: 0 0 0 1.5px #8b9199;
  translate: -50% 0;
}

.note4__flash {
  position: absolute;
  top: 17.5%;
  left: 50%;
  width: 14%;
  height: 2.6%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 50%, #f1e7c9 0 22%, transparent 26%),
    radial-gradient(circle at 72% 50%, #3b1d22 0 22%, transparent 26%),
    #0e1013;
  box-shadow: 0 0 0 1px #6f757e;
  translate: -50% 0;
}

/* On the article page the phone stands larger, on the same glow as the box. */
.case-hero .pv--note4 .note4 { --h: 22rem; }

/* Firmware calls and addresses in the running text. */
.case-block code,
.flow__box code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

@media (max-width: 760px) {
  .note4 { --h: 13rem; }
  .case-hero .pv--note4 .note4 { --h: 17rem; }
}

/* ==========================================================================
   PAGE TRANSITIONS
   Going from one page of the site to another, the browser keeps the old
   page on screen until the new one is ready and then lets one glide into
   the other, so nothing goes blank or builds up again. Deeper into the site
   the new page comes in from the right; going back, from the left.

   The menu bar stays where it is. A picture that is on both pages (a
   project's card and the top of its page) travels from one spot to the
   other. The script in the head of every page names those parts just before
   the change and tells which way it goes; without it this is a plain fade.
   Browsers that do not know this simply change pages as before.

   The rule that switches it on (@view-transition) stands in the head of
   every page: the browser must have read it before the page begins.
   ========================================================================== */
:root { --vt-shift: 2.25rem; }
:root:active-view-transition-type(back) { --vt-shift: -2.25rem; }

::view-transition-group(*) {
  animation-duration: 440ms;
  animation-timing-function: cubic-bezier(0.3, 0, 0.1, 1);
}

/* The page, and any named part that is only on one of the two pages: out
   quickly and a little to the side, in from the other side. */
::view-transition-old(root),
::view-transition-old(*):only-child {
  mix-blend-mode: normal;
  animation:
    vt-fade-out 150ms cubic-bezier(0.4, 0, 1, 1) both,
    vt-leave 440ms cubic-bezier(0.3, 0, 0.1, 1) both;
}

::view-transition-new(root),
::view-transition-new(*):only-child {
  mix-blend-mode: normal;
  animation:
    vt-fade-in 300ms cubic-bezier(0, 0, 0.2, 1) 110ms both,
    vt-enter 440ms cubic-bezier(0.3, 0, 0.1, 1) both;
}

/* The bar's frosted glass travels as a plain box; this gives it the bar's
   round ends back. When the bar is only on one of the two pages (on a
   phone it can be folded into the island) the glass is left out: it would
   blur the page before the bar itself has appeared. */
::view-transition-group(site-header) { border-radius: 999px; }
:root:not(:active-view-transition-type(bar))::view-transition-group(site-header) { backdrop-filter: none; }

@media (max-width: 980px) {
  ::view-transition-group(site-header) { border-radius: 24px; }
}

@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-leave { to { translate: calc(var(--vt-shift) * -1) 0; } }
@keyframes vt-enter { from { translate: var(--vt-shift) 0; } }

/* A picture changing shape on the way keeps its proportions and is cut to
   the frame, instead of being stretched. */
::view-transition-group(.vt-picture) {
  overflow: clip;
  border-radius: var(--radius-lg);
}

::view-transition-old(.vt-picture),
::view-transition-new(.vt-picture) {
  height: 100%;
  object-fit: cover;
}

/* Arriving this way, the transition is the entrance: what would fade in on
   a fresh visit stands ready. */
html.vt-arriving .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
