/* ==========================================================================
   ALPER KULTUREL — portfolio
   Static portfolio. No frameworks, no build step.
   --------------------------------------------------------------------------
   00 tokens
   01 reset + base
   02 utilities
   03 custom cursor
   04 header
   05 hero
   06 cabinet (folder stack)
   07 stats bar
   07b experience + education
   08 category page (dossier + paper)
   09 file list
   09b CV page
   09c back link + page actions + download menu
   09d contact page
   10 next folder footer nav
   11 footer
   12 back to top
   13 motion + responsive + print
   ========================================================================== */

/* 00 — TOKENS ============================================================== */

:root {
  /* surfaces */
  --ink: #0d0d0d;
  --ink-raise: #131313;
  --ink-sink: #080808;
  --paper: #f4efe4;
  --paper-dim: #e6dfd0;
  --paper-line: #d6cdb9;

  /* rules */
  --rule: rgba(244, 239, 228, 0.13);
  --rule-strong: rgba(244, 239, 228, 0.26);
  --rule-ink: rgba(13, 13, 13, 0.14);

  /* folder palette */
  --finance: #0f766e;
  --data: #b45309;
  --business: #6d28d9;
  --cv: #374151;

  /* per-page accent — overridden by .page--* below */
  --accent: #0f766e;
  --accent-deep: #0a4f4a;
  --accent-lift: #17a394;

  /* type */
  --display: "Anton", "Arial Narrow", Impact, sans-serif;
  --serif: "Playfair Display", "Times New Roman", Georgia, serif;
  --body: "EB Garamond", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* metrics */
  --header-h: 72px;
  --gutter: clamp(20px, 5vw, 72px);
  --measure: 1180px;
  --radius-folder: 24px;
  --white: #ffffff;
  /* footer icon ink, as channels so the alpha can be computed per-icon */
  --footer-icon-rgb: 244 239 228;

  /* grain */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* per-category accent themes */
.page--finance  { --accent: #0f766e; --accent-deep: #0a4f4a; --accent-lift: #17a394; }
.page--data     { --accent: #b45309; --accent-deep: #7c3a06; --accent-lift: #d97706; }
.page--business { --accent: #6d28d9; --accent-deep: #4c1d95; --accent-lift: #8b5cf6; }
.page--cv      { --accent: #374151; --accent-deep: #222932; --accent-lift: #4d5a6d; }
.page--contact { --accent: #374151; --accent-deep: #222932; --accent-lift: #4d5a6d; }

/* on the deep accent-coloured footers the icons read better as pure white */
.page--folder,
.page--contact { --footer-icon-rgb: 255 255 255; }

/* 01 — RESET + BASE ======================================================== */

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

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

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: clamp(17px, 1.15vw, 19px);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* faint vignette so the near-black never reads flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(244, 239, 228, 0.045), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(244, 239, 228, 0.03), transparent 55%);
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

/* visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
  border-radius: 2px;
}
.page--folder :focus-visible,
.page--contact :focus-visible { outline-color: var(--accent-lift); }
.paper :focus-visible { outline-color: var(--accent); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 400;
  padding: 12px 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* 02 — UTILITIES =========================================================== */

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

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--rule);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 03 — CUSTOM CURSOR ======================================================= */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: difference;
  will-change: transform;
  opacity: 0;
}

.cursor--ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid #f4efe4;
  transition: width 0.32s cubic-bezier(0.2, 0.7, 0.2, 1),
              height 0.32s cubic-bezier(0.2, 0.7, 0.2, 1),
              margin 0.32s cubic-bezier(0.2, 0.7, 0.2, 1),
              opacity 0.3s ease;
}

.cursor--dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: #f4efe4;
  transition: opacity 0.3s ease;
}

.cursor--ring.is-active {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
}

html.cursor-ready { cursor: none; }
html.cursor-ready a,
html.cursor-ready button,
html.cursor-ready summary,
html.cursor-ready label { cursor: none; }
html.cursor-ready .cursor { opacity: 1; }

/* 04 — HEADER ============================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 300;
  height: var(--header-h);
  display: flex;
  align-items: center;
  /* near-opaque + a light blur: the saturate() pass and a deep blur radius
     were the most expensive thing on the page during scroll. */
  background: rgba(13, 13, 13, 0.86);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--paper);
  white-space: nowrap;
}

.wordmark__pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  flex: none;
}
.page--folder .wordmark__pip,
.page--contact .wordmark__pip { background: var(--accent-lift); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 36px);
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.72);
  padding-block: 6px;
  transition: color 0.25s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] { color: var(--paper); }
.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* compact back affordance that stays reachable while scrolling */
.site-nav__link--back { color: var(--paper); }
.site-nav__link--back svg { width: 13px; height: 13px; flex: none; }
.site-nav__link--back:hover { color: var(--accent-lift); }

/* 05 — HERO ================================================================ */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: calc(var(--header-h) + clamp(26px, 6vh, 74px));
  padding-bottom: clamp(28px, 6vh, 64px);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.86);
  background: rgba(244, 239, 228, 0.03);
}

.status-pill__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex: none;
}

.status-pill__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.55);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.7); opacity: 0.9; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.hero__title {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin-block: clamp(18px, 3.4vh, 38px);
  display: flex;
  flex-direction: column;
}

.hero__line {
  display: block;
  font-size: clamp(60px, 11.4vw, 164px);
}

.hero__line--lead {
  font-size: clamp(36px, 7vw, 100px);
  color: rgba(244, 239, 228, 0.24);
  letter-spacing: -0.01em;
}

.hero__line--outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--paper);
  text-stroke: 2px var(--paper);
  paint-order: stroke fill;
}

@supports not ((-webkit-text-stroke: 2px #000) or (text-stroke: 2px #000)) {
  .hero__line--outline { color: var(--paper); opacity: 0.42; }
}

.hero__sub {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(18px, 1.85vw, 25px);
  line-height: 1.5;
  color: rgba(244, 239, 228, 0.82);
  max-width: 54ch;
  min-height: 1.5em;
}

.hero__caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--paper);
  animation: blink 1.05s steps(1) infinite;
}

.hero__caret.is-done { animation: none; opacity: 0; transition: opacity 0.6s ease; }

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---- bio ---- */

.hero__bio {
  margin-top: clamp(22px, 3vh, 36px);
  padding-top: clamp(17px, 2.4vh, 26px);
  border-top: 1px solid var(--rule);
}

.hero__bio-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
}

.hero__bio-title::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  flex: none;
}

/* runs the full shell width — the copy is set a touch larger to keep the
   measure from stretching too far at 1180px. */
.hero__bio-text {
  margin-top: 16px;
  font-size: clamp(16.5px, 1.24vw, 20px);
  line-height: 1.62;
  color: rgba(244, 239, 228, 0.82);
}

/* 06 — CABINET (FOLDER STACK) ============================================== */

.cabinet {
  position: relative;
  z-index: 1;
  padding-block: clamp(56px, 9vw, 120px);
}

.cabinet__label {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(24px, 4vw, 44px);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
}

.cabinet__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.cabinet__stack {
  display: block;
  perspective: 3000px;
}

/* position:relative is required — the hover z-index below only applies to
   positioned elements, and .is-in resolves transform to none (which would
   otherwise drop the stacking context the lift relies on). */
.cabinet__slot {
  display: block;
  position: relative;
}
.cabinet__slot + .cabinet__slot { margin-top: -22px; }

/* entrance is on the slot so hover lift on .folder stays independent */
.cabinet__slot {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 105ms);
}

.cabinet__slot.is-in {
  opacity: 1;
  transform: none;
}

.folder {
  position: relative;
  display: block;
  border-radius: var(--radius-folder) var(--radius-folder) 0 0;
  padding: clamp(30px, 4vw, 44px) clamp(24px, 4.5vw, 56px) clamp(34px, 4.5vw, 52px);
  background-image: linear-gradient(180deg,
    color-mix(in srgb, var(--folder) 82%, #ffffff) 0%,
    var(--folder) 16%,
    color-mix(in srgb, var(--folder) 78%, #000000) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 -6px 22px rgba(0, 0, 0, 0.45);
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow: hidden;
  isolation: isolate;
}

/* folder grain — keeps the colour from reading as flat vector */
.folder::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  background-size: 220px 220px;
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

/* sheen sweep — transform-only, so it composites on the GPU and costs
   nothing beyond the hover itself. */
.folder__sheen {
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: 0;
  width: 42%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 45%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.14) 55%,
    transparent 100%);
  transform: translate3d(-160%, 0, 0);
  opacity: 0;
  will-change: transform;
}

.folder:hover .folder__sheen,
.folder:focus-visible .folder__sheen {
  animation: sheen 1.05s cubic-bezier(0.3, 0.6, 0.2, 1) 0.06s 1 forwards;
}

@keyframes sheen {
  0%   { transform: translate3d(-160%, 0, 0); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate3d(340%, 0, 0); opacity: 0; }
}

.folder--finance  { --folder: var(--finance); }
.folder--data     { --folder: var(--data); }
.folder--business { --folder: var(--business); }
.folder--cv       { --folder: var(--cv); }

/* the manila tab, hanging from the top edge */
.folder__tab {
  position: absolute;
  top: 0;
  left: clamp(24px, 4.5vw, 56px);
  width: clamp(130px, 20vw, 232px);
  height: clamp(20px, 2.4vw, 30px);
  border-radius: 0 0 16px 16px;
  background: color-mix(in srgb, var(--folder) 74%, #ffffff);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.folder__inner {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(18px, 3vw, 40px);
  padding-top: clamp(14px, 1.8vw, 22px);
}

.folder__body {
  display: block;
  min-width: 0;
}

.folder__name {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.04;
  color: #ffffff;
  letter-spacing: -0.005em;
}

.folder__desc {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: clamp(10px, 1vw, 11px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.folder__end {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 28px);
  flex: none;
}

.folder__count {
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
}

.folder__arrow {
  display: grid;
  place-items: center;
  width: clamp(40px, 4.4vw, 54px);
  height: clamp(40px, 4.4vw, 54px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #ffffff;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
              background-color 0.45s ease,
              color 0.45s ease,
              border-color 0.45s ease;
}

.folder__arrow svg { width: 17px; height: 17px; }

.folder:hover,
.folder:focus-visible {
  transform: translateY(-9px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 26px 60px rgba(0, 0, 0, 0.6);
}

.cabinet__slot:hover { z-index: 4; }
.folder:hover .folder__arrow,
.folder:focus-visible .folder__arrow {
  transform: translateX(9px);
  background: #ffffff;
  color: var(--folder);
  border-color: #ffffff;
}

/* 07 — STATS BAR =========================================================== */

.stats {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--ink-raise);
}

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

.stat {
  padding: clamp(28px, 4.5vw, 52px) clamp(16px, 2.5vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1px solid var(--rule);
}
.stat:first-child { border-left: 0; }

.stat__num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.5);
}

/* 07b — EXPERIENCE + EDUCATION ============================================= */

.creds {
  position: relative;
  z-index: 1;
  padding-block: clamp(48px, 6vw, 84px);
}

/* the cabinet supplies its own top padding, so only the seam between two
   adjacent credential blocks needs a rule */
.creds + .creds { border-top: 1px solid var(--rule); }

/* Two stacked blocks would otherwise stack both paddings around the seam and
   leave ~200px of dead space either side of the rule. :has() trims the block
   above; without it this degrades to the plain padding above, still fine. */
.creds + .creds,
.creds + .cabinet { padding-top: clamp(34px, 4.2vw, 56px); }

.creds:has(+ .creds),
.creds:has(+ .cabinet) { padding-bottom: clamp(34px, 4.2vw, 56px); }

.creds__label {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(20px, 3vw, 36px);
  font-family: var(--mono);
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
}

.creds__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

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

.cred {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: 10px clamp(28px, 4vw, 60px);
  padding: clamp(24px, 3vw, 38px) clamp(16px, 2vw, 28px);
  border-top: 1px solid var(--rule);
  border-radius: 14px;
  /* reveal only — hover moves the inner columns, so the two never fight
     over this element's transform */
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s ease var(--cred-delay, 0ms),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--cred-delay, 0ms),
    background-color 0.45s ease;
}

.cred.is-in { opacity: 1; transform: none; }

.cred:hover {
  background: linear-gradient(90deg,
    rgba(244, 239, 228, 0.06) 0%,
    rgba(244, 239, 228, 0.015) 46%,
    transparent 78%);
}

/* the accent rule that draws itself down the left on hover */
.cred::before {
  content: "";
  position: absolute;
  left: 0;
  top: clamp(24px, 3vw, 38px);
  bottom: clamp(24px, 3vw, 38px);
  width: 2px;
  border-radius: 2px;
  background: var(--accent-lift);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cred:hover::before { transform: scaleY(1); }

.cred__meta,
.cred__body {
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cred:hover .cred__meta,
.cred:hover .cred__body { transform: translateX(8px); }

.cred__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cred__role {
  font-family: var(--display);
  font-size: clamp(19px, 1.62vw, 26px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--white);
}

.cred__org {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.78);
}

.cred__when {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-lift);
}

.cred__body {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.cred__text {
  max-width: 66ch;
  font-size: clamp(15.5px, 1.06vw, 17px);
  line-height: 1.62;
  color: rgba(244, 239, 228, 0.84);
}

.cred__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 66ch;
}

.cred__points li {
  position: relative;
  padding-left: 24px;
  font-size: clamp(15px, 1vw, 16.5px);
  line-height: 1.56;
  color: rgba(244, 239, 228, 0.78);
}

.cred__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 10px;
  height: 1px;
  background: var(--accent-lift);
  transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cred:hover .cred__points li::before { width: 15px; }

/* 08 — CATEGORY PAGE: DOSSIER + PAPER ====================================== */

/* z-index 5, not 1: .dossier-section below is z-index 1 and comes later in
   the DOM, so at equal z-index it painted over this block — which trapped the
   download menu (z-index 40, inside this stacking context) behind the paper. */
.page-head {
  position: relative;
  z-index: 5;
  padding-top: 168px;
  padding-bottom: clamp(40px, 6vw, 72px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-lift);
}

.kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  flex: none;
}

.page-title {
  margin-top: clamp(20px, 3vw, 32px);
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(48px, 10.5vw, 148px);
  line-height: 0.86;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.dossier-section {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(56px, 8vw, 96px);
}

.dossier-section__label {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(22px, 3vw, 34px);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.5);
}

.dossier-section__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.dossier { position: relative; }

/* the folder's coloured back board, visible around the paper */
.dossier__back {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-folder) var(--radius-folder) 0 0;
  padding: clamp(10px, 1.2vw, 18px) clamp(10px, 1.2vw, 18px) 0;
  background-image: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 84%, #ffffff) 0%,
    var(--accent) 14%,
    color-mix(in srgb, var(--accent) 80%, #000000) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 60px 130px rgba(0, 0, 0, 0.72);
}

.dossier__back::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--noise);
  background-size: 220px 220px;
  opacity: 0.14;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* the cover that folds open — clipped by its stage so it swings out of frame */
/* perspective sits here, on the flap's direct parent. No overflow clipping:
   the flap pivots about its top edge, so it never extends past the dossier. */
.dossier__stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  perspective: 1700px;
  border-radius: var(--radius-folder) var(--radius-folder) 0 0;
  pointer-events: none;
}

.dossier__flap {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-folder) var(--radius-folder) 0 0;
  transform-origin: top center;
  transform: rotateX(0deg);
  backface-visibility: hidden;
  background-image:
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 88%, #ffffff) 0%,
      var(--accent) 34%,
      color-mix(in srgb, var(--accent) 72%, #000000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 1.05s cubic-bezier(0.55, 0.06, 0.24, 1),
              opacity 0.4s ease 0.72s;
}

.dossier__flap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--noise);
  background-size: 220px 220px;
  opacity: 0.15;
  mix-blend-mode: overlay;
}

.dossier.is-open .dossier__flap {
  transform: rotateX(-104deg);
  opacity: 0;
}

/* ---- the paper ---- */

.paper {
  position: relative;
  border-radius: 6px 6px 0 0;
  padding: 88px;
  background-color: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(56px);
  transition: opacity 0.85s ease 0.3s,
              transform 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
  overflow: hidden;
}

.dossier.is-open .paper {
  opacity: 1;
  transform: none;
}

/* paper grain */
.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  background-size: 220px 220px;
  opacity: 0.09;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* paperclip, top right */
.paper__clip {
  position: absolute;
  top: 26px;
  right: 44px;
  width: 34px;
  height: 84px;
  transform: rotate(-10deg);
  color: #9aa0a6;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.22));
  pointer-events: none;
}

/* monogram badge, top left */
.paper__monogram {
  position: absolute;
  top: 44px;
  left: 88px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

/* vertical rotated category label, right edge */
.paper__edge {
  position: absolute;
  top: 190px;
  right: 26px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 88%, #000000);
  opacity: 0.72;
  pointer-events: none;
}

/* metadata grid */
.paper__meta {
  position: relative;
  margin-top: 78px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 34px;
}

.meta__item { display: flex; flex-direction: column; gap: 8px; }

.meta__label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 92%, #000000);
}

.meta__value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: rgba(13, 13, 13, 0.82);
  overflow-wrap: anywhere;
}

/* lede with drop cap */
.paper__lede {
  position: relative;
  margin-top: clamp(30px, 3.5vw, 46px);
  font-size: clamp(18px, 1.35vw, 21px);
  line-height: 1.68;
  color: rgba(13, 13, 13, 0.9);
  max-width: 62ch;
}

.paper__lede::first-letter {
  float: left;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 96px;
  line-height: 0.76;
  color: var(--accent);
  padding: 6px 14px 0 0;
}

.paper__lede + .paper__lede { margin-top: 20px; }
.paper__lede--plain::first-letter {
  float: none;
  font: inherit;
  color: inherit;
  padding: 0;
}

/* 09 — FILE LIST =========================================================== */

.files {
  margin-top: clamp(38px, 4.5vw, 58px);
  border-top: 1px solid var(--rule-ink);
}

.files__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 14px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.5);
}

.file { border-bottom: 1px solid var(--rule-ink); }

/* rows fade up once, staggered, when the list scrolls into view */
.file {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 45ms);
}

.files.is-in .file {
  opacity: 1;
  transform: none;
}

.file__link {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 0 16px;
  padding: 26px 26px 26px 0;
  transition: background-color 0.35s ease, padding-left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.file__link:hover,
.file__link:focus-visible {
  background-color: rgba(13, 13, 13, 0.035);
  padding-left: 14px;
}

.file__body {
  display: block;
  min-width: 0;
}

.file__title,
.file__stack,
.file__desc { display: block; }

.file__dot {
  margin-top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.file__link:hover .file__dot { transform: scale(1.55); }

.file__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.2;
  color: var(--ink);
}

.file__stack {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.file__desc {
  margin-top: 9px;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.6;
  color: rgba(13, 13, 13, 0.72);
  max-width: 66ch;
}

.file__arrow {
  align-self: center;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.file__arrow svg { width: 20px; height: 20px; }

.file__link:hover .file__arrow,
.file__link:focus-visible .file__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* 09b — CV PAGE ============================================================ */

.cv__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: clamp(30px, 4vw, 56px);
  margin-top: clamp(38px, 4.5vw, 58px);
}

.cv__section + .cv__section {
  margin-top: clamp(26px, 3.2vw, 38px);
  padding-top: clamp(26px, 3.2vw, 38px);
  border-top: 1px solid var(--rule-ink);
}

.cv__section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.cv__section p {
  margin-top: 12px;
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.66;
  color: rgba(13, 13, 13, 0.82);
  max-width: 58ch;
}

.cv__section p + p { margin-top: 12px; }

/* dated entries inside the CV */
.cv__entry + .cv__entry { margin-top: 18px; }

.cv__entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 14px;
}

.cv__entry-role {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 1.35vw, 21px);
  line-height: 1.3;
  color: var(--ink);
}

.cv__entry-org {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.cv__entry-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(13, 13, 13, 0.45);
}

.cv__entry p {
  margin-top: 8px;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.62;
  color: rgba(13, 13, 13, 0.78);
  max-width: 58ch;
}

/* bulleted CV lists (certifications, highlights) */
.cv__list { margin-top: 14px; }

.cv__list li {
  position: relative;
  padding-left: 22px;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.62;
  color: rgba(13, 13, 13, 0.8);
}

.cv__list li + li { margin-top: 8px; }

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

.side-card {
  border: 1px solid var(--rule-ink);
  border-radius: 12px;
  padding: 22px 24px 24px;
  background: rgba(13, 13, 13, 0.022);
}

.side-card + .side-card { margin-top: 16px; }

.side-card__label {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.side-card__text {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(13, 13, 13, 0.78);
}

.side-card__list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.side-card__list li {
  padding: 5px 12px;
  border: 1px solid var(--rule-ink);
  border-radius: 100px;
  background: rgba(244, 239, 228, 0.62);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(13, 13, 13, 0.8);
}

.cv__contact {
  margin-top: clamp(34px, 4vw, 50px);
  padding-top: clamp(26px, 3vw, 36px);
  border-top: 2px solid var(--ink);
}

.cv__contact-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid rgba(13, 13, 13, 0.28);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.contact-link:hover,
.contact-link:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-3px);
}

.contact-link svg { width: 15px; height: 15px; flex: none; }

/* 09c — BACK LINK · PAGE ACTIONS · DOWNLOAD MENU =========================== */

.page-head__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(22px, 3vw, 34px);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  background: rgba(244, 239, 228, 0.04);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--paper);
  transition: background-color 0.32s ease, border-color 0.32s ease,
              color 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.back-link svg {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.back-link:hover,
.back-link:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateX(-4px);
}

.back-link:hover svg { transform: translateX(-3px); }

/* the row of primary actions under a page title */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: clamp(24px, 3vw, 34px);
}

/* --- download menu (a <details>, so it works with no JS at all) --- */

.dl { position: relative; }

.dl__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 24px;
  border-radius: 100px;
  /* paper, not accent: this is the primary action on a near-black page, and a
     slate or deep-blue pill disappears into it. */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.3s ease;
}

.dl__btn::-webkit-details-marker { display: none; }
.dl__btn::marker { content: ""; }

.dl__btn:hover,
.dl__btn:focus-visible {
  background: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.dl__btn svg {
  width: 13px;
  height: 13px;
  flex: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dl[open] > .dl__btn svg { transform: rotate(180deg); }

/* This menu has to clear the dossier card below it. .page-head now sits at
   z-index 5 for that reason; the high value here is belt-and-braces for any
   future sibling that introduces a stacking context. */
.dl__menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 500;
  min-width: 336px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: #17171a;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 70px rgba(0, 0, 0, 0.78);
  animation: dl-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* the little caret tying the panel back to the button */
.dl__menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 36px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  background: #17171a;
}

@keyframes dl-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.dl__item {
  display: block;
  padding: 15px 17px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background-color 0.22s ease, border-color 0.22s ease,
              transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dl__item:hover,
.dl__item:focus-visible {
  background: rgba(244, 239, 228, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(3px);
}

.dl__item + .dl__item { margin-top: 4px; }

.dl__item-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
}

/* a leading dot that picks up the page accent, so the two options read as
   distinct choices rather than one block of text */
.dl__item-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--accent-lift);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-lift) 26%, transparent);
}

.dl__item-note {
  display: block;
  margin-top: 6px;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(244, 239, 228, 0.72);
}

/* --- secondary action button (outline) --- */

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  transition: background-color 0.3s ease, border-color 0.3s ease,
              color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.page-btn:hover,
.page-btn:focus-visible {
  background: rgba(244, 239, 228, 0.09);
  border-color: var(--paper);
  transform: translateY(-3px);
}

.page-btn svg { width: 14px; height: 14px; flex: none; }

/* 09d — CONTACT PAGE ======================================================= */

.contact-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(32px, 4.5vw, 64px);
  margin-top: clamp(30px, 4vw, 48px);
}

.cform__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* every direct child after the first gets breathing room, whatever the mix
   of rows and single fields happens to be */
.cform > * + * { margin-top: 20px; }

.field { display: block; }

.field__label {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.field__req { color: #c0392b; }

.field__input,
.field__select,
.field__textarea {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rule-ink);
  border-radius: 10px;
  background: rgba(244, 239, 228, 0.62);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color 0.25s ease, background-color 0.25s ease,
              box-shadow 0.25s ease;
}

.field__textarea { resize: vertical; min-height: 158px; }

.field__select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d0d0d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
}

.field__input::placeholder,
.field__textarea::placeholder { color: rgba(13, 13, 13, 0.38); }

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field.is-invalid .field__input,
.field.is-invalid .field__select,
.field.is-invalid .field__textarea {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14);
}

.field__error {
  display: none;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b91c1c;
}

.field.is-invalid .field__error { display: block; }

.cform__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: clamp(24px, 3vw, 32px);
  padding-top: clamp(22px, 3vw, 30px);
  border-top: 1px solid var(--rule-ink);
}

.cform__submit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 30px;
  border-radius: 100px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.3s ease;
}

.cform__submit:hover,
.cform__submit:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

.cform__submit svg { width: 15px; height: 15px; flex: none; }

.cform__hint {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(13, 13, 13, 0.6);
  max-width: 42ch;
}

/* the "or just email me" card */
.contact-aside { align-self: start; }

.contact-aside .side-card__list { display: block; }

.contact-aside .side-card__list li {
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 12px;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.contact-aside .side-card__list li + li { margin-top: 8px; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 18px;
  border: 1px solid var(--rule-ink);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease;
}

.copy-btn:hover { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.copy-btn svg { width: 13px; height: 13px; flex: none; }
.copy-btn.is-copied { background: #15803d; border-color: #15803d; color: #ffffff; }

/* success / status line under the form */
.cform__status {
  display: none;
  margin-top: 18px;
  padding: 15px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 16px;
  line-height: 1.55;
  color: rgba(13, 13, 13, 0.85);
}

.cform__status.is-shown { display: block; }

/* 10 — NEXT FOLDER ========================================================= */

.next-folder {
  position: relative;
  z-index: 1;
  padding-block: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--rule);
}

.next-folder__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(26px, 3.4vw, 42px) clamp(24px, 3.4vw, 46px);
  border-radius: var(--radius-folder) var(--radius-folder) 0 0;
  background-image: linear-gradient(180deg,
    color-mix(in srgb, var(--next) 82%, #ffffff) 0%,
    var(--next) 18%,
    color-mix(in srgb, var(--next) 78%, #000000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.5s ease;
}

.next-folder__link:hover,
.next-folder__link:focus-visible {
  transform: translateY(-7px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 24px 56px rgba(0, 0, 0, 0.55);
}

.next-folder__text { display: block; min-width: 0; }

.next-folder__kicker {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.next-folder__name {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1.05;
  color: #ffffff;
}

.next-folder__arrow {
  display: grid;
  place-items: center;
  width: clamp(44px, 4.6vw, 58px);
  height: clamp(44px, 4.6vw, 58px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  flex: none;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
              background-color 0.45s ease, color 0.45s ease;
}

.next-folder__arrow svg { width: 19px; height: 19px; }

.next-folder__link:hover .next-folder__arrow,
.next-folder__link:focus-visible .next-folder__arrow {
  transform: translateX(9px);
  background: #ffffff;
  color: var(--next);
}

/* 11 — FOOTER ============================================================== */

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--ink-sink);
  border-top: 1px solid var(--rule);
}

.page--folder .site-footer,
.page--contact .site-footer {
  background: var(--accent-deep);
  border-top-color: rgba(255, 255, 255, 0.16);
}

.footer__icons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 54px);
  padding: clamp(44px, 6vw, 74px) 0 clamp(34px, 4vw, 52px);
}

/* Two nested layers per icon. The wrapper carries a fast spin that is always
   applied but PAUSED, so hovering the row resumes it from whatever angle it
   froze at — nothing snaps back to zero. It also carries the cursor-proximity
   scale, which rides the independent `scale` property so it composes with the
   spin's transform instead of overwriting it. */
.footer__icon-wrap {
  display: inline-flex;
  width: clamp(38px, 4.2vw, 52px);
  height: clamp(38px, 4.2vw, 52px);
  scale: calc(0.94 + var(--near, 0) * 0.32);
  transform-origin: 50% 50%;
  animation: spin 3.2s linear infinite;
  animation-play-state: paused;
  opacity: 0;
  /* order matters: transition-delay below lines up with this property list */
  transition: scale 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.6s ease;
}

.footer__icons:hover .footer__icon-wrap { animation-play-state: running; }

/* direct hover pins it to full strength, whatever the proximity value is */
.footer__icon-wrap:hover .footer__icon { color: rgb(var(--footer-icon-rgb) / 1); }

.footer__icon {
  width: 100%;
  height: 100%;
  color: rgb(var(--footer-icon-rgb) / calc(0.48 + var(--near, 0) * 0.52));
  transform-origin: 50% 50%;
  animation: spin var(--spin, 48s) linear infinite;
}

/* reveal, staggered left to right — the delay applies to opacity only, so
   hovering never waits for the stagger before it scales */
.footer__icons.is-in .footer__icon-wrap {
  opacity: 1;
  transition-delay: 0ms, calc(var(--i, 0) * 70ms);
}

/* five permanently-rotating layers are pure cost once the footer is off
   screen, so the observer pauses them. */
.footer__icons.is-idle .footer__icon,
.footer__icons.is-idle .footer__icon-wrap { animation-play-state: paused; }

.footer__icon-wrap:nth-child(1) { --spin: 40s; }
.footer__icon-wrap:nth-child(2) { --spin: 46s; }
.footer__icon-wrap:nth-child(3) { --spin: 52s; }
.footer__icon-wrap:nth-child(4) { --spin: 58s; }
.footer__icon-wrap:nth-child(5) { --spin: 64s; }

.footer__icon-wrap:nth-child(2) .footer__icon,
.footer__icon-wrap:nth-child(4) .footer__icon { animation-direction: reverse; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.footer__barwrap { border-top: 1px solid var(--rule); }

.page--folder .footer__barwrap,
.page--contact .footer__barwrap { border-top-color: rgba(255, 255, 255, 0.16); }

.footer__bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 14px 24px;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: 22px var(--gutter);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.55);
}

.page--folder .footer__bar,
.page--contact .footer__bar { color: rgba(255, 255, 255, 0.62); }

.footer__scale { text-align: left; }
.footer__copy { text-align: center; }
.footer__tag { text-align: right; }

/* 12 — BACK TO TOP ========================================================= */

.to-top {
  position: fixed;
  right: clamp(18px, 3vw, 34px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 320;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: rgba(13, 13, 13, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--paper);
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.2, 0.7, 0.2, 1),
              background-color 0.3s ease, border-color 0.3s ease;
}

.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }

.to-top:hover,
.to-top:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.to-top svg { width: 17px; height: 17px; }

/* 13 — MOTION + RESPONSIVE + PRINT ========================================= */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .cabinet__slot { opacity: 1; transform: none; }
  .paper { opacity: 1; transform: none; }
  .file { opacity: 1; transform: none; }
  .cred { opacity: 1; transform: none; }
  .footer__icon-wrap { opacity: 1; }
  .footer__icon-wrap:hover { animation-play-state: paused; }
  .dossier__flap { display: none; }
  .cursor { display: none !important; }
  .folder__sheen { display: none; }
  html.cursor-ready { cursor: auto; }
  html.cursor-ready a,
  html.cursor-ready button,
  html.cursor-ready summary,
  html.cursor-ready label { cursor: pointer; }
}

@media (max-width: 980px) {
  .cv__grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  /* role and body stack, with the role block acting as the entry's header */
  .cred { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cred:hover .cred__meta,
  .cred:hover .cred__body { transform: none; }

  .paper { padding: 56px; }
  .paper__monogram { left: 56px; }
  .paper__clip { right: 30px; }
  .paper__edge { display: none; }
  .paper__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .cform__row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cform > * + * { margin-top: 16px; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }

  .page-head { padding-top: 124px; }

  /* the compact back button is the one that has to survive the small header */
  .site-nav__link--back span { display: none; }
  .site-nav__link--back svg { width: 16px; height: 16px; }

  .paper { padding: 34px; }
  .paper__monogram {
    top: 30px;
    left: 34px;
    width: 50px;
    height: 50px;
    font-size: 19px;
  }
  .paper__clip { top: 18px; right: 18px; width: 26px; height: 64px; }
  .paper__meta { margin-top: 66px; }
  .paper__lede::first-letter { font-size: 68px; padding-right: 11px; }

  .file__link { padding: 22px 12px 22px 0; }
  .file__arrow { opacity: 1; transform: none; }

  .dl__menu { min-width: 0; width: min(88vw, 320px); }
}

@media (max-width: 640px) {
  .hero { min-height: auto; padding-bottom: 44px; }

  .stats__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }

  .cabinet__slot + .cabinet__slot { margin-top: -14px; }

  .folder { padding: 26px 20px 30px; }
  .folder__tab { left: 20px; width: 128px; height: 20px; }
  .folder__inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }
  .folder__end { justify-content: space-between; width: 100%; }
  .folder__desc { letter-spacing: 0.16em; }

  .paper { padding: 24px; }
  .paper__monogram { left: 24px; top: 24px; }
  .paper__meta { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .paper__lede { font-size: 17px; }
  .paper__lede::first-letter { font-size: 58px; padding-right: 9px; }

  .file__link { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 0 12px; }

  .next-folder__link { flex-direction: column; align-items: flex-start; }
  .next-folder__arrow { align-self: flex-end; }

  .footer__bar {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 12px;
  }
  .footer__scale, .footer__copy, .footer__tag { text-align: center; }

  .to-top { width: 44px; height: 44px; }
}

/* ---- print: the CV page doubles as the printable CV ---- */

@media print {
  .site-header,
  .site-footer,
  .next-folder,
  .to-top,
  .skip-link,
  .cursor,
  .page-actions,
  .dossier__stage,
  .paper__clip,
  .paper__monogram,
  .paper__edge { display: none !important; }

  html, body { background: #ffffff !important; color: #000000 !important; }
  body::before { display: none !important; }

  .page-head { padding-top: 0 !important; padding-bottom: 16px !important; }
  .kicker { color: #444 !important; }
  .page-title { color: #000 !important; font-size: 34pt !important; line-height: 1 !important; }

  .dossier-section { padding-bottom: 0 !important; }
  .dossier__back {
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .dossier__back::after { display: none !important; }
  .paper {
    box-shadow: none !important;
    padding: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    background: #ffffff !important;
  }
  .paper::before { display: none !important; }
  .paper__meta { margin-top: 0 !important; border-bottom: 1pt solid #000 !important; }
  .paper__lede { font-size: 10.5pt !important; max-width: none; }
  .paper__lede::first-letter { float: none; font: inherit; color: inherit; padding: 0; }

  .cv__grid { grid-template-columns: minmax(0, 1fr) !important; }
  .cv__section p,
  .cv__entry p,
  .cv__list li { font-size: 10.5pt !important; max-width: none; }
  .side-card { break-inside: avoid; }
  .cv__entry, .cv__section { break-inside: avoid; }
  a { text-decoration: none; color: #000 !important; }
}
