/* ==========================================================================
   Tokens — lighter graphite dark mode
   ========================================================================== */
:root {
  --bg: #16181d;
  --bg-raised: #1a1d23;
  --surface: #1d2027;
  --surface-2: #23272f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text: #eef0f3;
  --muted: #a9aeb8;
  --dim: #767c88;

  /* Single accent — interactions and key stats only */
  --accent: #4f8cff;
  --accent-hover: #6b9fff;
  --accent-glow: rgba(79, 140, 255, 0.55);

  --radius: 16px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -26px rgba(0, 0, 0, 0.6);

  --font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --fast: 120ms cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -200px, rgba(140, 165, 210, 0.14), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}
.skip:focus { top: 16px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding-inline: 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 500 15px/1 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast), transform var(--fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--sm { height: 36px; padding-inline: 14px; font-size: 14px; border-radius: 8px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 8px 24px -10px var(--accent-glow);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 10px 32px -8px var(--accent-glow);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }

.btn__arrow { width: 16px; height: 16px; transition: transform var(--fast); }
.btn:hover .btn__arrow { transform: translateX(2px); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 24, 29, 0.75);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--fast);
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner { display: flex; align-items: center; gap: 24px; height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.02em; font-size: 19px; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font: 600 16px/1 var(--mono);
}

.nav__links { display: flex; gap: 2px; margin-left: auto; }
.nav__links a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: color var(--fast), background var(--fast);
}
.nav__links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.lang {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
}
.lang a {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--dim);
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.04em;
  transition: color var(--fast), background var(--fast);
}
.lang a:hover { color: var(--text); }
.lang a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.09); }

.nav__social {
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color var(--fast);
}
.nav__social:hover { color: #fff; }
.nav__social .icon-in { width: 22px; height: 22px; }

.nav__social, .lang { flex: none; }

/* not enough room for the section links next to language, LinkedIn and contact */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .lang { margin-left: auto; }
}

.contact__in { align-self: center; }
.contact__in a { display: block; color: var(--muted); }
.contact__in .icon-in { width: 30px; height: 30px; }
.footer__in { display: inline-flex; }
.footer__in .icon-in { width: 18px; height: 18px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(88px, 14vh, 152px) clamp(72px, 11vh, 120px);
  border-bottom: 1px solid var(--line);
}

/* foggy server-room aisle behind the hero (canvas drawn by script.js) */
.hero__dc,
.hero__fog {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__dc {
  opacity: 0.95;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 52%, #000 70%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 52%, #000 70%);
}
.hero__photo {
  left: auto;
  width: 58%;
  object-fit: cover;
  object-position: 15% center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 40%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 40%);
}
@media (max-width: 720px) {
  .hero__photo { left: 0; width: 100%; -webkit-mask-image: none; mask-image: none; }
}
.hero__fog {
  background:
    linear-gradient(90deg, rgba(22, 24, 29, 0.94) 0%, rgba(22, 24, 29, 0.86) 42%, rgba(22, 24, 29, 0.35) 64%, rgba(22, 24, 29, 0.05) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(22, 24, 29, 0) 28%),
    linear-gradient(180deg, rgba(22, 24, 29, 0.6) 0%, rgba(22, 24, 29, 0) 22%),
    radial-gradient(60% 50% at 68% 46%, rgba(170, 190, 225, 0.12), transparent 70%);
}
@media (max-width: 720px) {
  .hero__dc { opacity: 0.6; }
  .hero__fog { background: linear-gradient(0deg, var(--bg) 0%, rgba(22, 24, 29, 0.55) 35%, rgba(22, 24, 29, 0.6) 100%); }
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero__inner { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
}
.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.hero__title {
  max-width: 16ch;
  margin-top: 28px;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #fff 35%, #aeb3bd 125%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 52ch;
  margin-top: 28px;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
}

.hero__lead + .hero__lead { margin-top: 14px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: clamp(88px, 13vh, 144px); }
.section + .section { border-top: 1px solid var(--line); }
.section:nth-of-type(even) { background: var(--bg-raised); }

.section__label {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section__head { margin-bottom: clamp(40px, 6vh, 64px); }
.section__lead { max-width: 68ch; margin-top: 20px; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }
.section__title {
  max-width: 22ch;
  margin-top: 16px;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* ==========================================================================
   Card + mouse-tracked glowing border
   ========================================================================== */
.card {
  --mx: -999px;
  --my: -999px;
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent-glow), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  z-index: 1;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.045), transparent 60%);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  z-index: -1;
}

[data-glow].is-active .card::before,
[data-glow-self].is-active::before { opacity: 1; }
[data-glow] .card:hover::after,
[data-glow-self]:hover::after { opacity: 1; }

/* ==========================================================================
   About
   ========================================================================== */
.approach__body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  margin-top: 16px;
}
.approach__title {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.approach__text { display: grid; gap: 16px; color: var(--muted); font-size: 1.0625rem; line-height: 1.7; }
.approach__text p:first-child { color: var(--text); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(56px, 8vh, 80px);
}
.stats-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 28px; }
.stat__value {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.12em 0.14em;
  color: var(--accent);
  font-size: clamp(2.5rem, 4.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat__unit { padding-bottom: 0.14em; font-size: 0.5em; letter-spacing: -0.02em; }

/* rotating tile */
.stat--out { animation: stat-out 280ms cubic-bezier(0.4, 0, 1, 1) forwards; }
.stat--in { animation: stat-in 320ms cubic-bezier(0, 0, 0.2, 1); }
@keyframes stat-out { to { transform: perspective(900px) rotateY(90deg); } }
@keyframes stat-in { from { transform: perspective(900px) rotateY(-90deg); } }

/* Flip counter — calendar-style split cards */
.flip--ready {
  position: relative;
  display: inline-block;
  width: calc(var(--d, 1) * 0.62em + 0.36em);
  height: 1.2em;
  border-radius: 0.14em;
  box-shadow: 0 0.06em 0.18em rgba(0, 0, 0, 0.35);
  perspective: 4em;
  letter-spacing: -0.02em;
}
.flip--ready::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: 3;
  height: 1px;
  margin-top: -0.5px;
  background: rgba(0, 0, 0, 0.45);
}
.flip__half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  text-align: center;
  backface-visibility: hidden;
}
.flip__half > span { display: block; height: 1.2em; line-height: 1.2em; }
.flip__half--top { top: 0; border-radius: 0.14em 0.14em 0 0; background: #2c3039; }
.flip__half--bottom { bottom: 0; border-radius: 0 0 0.14em 0.14em; background: #262a32; }
.flip__half--bottom > span { transform: translateY(-50%); }
.flip__leaf { z-index: 2; }
.flip__leaf.flip__half--top { transform-origin: 50% 100%; }
.flip__leaf.flip__half--bottom { transform-origin: 50% 0; transform: rotateX(90deg); }
.is-flipping .flip__leaf.flip__half--top { animation: flip-fold calc(var(--dur) / 2) ease-in forwards; }
.is-flipping .flip__leaf.flip__half--bottom { animation: flip-unfold calc(var(--dur) / 2) ease-out calc(var(--dur) / 2) both; }
@keyframes flip-fold { from { transform: rotateX(0deg); } to { transform: rotateX(-90deg); } }
@keyframes flip-unfold { from { transform: rotateX(90deg); } to { transform: rotateX(0deg); } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.stat__label { margin-top: 12px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.principle { padding: 28px; }
.principle__num { color: var(--dim); font-family: var(--mono); font-size: 12.5px; }
.principle h3 { margin-top: 32px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.principle p { margin-top: 8px; color: var(--muted); font-size: 15px; }

/* ==========================================================================
   Bento
   ========================================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 16px;
}

.tile {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 26px;
  overflow: hidden;
}
.tile--hero { grid-column: span 4; grid-row: span 2; }
.tile--wide { grid-column: span 6; min-height: 0; }
.tile--cfot { grid-column: span 4; }
.tile--cfot .cert__meta { margin-top: 18px; }

.tile__head { display: flex; align-items: center; gap: 12px; }
.tile__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}
.tile__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile__tag {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tile__title { margin-top: auto; padding-top: 28px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; }
.tile__text { margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.tile--hero .tile__title { margin-top: 40px; padding-top: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.035em; }
.tile--hero .tile__text { max-width: 48ch; font-size: 1.0625rem; }
.tile--hero > .tile__title:nth-last-child(2) { margin-top: auto; }

.focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 20px;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.tile--hero .focus { margin-top: 32px; }
.focus li { display: flex; align-items: center; gap: 10px; }
.focus li::before { content: ""; flex: none; width: 4px; height: 4px; border-radius: 1px; background: var(--dim); }

/* Infrastructure & security lifecycle tile */
.tile--sec { padding: 32px; }
.lifecycle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}
.lifecycle li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.lifecycle__n { color: var(--accent); font: 500 11px/1 var(--mono); }
.lifecycle strong { margin-top: 8px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.lifecycle li > span:last-child { color: var(--muted); font-size: 13px; line-height: 1.45; }

.frameworks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.framework:only-child { grid-column: 1 / -1; }
.framework { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.015); }
.framework__std { color: var(--dim); font: 500 11.5px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.framework__lead { margin-top: 8px; font-size: 15px; font-weight: 600; }
.framework__text { margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.framework .chips { margin-top: 14px; }
.stages { margin-top: 14px; counter-reset: stage; }
.stages li {
  counter-increment: stage;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
}
.stages li::before { content: counter(stage, decimal-leading-zero); color: var(--dim); font: 500 11px/1 var(--mono); }

.loop { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }
.loop li {
  position: relative;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
}
.loop li::after { content: "\2192"; position: absolute; right: -17px; color: var(--dim); }
.loop li:last-child::after { content: "\21BA"; }

.tile__note { margin-top: 18px; color: var(--dim); font-size: 13px; }
.tile__more { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.labmap { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.015); }
.labmap table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 14px; }
.labmap th { padding: 8px 12px 8px 0; color: var(--dim); font: 500 11.5px/1.4 var(--mono); text-align: left; text-transform: uppercase; letter-spacing: 0.06em; }
.labmap td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.45; vertical-align: top; }
.labmap td:first-child { color: var(--text); font-weight: 500; }
.labmap td:last-child { color: var(--accent); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 720px) {
  .labmap { padding: 16px; }
  .labmap thead { display: none; }
  .labmap tr { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
  .labmap td { padding: 0; border: 0; }
  .labmap td:last-child { white-space: normal; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chips li {
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  transition: color var(--fast), border-color var(--fast);
}
.chips li:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.chips--lg li { padding: 8px 12px; font-size: 13px; }
.chips .chip--done { border-color: var(--accent); color: var(--text); }
.certpath { display: flex; flex-wrap: wrap; gap: 8px 40px; margin-top: 20px; }
.certpath .chips { margin-top: 8px; }
.certpath__label { color: var(--dim); font: 500 11.5px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }

/* Education bento */
.bento--edu { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile--edu { grid-column: span 2; grid-row: span 2; }
.tile--certs { grid-column: span 2; }
.tile--langs, .tile--skills { grid-column: span 1; }
.bento--edu .tile--langs:last-child { grid-column: span 2; }

.cert__meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; }
.cert__meta dt { color: var(--dim); font: 11.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.cert__meta dd { margin: 2px 0 0; font: 500 14px/1.4 var(--mono); }

.entries { display: grid; margin-top: 12px; }
.entries li { display: grid; gap: 2px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.entries li:last-child { border-bottom: 0; padding-bottom: 0; }
.entries__date { color: var(--dim); font: 12px/1.4 var(--mono); }
.entries strong { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.entries em { color: var(--muted); font-style: normal; font-size: 14px; }

.langs { display: grid; gap: 10px; margin-top: 18px; }
.langs li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.langs em { color: var(--dim); font-style: normal; font-family: var(--mono); font-size: 12.5px; }

/* ==========================================================================
   Lab
   ========================================================================== */
.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}
.case__story { display: grid; gap: 16px; }
.case__block { padding: 24px 28px; color: var(--muted); font-size: 15.5px; }
.rules { display: grid; gap: 10px; }
.rules strong { color: var(--text); font-weight: 600; }
.case__key {
  margin-bottom: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scope { display: grid; gap: 10px; }
.scope > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; }
.scope dt { color: var(--text); font-weight: 500; }
.scope dd { margin: 0; }

.case__note {
  max-width: 72ch;
  margin-top: 24px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
}

/* macOS window */
.window { overflow: hidden; background: #121418; position: sticky; top: 96px; }
.window__bar {
  display: flex;
  align-items: center;
  height: 40px;
  padding-inline: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.window__dots, .window__spacer { display: flex; gap: 7px; width: 60px; }
.window__dots i { width: 11px; height: 11px; border-radius: 50%; background: #34373e; border: 1px solid rgba(255, 255, 255, 0.06); transition: background var(--fast); }
.window:hover .window__dots i:nth-child(1) { background: #ff5f57; }
.window:hover .window__dots i:nth-child(2) { background: #febc2e; }
.window:hover .window__dots i:nth-child(3) { background: #28c840; }
.window__title { flex: 1; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 12px; }

.window__body {
  margin: 0;
  padding: 22px 22px 18px;
  overflow-x: auto;
  color: #c9ccd3;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
}
.window__caption {
  padding: 10px 22px 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font: 12px/1.4 var(--mono);
}
.t-prompt { color: var(--text); font-weight: 500; }
.t-dim { color: var(--dim); }
.t-ok { color: var(--text); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline { position: relative; }
.job {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 32px;
}
.job__date {
  padding-top: 26px;
  color: var(--dim);
  font: 500 13px/1.4 var(--mono);
  text-align: right;
}
.job__body {
  position: relative;
  padding: 24px 0 36px 32px;
  border-left: 1px solid var(--line-strong);
}
.job__body::before {
  content: "";
  position: absolute;
  top: 31px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--text);
}
.job:last-child .job__body { padding-bottom: 0; }

.job__role { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.job__org { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.job__desc { max-width: 68ch; margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.job__tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--dim);
  font: 500 11.5px/1.5 var(--mono);
  vertical-align: 3px;
  letter-spacing: 0;
}

.job--other .job__role { font-size: 1.0625rem; color: var(--muted); }
.job--other .job__body::before { border-color: var(--dim); }

.subjob { margin-top: 24px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.subjob__date { color: var(--dim); font: 12px/1.4 var(--mono); }
.subjob h4 { margin-top: 4px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.subjob .job__desc { margin-top: 6px; }

.job__more { margin-top: 14px; }
.job__more summary, .tile__more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--fast);
}
.job__more summary::-webkit-details-marker, .tile__more summary::-webkit-details-marker { display: none; }
.job__more summary::after, .tile__more summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font: 500 13px/1 var(--mono);
  transition: border-color var(--fast), color var(--fast);
}
.job__more[open] summary::after, .tile__more[open] summary::after { content: "−"; }
.job__more summary:hover, .tile__more summary:hover { color: var(--accent); }
.job__more summary:hover::after, .tile__more summary:hover::after { border-color: var(--accent); color: var(--accent); }
.job__more ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}
.job__more li { display: flex; gap: 10px; }
.job__more li::before { content: ""; flex: none; width: 4px; height: 4px; margin-top: 0.65em; border-radius: 1px; background: var(--dim); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { padding: clamp(40px, 7vw, 88px); overflow: hidden; text-align: center; }
.contact__title {
  max-width: 18ch;
  margin: 20px auto 0;
  font-size: clamp(2rem, 4.8vw, 3.75rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.contact__lead { max-width: 46ch; margin: 20px auto 0; color: var(--muted); font-size: 1.0625rem; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }

.contact__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 40px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.contact__list li { display: grid; gap: 2px; }
.contact__list span { color: var(--dim); font: 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.contact__list a { transition: color var(--fast); }
.contact__list a:hover { color: var(--accent); }

.copy { font-family: var(--mono); font-size: 14px; }
.copy__icon { width: 16px; height: 16px; color: var(--muted); }
.copy.is-copied { border-color: var(--accent); }
.copy.is-copied .copy__icon { color: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding-block: 32px; color: var(--dim); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer__links { display: flex; gap: 20px; }
.footer__links a { transition: color var(--fast); }
.footer__links a:hover { color: var(--text); }

/* ==========================================================================
   Reveal (fast, short travel)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(8px); transition: opacity 360ms ease, transform 360ms cubic-bezier(0.2, 0, 0, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { grid-column: span 1; }
  .tile--hero, .tile--wide, .tile--cfot { grid-column: span 2; grid-row: auto; }
  .focus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lifecycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frameworks { grid-template-columns: 1fr; }

  .bento--edu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--edu, .tile--certs { grid-column: span 2; grid-row: auto; }
  .tile--langs, .tile--skills { grid-column: span 1; }

  .case { grid-template-columns: 1fr; }
  .window { position: relative; top: 0; }

  .approach__body { grid-template-columns: 1fr; }

  .job { grid-template-columns: 1fr; gap: 0; }
  .job__date { padding: 0 0 0 32px; border-left: 1px solid var(--line-strong); text-align: left; padding-top: 24px; }
  .job__body { padding-top: 6px; }
  .job__body::before { top: -14px; }
}

@media (max-width: 720px) {
  .container { padding-inline: 20px; }
  .nav__links { display: none; }
  .nav__inner { gap: 12px; }
  .lang { margin-left: auto; }
  .brand { font-size: 17px; gap: 10px; }
  .brand__mark { width: 34px; height: 34px; font-size: 14px; }

  .stats-row, .principles { grid-template-columns: 1fr; }
  .principle h3 { margin-top: 20px; }

  .bento, .bento--edu { grid-template-columns: 1fr; }
  .tile, .tile--hero, .tile--wide, .tile--cfot, .tile--edu, .tile--certs, .tile--langs, .tile--skills { grid-column: auto; min-height: 0; }
  .focus { grid-template-columns: 1fr; }
  .tile--sec { padding: 22px; }
  .bento--edu .tile--langs:last-child { grid-column: auto; }
  .lifecycle li { padding: 14px; }

  .job__more ul { grid-template-columns: 1fr; }
  .scope > div { grid-template-columns: 1fr; gap: 0; }
  .subjob { padding: 16px; }
  .window__body { font-size: 12px; padding: 18px 16px; }
}

@media (max-width: 440px) {
  .nav__inner > .btn { display: none; }
}

/* ==========================================================================
   Experience notebook (desktop) — built by script.js from the timeline
   ========================================================================== */
.book-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.book {
  --pw: 520px;
  --ph: 720px;
  --turn: 700ms;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  position: relative;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  perspective: 2800px;
  outline: none;
}
.book:focus-visible { outline: 2px solid var(--accent); outline-offset: 16px; border-radius: 12px; }

/* floor shadow */
.book::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -34px;
  width: calc(var(--pw) * 0.9);
  height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
  transition: width var(--turn) cubic-bezier(0.3, 0.1, 0.2, 1);
}
.book.is-open::before { width: calc(var(--pw) * 1.9); }

.book__stack {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translateX(calc(var(--pw) * -0.5));
  transition: transform var(--turn) cubic-bezier(0.3, 0.1, 0.2, 1);
}
.book.is-open .book__stack { transform: translateX(0); }

.leaf,
.book__base {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
}
.leaf {
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform var(--turn) cubic-bezier(0.35, 0.1, 0.2, 1);
  cursor: pointer;
}
.leaf__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.leaf__back { transform: rotateY(180deg); }

/* spiral binding — rings sit above the pages, holes are punched into each page */
.spiral {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  transform: translateZ(12px);
  pointer-events: none;
}
.spiral i {
  position: absolute;
  left: -18px;
  width: 36px;
  height: 7px;
  border-radius: 4px;
  background:
    radial-gradient(3px 2px at 30% 60%, rgba(140, 70, 25, 0.55), transparent),
    radial-gradient(4px 3px at 72% 40%, rgba(120, 60, 20, 0.45), transparent),
    linear-gradient(90deg, #4a463f, #bdb8ae 40%, #8d877c 60%, #4a463f);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.45);
}

/* ---- paper ---- */
.bpage {
  /* ink-on-paper palette, scoped to the notebook */
  --text: #2a2a2c;
  --muted: #55534f;
  --dim: #85807a;
  --line: rgba(40, 55, 80, 0.16);
  --line-strong: rgba(40, 55, 80, 0.26);
  --hole: radial-gradient(circle at var(--hole-x) 50%, #15171b 0 4px, rgba(0, 0, 0, 0.25) 4.6px, transparent 5.4px);
  --grid: rgba(70, 110, 170, 0.085);
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    var(--hole) 0 0 / 100% 30px repeat-y,
    var(--age, none),
    var(--noise),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px,
    #e8dbbd;
  /* years of yellowing: browned edges, darker rim */
  box-shadow:
    inset 0 0 0 1px rgba(110, 75, 30, 0.28),
    inset 0 0 6px rgba(120, 80, 30, 0.35),
    inset 0 0 70px rgba(135, 92, 40, 0.34);
}
.leaf__front.bpage,
.book__base.bpage {
  --hole-x: 15px;
  padding: 36px 40px 28px 52px;
  border-radius: 2px 9px 11px 2px;
}
.leaf__back.bpage {
  --hole-x: calc(100% - 15px);
  padding: 36px 52px 28px 40px;
  border-radius: 9px 2px 2px 11px;
}
/* gutter shade near the spiral */
.leaf__front.bpage::before,
.leaf__back.bpage::before,
.book__base.bpage::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 46px;
  pointer-events: none;
}
.leaf__front.bpage::before,
.book__base.bpage::before { left: 0; background: linear-gradient(90deg, rgba(60, 40, 15, 0.22), transparent); }
.leaf__back.bpage::before { right: 0; background: linear-gradient(270deg, rgba(60, 40, 15, 0.22), transparent); }

/* page edges of the remaining block on the right */
.book__base { box-shadow: 2px 1px 0 #d6c7a4, 4px 2px 0 #c9b791, 6px 3px 0 #d1c09b; }

.bpage__run {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--dim);
  font: 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bpage__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 4px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.bpage__date { color: var(--dim); font: 500 13px/1.4 var(--mono); }
.bpage__org { margin-top: 14px; color: var(--muted); font-size: 14px; }
.bpage__role { margin-top: 4px; font-size: 1.55rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; }
.bpage__desc { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.bpage__label {
  margin-top: 22px;
  color: var(--text);
  font: 600 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bpage__list { display: grid; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.bpage__list li { display: flex; gap: 10px; }
.bpage__list li::before { content: ""; flex: none; width: 4px; height: 4px; margin-top: 0.62em; border-radius: 1px; background: var(--dim); }

/* long pages: tighter type first, then a fade hinting that the page scrolls */
.bpage.is-dense .bpage__desc { font-size: 12.5px; line-height: 1.5; }
.bpage.is-dense .bpage__list { gap: 2px; font-size: 12.5px; line-height: 1.4; }
.bpage.is-dense .bpage__role { font-size: 1.3rem; }
.bpage.is-scroll .bpage__body {
  -webkit-mask-image: linear-gradient(#000 85%, transparent);
  mask-image: linear-gradient(#000 85%, transparent);
}

.bpage__num {
  position: relative;
  padding-top: 12px;
  color: var(--dim);
  font: 11px/1 var(--mono);
  text-align: center;
}

/* contents page */
.toc { display: grid; margin-top: 4px; }
.toc button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 16px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.toc button:last-child { border-bottom: 0; }
.toc__role { font-size: 14px; font-weight: 600; line-height: 1.35; transition: color var(--fast); }
.toc__meta { grid-column: 1; overflow: hidden; color: var(--dim); font: 11px/1.4 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.toc__num { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--dim); font: 12px/1 var(--mono); }
.toc button:hover .toc__role,
.toc button:focus-visible .toc__role { color: #2f55c8; }

/* ---- handwritten notes ---- */
.scribbles {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 4px 0;
  overflow: hidden;
  pointer-events: none;
}
.note {
  max-width: 100%;
  color: var(--ink, #23408e);
  font: 400 var(--size, 22px)/1.15 var(--hand);
  white-space: nowrap;
  transform: translateX(var(--x, 0)) rotate(var(--r, 0deg));
  transform-origin: left center;
  opacity: 0.82;
}
.note--pencil { --ink: #6a6862; opacity: 0.62; }
.note--black { --ink: #24262a; }
.note--red { --ink: #a3372c; }
.note--u { padding-bottom: 1px; border-bottom: 2px solid currentColor; border-radius: 0 0 40% 60% / 0 0 6px 4px; }
.note--box { padding: 0 8px; border: 1.6px solid currentColor; border-radius: 46% 54% 50% 48% / 60% 48% 52% 40%; }
.note--list { display: grid; gap: 2px; white-space: nowrap; }
.note svg { display: block; width: 250px; height: auto; }
.note svg text { font: 600 16px var(--hand); fill: currentColor; stroke: none; }

/* coffee ring */
.stain {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: multiply;
  transform: rotate(var(--r, 0deg)) scale(var(--s, 1));
  background:
    radial-gradient(circle at 50% 50%, rgba(150, 98, 45, 0.1) 0 50%, rgba(120, 72, 30, 0.34) 55%, rgba(140, 90, 40, 0.15) 58%, transparent 62%),
    radial-gradient(circle at 46% 54%, transparent 55%, rgba(120, 72, 30, 0.2) 58%, transparent 63%);
}
.stain::after {
  content: "";
  position: absolute;
  inset: -26px;
  background:
    radial-gradient(circle at 8% 86%, rgba(120, 72, 30, 0.38) 0 3px, transparent 3.6px),
    radial-gradient(circle at 14% 94%, rgba(120, 72, 30, 0.3) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 96% 22%, rgba(120, 72, 30, 0.32) 0 2.4px, transparent 3px),
    radial-gradient(circle at 88% 8%, rgba(120, 72, 30, 0.22) 0 4px, transparent 4.8px);
}

/* ---- cover: worn black notebook with a paper label ---- */
.cover {
  --hole-x: 15px;
  display: flex;
  flex-direction: column;
  padding: 48px 44px 40px 60px;
  border-radius: 3px 12px 14px 3px;
  background:
    radial-gradient(circle at var(--hole-x) 50%, #0f1013 0 4px, rgba(255, 255, 255, 0.08) 4.6px, transparent 5.4px) 0 0 / 100% 30px repeat-y,
    radial-gradient(120px 90px at 100% 0, rgba(255, 255, 255, 0.07), transparent),
    radial-gradient(140px 110px at 100% 100%, rgba(255, 255, 255, 0.06), transparent),
    radial-gradient(260px 120px at 30% 80%, rgba(255, 255, 255, 0.025), transparent),
    /* scuffed corners and rubbed spots */
    radial-gradient(70px 60px at 100% 0, rgba(200, 190, 170, 0.12), transparent),
    radial-gradient(80px 70px at 100% 100%, rgba(200, 190, 170, 0.13), transparent),
    radial-gradient(180px 90px at 70% 55%, rgba(255, 255, 255, 0.035), transparent),
    /* fine scratches */
    linear-gradient(117deg, transparent 22%, rgba(255, 255, 255, 0.05) 22.1%, transparent 22.3%),
    linear-gradient(124deg, transparent 47%, rgba(255, 255, 255, 0.035) 47.1%, transparent 47.25%),
    linear-gradient(28deg, transparent 71%, rgba(255, 255, 255, 0.04) 71.1%, transparent 71.3%),
    linear-gradient(35deg, transparent 33%, rgba(255, 255, 255, 0.025) 33.1%, transparent 33.2%),
    /* a long crease across the cover */
    linear-gradient(101deg, transparent 61.6%, rgba(0, 0, 0, 0.35) 61.8%, rgba(255, 255, 255, 0.07) 62.1%, transparent 62.5%),
    var(--noise),
    linear-gradient(160deg, #2e2f33, #1c1d20);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 0 0 3px rgba(190, 180, 160, 0.05),
    inset 0 0 40px rgba(0, 0, 0, 0.55);
}
/* dog-eared bottom corner */
.cover::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(315deg, #d9c9a4 0 50%, #3d3a35 50%, #2a2926 100%);
  box-shadow: -3px -3px 6px rgba(0, 0, 0, 0.35);
  border-top-left-radius: 4px;
  pointer-events: none;
}
.cover__label {
  align-self: flex-start;
  margin-top: 90px;
  padding: 18px 26px 16px;
  border-radius: 3px;
  position: relative;
  background:
    radial-gradient(5px 5px at 82% 30%, rgba(130, 85, 35, 0.3), transparent),
    radial-gradient(3px 3px at 12% 70%, rgba(130, 85, 35, 0.3), transparent),
    var(--noise), #e0d0aa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 0 22px rgba(125, 82, 32, 0.38);
  color: #26314d;
  transform: rotate(-2deg);
}
/* old yellowed tape holding the label */
.cover__label::before,
.cover__label::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 54px;
  height: 20px;
  background: rgba(214, 190, 130, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.cover__label::before { left: -14px; transform: rotate(-28deg); }
.cover__label::after { right: -16px; transform: rotate(22deg); }
.cover__title { font: 600 3.4rem/1 var(--hand); letter-spacing: 0; }
.cover__years { margin-top: 6px; font: 500 1.5rem/1 var(--hand); color: #4f5872; }
/* photo clipped to the cover */
.cover__photo {
  position: absolute;
  top: 300px;
  right: 58px;
  margin: 0;
  padding: 9px 9px 30px;
  background: var(--noise), #eee8dc;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 0 14px rgba(120, 88, 45, 0.15);
  transform: rotate(4deg);
}
.cover__photo img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.03) sepia(0.12);
}
.cover__photo figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  color: #1f2a44;
  font: 600 20px/1 var(--hand);
  text-align: center;
  transform: rotate(-2deg);
}
/* paperclip */
.cover__photo::before,
.cover__photo::after {
  content: "";
  position: absolute;
  border: 2px solid #b9bdc4;
  border-radius: 8px;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.35);
}
.cover__photo::before { top: -18px; left: 26px; width: 14px; height: 52px; }
.cover__photo::after { top: -10px; left: 30px; width: 6px; height: 36px; border-color: #a7abb3; }

.cover__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.06);
}
.cover__brand span { color: var(--accent); font: 600 14px/1 var(--mono); }
.cover__author { margin-top: 8px; color: rgba(255, 255, 255, 0.4); font-size: 13px; }

/* controls */
.book__hint { color: var(--dim); font: 12.5px/1.4 var(--mono); letter-spacing: 0.04em; }
.book__controls { display: flex; align-items: center; gap: 12px; }
.book__pager { min-width: 150px; color: var(--muted); font: 13px/1.4 var(--mono); text-align: center; }
.book__btn:disabled { opacity: 0.35; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .book { --turn: 1ms; }
}

/* Notebook on wide screens only; the timeline stays on smaller ones */
@media (min-width: 1100px) {
  .has-book > .timeline { display: none; }
}
@media (max-width: 1099px) {
  .book-wrap { display: none; }
}
