:root {
  --bg: #f3f4f7;
  --bg-deep: #e2e5ee;
  --ink: #0d1220;
  --ink-soft: #2b3346;
  --muted: #5c6579;
  --line: rgba(13, 18, 32, 0.16);
  --brand: #4059e0;
  --brand-deep: #2f45bf;
  --brand-wash: rgba(64, 89, 224, 0.12);
  --surface: rgba(250, 251, 253, 0.9);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  --max: 1120px;
  --gutter: clamp(1.25rem, 3.2vw, 3.5rem);
  --header-h: 4.5rem;
  --text: 1rem;
}

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

html {
  scroll-behavior: smooth;
  /* Keeps UI readable on large / 4K CSS viewports without phone-scale type */
  font-size: clamp(16px, 0.22vw + 14.5px, 20px);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(170deg, rgba(234, 237, 246, 0.9), rgba(214, 219, 233, 0.75)),
    radial-gradient(circle at 18% 6%, rgba(150, 165, 224, 0.4), transparent 42%),
    radial-gradient(circle at 84% 15%, rgba(108, 124, 196, 0.36), transparent 46%),
    var(--bg);
  font-family: var(--sans);
  font-size: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.site-shell {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(242, 244, 241, 0.82);
  border-bottom: 1px solid rgba(15, 23, 18, 0.08);
}

.site-header-inner {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand span {
  color: var(--brand);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}

.site-nav a {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--brand);
  border-color: var(--brand);
}

.hero-home {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
  background: #12151c;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 18%;
  filter: brightness(1.18) contrast(1.06) saturate(1.03);
  transform: scale(1.04);
  transform-origin: center center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .hero-photo {
  opacity: 0;
  transform: scale(1.08);
}

body.ready .hero-photo {
  opacity: 1;
  transform: scale(1.04);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 12, 18, 0.72) 0%, rgba(10, 12, 18, 0.42) 34%, rgba(10, 12, 18, 0.08) 62%, rgba(10, 12, 18, 0.12) 100%),
    linear-gradient(180deg, rgba(10, 12, 18, 0.18) 0%, rgba(10, 12, 18, 0.05) 45%, rgba(10, 12, 18, 0.58) 100%);
}

.hero-layout {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  width: 100%;
  min-height: calc(100svh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  padding: clamp(1.5rem, 4vh, 2.75rem) 0 clamp(2.75rem, 9vh, 5.5rem);
}

.hero-content {
  width: min(42rem, 100%);
  margin: 0;
  color: #f4f6fb;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .hero-content {
  opacity: 0;
  transform: translateY(24px);
}

body.ready .hero-content {
  opacity: 1;
  transform: none;
}

.hero-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.85rem, 7.2vw + 0.5rem, 6.4rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.hero-headline {
  margin: 1.35rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 1.6vw + 0.85rem, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero-support {
  margin: 1.1rem 0 0;
  max-width: 52ch;
  color: rgba(244, 246, 251, 0.9);
  font-size: clamp(1.05rem, 0.35vw + 0.95rem, 1.2rem);
  line-height: 1.55;
}

.cta-row {
  margin: 1.9rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 2.85rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: #f5faf7;
  border: 1px solid var(--brand);
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.btn-ghost {
  border: 1px solid rgba(15, 23, 18, 0.28);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--brand-wash);
  border-color: var(--brand);
}

.hero-home .btn {
  min-height: 2.9rem;
  padding: 0.7rem 1.2rem;
  letter-spacing: 0.07em;
  font-size: 0.9rem;
}

.hero-home .btn-primary {
  background: #eaeef8;
  color: var(--ink);
  border-color: #eaeef8;
}

.hero-home .btn-primary:hover {
  background: #fff;
  border-color: #fff;
}

.hero-home .btn-ghost {
  border-color: rgba(244, 246, 251, 0.62);
  color: #f4f6fb;
}

.hero-home .btn-ghost:hover {
  background: rgba(244, 246, 251, 0.12);
}

.contact-panel {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.contact-panel a:not(.btn) {
  color: var(--brand);
  font-weight: 500;
}

.social-row {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.social-row a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.social-row a:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.site-footer .social-row {
  width: 100%;
}

.section {
  padding: clamp(2.25rem, 6vw, 4rem) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.section-title {
  margin: 0.45rem 0 0.8rem;
  max-width: 28ch;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.section-lead {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.beliefs {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.05rem;
}

.beliefs li {
  border-top: 1px solid var(--line);
  padding-top: 1.05rem;
}

.beliefs h3,
.list-rows h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.1rem;
}

.beliefs p,
.list-rows p,
.essay p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.list-rows {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.list-rows li {
  border-bottom: 1px solid var(--line);
}

.list-rows a {
  display: block;
  text-decoration: none;
  padding: 1.2rem 0;
  transition: padding-left 0.2s ease, background 0.2s ease;
}

.list-rows a:hover {
  padding-left: 0.85rem;
  background: var(--brand-wash);
}

.list-meta {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.inview {
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .inview {
  opacity: 0;
  transform: translateY(16px);
}

.inview.visible {
  opacity: 1;
  transform: none;
}

.page-hero {
  padding: clamp(2.3rem, 7vw, 4.5rem) 0 1.35rem;
}

.page-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 4.1rem);
  letter-spacing: -0.03em;
  line-height: 0.96;
}

.page-hero p {
  max-width: 64ch;
  color: var(--ink-soft);
}

.essay {
  max-width: 70ch;
  padding: 1.2rem 0 4rem;
}

.essay h2 {
  margin: 2.1rem 0 0.6rem;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: -0.015em;
}

.essay ul {
  margin: 0.8rem 0;
  padding-left: 1.2rem;
}

.essay li {
  margin: 0.45rem 0;
  color: var(--ink-soft);
}

.case {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.case h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
}

.case dl {
  margin: 0.8rem 0 0;
}

.case dt {
  margin: 0.7rem 0 0.2rem;
  font-family: var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--brand);
}

.case dd {
  margin: 0;
  color: var(--ink-soft);
}

.cv-sheet {
  margin: 2rem auto 3rem;
  padding: clamp(1.35rem, 4vw, 2.7rem);
  border: 1px solid rgba(15, 23, 18, 0.09);
  background: var(--surface);
}

.cv-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 0.9;
}

.cv-role {
  margin: 0.7rem 0 0;
  font-size: clamp(1rem, 3vw, 1.35rem);
  color: var(--ink-soft);
}

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

.cv-grid div {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.cv-grid h3 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 1.08rem;
}

.cv-grid p,
.cv-grid li {
  margin: 0;
  color: var(--ink-soft);
}

.cv-grid ul {
  margin: 0;
  padding-left: 1.05rem;
}

.cv-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding: 1.2rem 0 2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 1280px) {
  :root {
    --max: 1240px;
    --header-h: 4.75rem;
  }

  .hero-content {
    width: min(46rem, 100%);
  }

  .hero-photo {
    object-position: 58% 16%;
  }
}

@media (min-width: 1600px) {
  :root {
    --max: 1360px;
  }

  .hero-content {
    width: min(50rem, 52%);
  }

  .hero-name {
    font-size: clamp(4.5rem, 5.2vw, 7rem);
  }

  .site-nav {
    gap: 1.35rem;
  }
}

@media (min-width: 1920px) {
  :root {
    --max: 1480px;
  }

  .hero-scrim {
    background:
      linear-gradient(90deg, rgba(10, 12, 18, 0.78) 0%, rgba(10, 12, 18, 0.4) 30%, rgba(10, 12, 18, 0.08) 58%, rgba(10, 12, 18, 0.14) 100%),
      linear-gradient(180deg, rgba(10, 12, 18, 0.16) 0%, rgba(10, 12, 18, 0.04) 42%, rgba(10, 12, 18, 0.62) 100%);
  }
}

@media (max-width: 760px) {
  html {
    font-size: 16px;
  }

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

  .hero-home {
    min-height: min(92svh, 860px);
    min-height: min(92dvh, 860px);
  }

  .hero-layout {
    min-height: min(92svh, 860px);
    min-height: min(92dvh, 860px);
    padding-bottom: 1.75rem;
  }

  .hero-photo {
    object-position: 55% 12%;
  }

  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(10, 12, 18, 0.12) 0%, rgba(10, 12, 18, 0.08) 38%, rgba(10, 12, 18, 0.7) 100%),
      linear-gradient(90deg, rgba(10, 12, 18, 0.35) 0%, rgba(10, 12, 18, 0.1) 100%);
  }

  .site-nav {
    gap: 0.65rem;
  }

  .site-nav a {
    letter-spacing: 0.08em;
  }

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

@media print {
  @page {
    size: A4;
    margin: 11mm;
  }

  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 9pt;
  }

  .site-shell {
    width: 100%;
  }

  .cv-sheet {
    margin: 0;
    border: none;
    background: #fff;
    padding: 0;
  }

  .cv-name {
    font-size: 26pt;
  }

  .cv-role {
    font-size: 12pt;
  }
}

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

  .js .hero-content,
  .js .hero-photo,
  .js .inview {
    opacity: 1;
    transform: none;
  }
}
