/* ============================================================
   Max Jeltes — CV stylesheet
   Sections: tokens · reset · layout · top bar · hero ·
             composition · sections · about · work · education ·
             skills · interests · projects · modal · contact ·
             footer · scroll reveal
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --paper:       #f4f2ec;
  --paper-2:     #eae6db;
  --paper-3:     #e3dece;
  --ink:         #1b1a15;
  --ink-soft:    #55524a;
  --ink-mute:    #8d897c;
  --line:        #d9d4c6;
  --line-soft:   #e6e1d4;
  --accent:      #f0573f;   /* coral — the overlap / "me" */
  --accent-deep: #d23f28;
  --teal:        #1f8a7a;   /* industrial automation */
  --amber:       #f0a420;   /* software engineering */
  --overlap:     #2f5a44;   /* teal × amber blend */
  --indigo:      #5c6bc0;   /* education */

  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'Public Sans', system-ui, -apple-system, sans-serif;
  --mono:  'Geist Mono', ui-monospace, monospace;

  /* Type scale — a small, fixed set of sizes so the page reads calmly.
     xs: mono labels, chips, tags, small meta
     sm: secondary text (roles, years, captions)
     base: body / descriptions
     md: subheadings, highlighted text
     lg: certbox title, edu degree */
  --fs-xs:   11px;
  --fs-sm:   13px;
  --fs-base: 15px;
  --fs-md:   18px;
  --fs-lg:   19px;

  --gut:  clamp(20px, 5vw, 80px);
  --maxw: 1280px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--paper); }

/* Subtle paper grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .45;
  background-image: radial-gradient(rgba(80, 70, 45, 0.05) 1px, transparent 1.3px);
  background-size: 4px 4px;
}

/* ── Layout ────────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ── Micro-labels ──────────────────────────────────────────── */
.lab {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.num {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ── Top bar ───────────────────────────────────────────────── */
header.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  backdrop-filter: saturate(1.1) blur(8px);
  background: linear-gradient(180deg, rgba(244, 242, 236, 0.92), rgba(244, 242, 236, 0.7));
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
header.bar.stuck { border-bottom-color: var(--line); }

.bar-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand .mk { position: relative; width: 25px; height: 15px; flex-shrink: 0; }
.brand .mk::before,
.brand .mk::after {
  content: '';
  position: absolute;
  top: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  mix-blend-mode: multiply;
}
.brand .mk::before { left: 0;  background: var(--teal); }
.brand .mk::after  { right: 0; background: var(--amber); }
.brand small {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.bar-nav { display: flex; align-items: center; gap: 26px; }

nav.top { display: flex; gap: 26px; }
nav.top a {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
nav.top a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
nav.top a:hover::after,
nav.top a.active::after { transform: scaleX(1); }
nav.top a.active { color: var(--ink); }

.lang { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: var(--fs-sm); letter-spacing: 0.06em; }
.lang button { background: none; border: none; cursor: pointer; font: inherit; color: var(--ink-mute); padding: 2px 1px; transition: color .2s; }
.lang button.active { color: var(--ink); }
.lang button:hover  { color: var(--accent); }
.lang span { color: var(--ink-mute); opacity: .45; }

.dl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background .25s, border-color .25s, transform .25s;
}
.dl:hover { background: var(--paper-2); border-color: var(--ink); transform: translateY(-1px); }
.dl-ic { flex-shrink: 0; color: var(--ink-soft); transition: color .25s, transform .25s; }
.dl:hover .dl-ic { color: var(--accent); transform: translateY(1px); }
.dl-caret { flex-shrink: 0; color: var(--ink-mute); transition: transform .25s; margin-left: 1px; }
.dl-wrap.open .dl-caret { transform: rotate(180deg); }

/* Download menu */
.dl-wrap { position: relative; }
.dl-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  white-space: nowrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .28);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
.dl-wrap.open .dl-menu { opacity: 1; transform: none; pointer-events: auto; }
.dl-opt {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  text-align: left;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.dl-opt:hover { background: var(--paper-2); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .dl-menu { transition: none; }
  .dl-caret { transition: none; }
}

@media (max-width: 720px) {
  nav.top { display: none; }
  .bar-nav { gap: 14px; }
  .dl span:last-child { display: none; }
  .dl { padding: 8px; }
  .dl-mk { width: 14px; }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(120px, 18vh, 210px) 0 clamp(60px, 9vh, 110px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.92;
  font-size: clamp(52px, 9vw, 120px);
}
.hero h1 .it  { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.hero h1 .dot { color: var(--accent); }

.hero .sub {
  margin-top: 30px;
  max-width: 34ch;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-soft);
  line-height: 1.55;
  text-align: justify;
  hyphens: none;
}

.hero .meta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; }
.hero .meta .it { display: flex; align-items: center; gap: 8px; }
.hero .meta .it .d { width: 6px; height: 6px; background: var(--ink); border-radius: 50%; opacity: .5; }
.hero .meta .it span { font-family: var(--mono); font-size: var(--fs-sm); letter-spacing: 0.04em; color: var(--ink-soft); }

/* ── Hero composition (interactive riso overlap) ───────────── */
.comp-wrap { display: flex; flex-direction: column; gap: 18px; align-items: flex-end; }
.composition {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 460px;
  min-height: 260px;
  margin-left: auto;
  overflow: visible;
  cursor: crosshair;
}
.composition .lyr  { position: absolute; will-change: transform; }
.composition .blend { mix-blend-mode: multiply; }

.comp-key { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.comp-key span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--ink-soft); }
.comp-key i    { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.comp-key i.sm { width: 8px;  height: 8px; }

@media (max-width: 860px) {
  .comp-wrap { align-items: center; }
  .composition { max-width: 320px; margin: 0 auto; }
  .comp-key { justify-content: center; }
}

/* ── Section frame ─────────────────────────────────────────── */
section.block {
  padding: clamp(56px, 9vh, 108px) 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: baseline;
  margin-bottom: clamp(36px, 5vw, 60px);
}
.sec-head .glyph   { width: 26px; height: 26px; position: relative; align-self: center; }
.sec-head h2       { font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(26px, 3.4vw, 40px); line-height: 1; }
.sec-head .tag     { justify-self: end; align-self: center; }
.sec-head .meta-num { font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-mute); letter-spacing: 0.1em; }

/* Glyph — recurring overlap mark */
.glyph { position: relative; }
.glyph.g-mark {
  --c1: var(--teal); --c2: var(--amber);
  --gx1: 0px; --gy1: 0px;   /* teal offset,  set by JS on cursor proximity */
  --gx2: 0px; --gy2: 0px;   /* amber offset, set by JS on cursor proximity */
  width: 40px; height: 24px;
}
.glyph.g-mark::before,
.glyph.g-mark::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  mix-blend-mode: multiply;
  /* Spring back gently when the cursor leaves. */
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.glyph.g-mark::before { left: 0;  background: var(--c1); transform: translate(var(--gx1), var(--gy1)); }
.glyph.g-mark::after  { right: 0; background: var(--c2); transform: translate(var(--gx2), var(--gy2)); }

@media (prefers-reduced-motion: reduce) {
  .glyph.g-mark::before,
  .glyph.g-mark::after { transition: none; }
}

/* Certbox ring glyph */
.glyph.g-ring { border: 2px solid var(--ink); border-radius: 50%; }
.glyph.g-ring::after { content: ''; position: absolute; inset: 7px; background: var(--accent); border-radius: 50%; }

/* ── About ─────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }

.about-lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.28;
  letter-spacing: -0.01em;
  max-width: 20ch;
}
.about-lead .a { color: var(--accent); font-style: italic; }

.about-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
@media (max-width: 680px) { .about-cols { grid-template-columns: 1fr; gap: 26px; } }
.about-cols p { color: var(--ink-soft); font-size: var(--fs-base); max-width: 46ch; text-align: justify; hyphens: auto; }
.about-cols p + p { margin-top: 16px; }
.about-cols .col .lab { display: block; margin-bottom: 12px; }

/* ── Work / timeline ───────────────────────────────────────── */
.rows { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: clamp(14px, 3vw, 44px);
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  cursor: pointer;
  transition: padding-left .35s cubic-bezier(.2, .8, .2, 1);
}
.row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.row:hover { padding-left: 18px; }
.row:hover::before { transform: scaleY(1); }
.row-nodesc { cursor: default; }
.row-nodesc:hover { padding-left: 0; }
.row-nodesc:hover::before { transform: scaleY(0); }

.row .yr { font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-mute); letter-spacing: 0.02em; white-space: nowrap; padding-top: 5px; }
.row .yr .now { color: var(--accent); }

.row .main h3   { font-weight: 600; font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.015em; line-height: 1.15; }
.row .main .role { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.role-title { font-family: var(--mono); font-size: var(--fs-sm); letter-spacing: 0.03em; color: var(--ink-soft); font-weight: 500; }
.role-sep   { color: var(--line); font-size: var(--fs-xs); }
.role-loc   { font-family: var(--mono); font-size: var(--fs-sm); letter-spacing: 0.02em; color: var(--ink-mute); }
.row .main .desc {
  color: var(--ink-soft);
  font-size: var(--fs-base);
  max-width: 62ch;
  text-wrap: pretty;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .4s cubic-bezier(.2, .8, .2, 1), opacity .35s, margin-top .4s;
  margin-top: 0;
}
.row .main .desc > span { overflow: hidden; }
.row .main .desc p { margin: 0; }
.row .main .desc p + p { margin-top: 12px; }
.row:hover .main .desc,
.row.open  .main .desc { grid-template-rows: 1fr; opacity: 1; margin-top: 12px; }

/* Company name with logo */
.row-co { display: flex; align-items: center; gap: 10px; }
.row-logo {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 2px;
}
.row-co-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.row-co-link:hover { color: var(--accent); }
.row-arr { font-size: 0.75em; color: var(--ink-mute); transition: color .2s, transform .2s; display: inline-block; }
.row-co-link:hover .row-arr { color: var(--accent); transform: translate(2px, -2px); }

.row .tags { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; max-width: 200px; }
.row .tags span {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--paper);
}

@media (max-width: 680px) {
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row .tags { justify-content: flex-start; margin-top: 10px; max-width: none; }
  .row .main .desc { grid-template-rows: 1fr; opacity: 1; margin-top: 10px; }
}

/* ── Education & Skills ────────────────────────────────────── */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 96px); }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; gap: 56px; } }

.edu-item { padding: 30px 0; border-bottom: 1px solid var(--line-soft); }
.edu-item:first-child { border-top: 1px solid var(--line); }
.edu-item .yr  { font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-mute); letter-spacing: 0.04em; }
.edu-item h3   { font-weight: 600; font-size: var(--fs-lg); letter-spacing: -0.01em; margin: 6px 0 2px; }
.edu-item .edu-school { color: var(--accent); font-size: var(--fs-base); }
.edu-item .note { color: var(--ink-soft); font-size: var(--fs-base); margin-top: 10px; max-width: 50ch; line-height: 1.6; text-wrap: pretty; }
.edu-item .note-line { display: block; }
.edu-item .note-line + .note-line { margin-top: 10px; }

.skills-heading { font-family: var(--sans); font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); display: block; margin-bottom: 18px; }
.skill-group { margin-bottom: 26px; }
.skill-group .lab { display: block; margin-bottom: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips span {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--ink);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  transition: border-color .25s, color .25s, transform .25s;
}
.chips span:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

.certbox {
  margin-top: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  gap: 14px;
}
.certbox .glyph { width: 24px; height: 24px; flex-shrink: 0; position: relative; }
.certbox .ct strong { font-weight: 600; font-size: var(--fs-base); }
.certbox .ct div { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-mute); letter-spacing: 0.04em; margin-top: 2px; }

/* ── Interests ─────────────────────────────────────────────── */
.ints { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 20px); }
@media (max-width: 700px) { .ints { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .ints { grid-template-columns: 1fr; } }

.int {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .35s, box-shadow .35s;
}
.int:hover { transform: translateY(-5px); border-color: var(--ink-soft); box-shadow: 0 12px 32px -12px rgba(0,0,0,.12); }

.int-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.int-photo-ph {
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 8px,
    rgba(27, 26, 21, 0.04) 8px 16px
  );
  position: relative;
}
.int-photo-ph::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 38% 50%, var(--c1, var(--teal)) 28%, transparent 62%),
    radial-gradient(circle at 62% 50%, var(--c2, var(--amber)) 28%, transparent 62%);
  opacity: .18;
  mix-blend-mode: multiply;
}

.int-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.int .icat   { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); }
.int .ititle { font-weight: 600; font-size: var(--fs-md); letter-spacing: -0.01em; line-height: 1.2; }
.int .idesc  { font-size: var(--fs-base); color: var(--ink-soft); line-height: 1.55; margin-top: 6px; text-align: justify; hyphens: auto; }
.idesc-link { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; transition: color .2s, text-decoration-color .2s; }
.idesc-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ── Projects list ─────────────────────────────────────────── */
.proj-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.pfilter {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  background: var(--paper);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color .25s, color .25s, background .25s;
}
.pfilter i { width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--ink)); flex-shrink: 0; }
.pfilter:hover { border-color: var(--ink); }
.pfilter.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pfilter.active i { box-shadow: 0 0 0 1.5px var(--paper); }

.proj-grid { display: flex; flex-direction: column; border-top: 1px solid var(--line); }

.proj {
  --k: var(--ink);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: clamp(14px, 3vw, 40px);
  align-items: center;
  padding: 20px 0;
  position: relative;
  transition: padding-left .3s cubic-bezier(.2, .8, .2, 1);
}
.proj::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--k);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.proj:hover              { padding-left: 16px; }
.proj:hover::before,
.proj:focus-visible::before { transform: scaleY(1); }
.proj:focus-visible      { outline: none; padding-left: 16px; }

.proj .pkind-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--k); flex-shrink: 0; margin: 0 auto; }
.proj .pbody     { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proj h3         { font-weight: 600; font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.015em; line-height: 1.15; }

/* Organisation + tagline on one line */
.proj .pmeta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 2px;
}
.proj .pmeta .sep {
  color: var(--line);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  flex-shrink: 0;
  user-select: none;
}
.proj .ptag {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj .psummary {
  font-size: var(--fs-base);
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.5;
  max-width: 60ch;
  text-align: left;
}
.proj .psummary-more {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  margin-top: 8px;
}
.proj .psummary-more .pmore-arr {
  display: inline-block;
  transition: transform .25s;
}
.proj:hover .psummary-more .pmore-arr,
.proj:focus-visible .psummary-more .pmore-arr { transform: translateX(3px); }

/* Organisation label */
.porg {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.porg-link { text-decoration: none; cursor: pointer; transition: color .2s; }
.porg-link:hover { color: var(--ink); }
.porg-arr { font-size: 0.8em; color: var(--ink-mute); transition: color .2s, transform .2s; display: inline-block; }
.porg-sep { color: var(--line); margin: 0 2px; }
.porg-tag { color: var(--ink-mute); font-weight: 400; }
.porg-noclick { pointer-events: none; }
.porg-link:hover .porg-arr { color: var(--ink); transform: translate(2px, -2px); }

.org-logo {
  width: 18px; height: 18px;
  border-radius: 4px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  padding: 1px;
}

/* Badges hidden on the card — shown in modal only */
.proj .badges { display: none; }

.badge {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--paper-2);
  white-space: nowrap;
}

.proj .pright {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.proj .pyear {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  white-space: nowrap;
}
.proj .pchevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  opacity: .55;
  transition: color .25s, opacity .25s, transform .25s;
}
.proj:hover .pchevron,
.proj:focus-visible .pchevron {
  color: var(--k);
  opacity: 1;
  transform: translateX(3px);
}
.pyear-mobile {
  display: none;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  margin-left: 10px;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .proj { grid-template-columns: 10px 1fr auto; gap: 14px; }
  .proj .pright .pyear { display: none; }   /* year shown inline in the title */
  .proj .pchevron { opacity: .55; }          /* keep the click hint on touch */
  .pyear-mobile { display: inline; }
}

/* Striped image placeholder */
.ph {
  position: relative;
  background: var(--paper-3);
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(27, 26, 21, 0.045) 7px 14px);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.ph::after {
  content: attr(data-ph);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  padding: 6px 8px;
  line-height: 1.3;
}

/* ── Project detail modal ──────────────────────────────────── */
.pmodal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pmodal.open { display: flex; }

.pmodal .scrim {
  position: absolute;
  inset: 0;
  background: rgba(22, 20, 14, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s;
}
.pmodal.open .scrim { opacity: 1; }

.pcard {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 44px 100px -44px rgba(0, 0, 0, .55);
  transform: translateY(18px) scale(.985);
  opacity: 0;
  transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.pmodal.open .pcard { transform: none; opacity: 1; }

.pcard .phero {
  width: 100%;
  aspect-ratio: 16 / 8;
  border: none;
  border-radius: 0;
  background-repeat: no-repeat;
}
.pcard .phero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--k, var(--ink));
}

.pclose {
  position: absolute;
  top: 13px; right: 13px;
  z-index: 3;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: var(--fs-base);
  color: var(--ink);
  transition: background .2s, transform .25s;
}
.pclose:hover { background: var(--paper-2); transform: rotate(90deg); }

.pcontent { padding: clamp(22px, 4vw, 34px); }
.pcontent .kind   { display: none; }
.pcontent h3      { font-weight: 700; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.025em; line-height: 1.04; margin-top: 0; }

/* Org + tagline in modal — same font, same size, same colour */
.pcontent .pm-org {
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-top: 8px;
  letter-spacing: 0.04em;
}
.pcontent .ptag {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 3px;
}
.pcontent p       { color: var(--ink-soft); font-size: var(--fs-base); margin-top: 16px; max-width: 56ch; text-align: justify; hyphens: auto; }
.pcontent .badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pcontent .plink  {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  transition: background .22s, color .22s, border-color .22s;
}
.pcontent .plink:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pcontent .plink-sec { margin-left: 8px; }

@media (prefers-reduced-motion: reduce) {
  .pcard, .pmodal .scrim, .proj { transition: none; }
}

/* ── Contact ───────────────────────────────────────────────── */
.contact { display: grid; grid-template-columns: 5fr 4fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 780px) { .contact { grid-template-columns: 1fr; gap: 32px; } }

.contact-left { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; width: 100%; }
@media (max-width: 780px) { .contact-left { grid-template-columns: auto 1fr; gap: 20px; align-items: flex-start; } }

.contact .contact-sub {
  font-family: var(--sans);
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
  letter-spacing: 0.01em;
}
@media (max-width: 780px) {
  .contact .contact-sub { font-size: var(--fs-base); text-align: left; hyphens: none; line-height: 1.6; }
}

.contact-right { display: flex; flex-direction: column; justify-content: center; }
.contact-photo {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background-size: cover;
  background-position: center top;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
@media (max-width: 780px) { .contact-photo { width: 160px; height: 160px; border-radius: 10px; } }

.clinks { display: flex; flex-direction: column; gap: 2px; }
.clink  { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.clink:last-child { border-bottom: 1px solid var(--line); }
.clink .k { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.clink .v { font-size: var(--fs-base); font-weight: 500; position: relative; }
.clink .v .u {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: 2px;
}
.clink:hover .v .u  { background-size: 100% 1.5px; color: var(--accent); }
.clink .v .arr       { display: inline-block; transition: transform .3s; color: var(--ink-mute); }
.clink:hover .v .arr { transform: translate(3px, -3px); color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────── */
footer.foot { padding-top: 30px; padding-bottom: 50px; }
footer.foot .foot-in {
  border-top: 1px solid var(--line);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
footer.foot .lab { color: var(--ink-mute); }

.footer-built-wrap { display: inline-flex; align-items: center; gap: 7px; }
.claude-logo { width: 16px; height: 16px; object-fit: contain; opacity: .7; }


/* ── Scroll reveal ─────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .row .main .desc { grid-template-rows: 1fr; opacity: 1; margin-top: 12px; }
}

/* ── Mobile overrides (≤ 480px) ────────────────────────────── */
@media (max-width: 480px) {
  /* Hero — smaller heading floor, less vertical padding */
  .hero { padding: clamp(90px, 14vh, 140px) 0 clamp(40px, 6vh, 70px); }
  .hero h1 { font-size: clamp(38px, 12vw, 64px); }
  .hero .sub { margin-top: 20px; font-size: var(--fs-base); }
  .hero .meta { margin-top: 22px; gap: 8px 18px; }

  /* About lead slightly smaller */
  .about-lead { font-size: clamp(20px, 6vw, 28px); }

  /* Work — descriptions always visible, no hover indent */
  .row:hover { padding-left: 0; }
  .row:hover::before { transform: scaleY(0); }

  /* Projects — keep the chevron click hint; year shows inline in the title */
  .proj .pright .pyear { display: none; }

  /* Contact — slightly smaller photo on very small screens */
  .contact-photo { width: 120px; height: 120px; }

  /* Modal — full width, smaller padding */
  .pmodal { padding: 0; align-items: flex-end; }
  .pcard { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .pcontent h3 { font-size: 22px; }
  .pcontent p  { font-size: var(--fs-base); }
  .pcontent .badges { margin-top: 12px; }
  .pcontent .plink  { margin-top: 16px; }

  /* Section headings */
  .sec-head { gap: 12px; margin-bottom: clamp(24px, 4vw, 40px); }
}
