:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-strong: #fffaf0;
  --ink: #15171c;
  --muted: #62656d;
  --line: #d9d1c3;
  --line-strong: #b9ad9e;
  --rail: #171a22;
  --rail-soft: #232733;
  --blue: #2864d8;
  --coral: #e85d4a;
  --gold: #d8992b;
  --mint: #2f9f84;
  --shadow: 0 24px 60px rgba(41, 36, 27, 0.14);
  --max: 1180px;
  --rail-width: 19rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(21, 23, 28, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 23, 28, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body::selection {
  background: rgba(40, 100, 216, 0.2);
}

img {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  max-width: 9ch;
  font-size: clamp(3.8rem, 8vw, 7.7rem);
  font-weight: 700;
}

h2 {
  max-width: 880px;
  font-size: clamp(2.25rem, 5vw, 5rem);
  font-weight: 700;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--rail-width);
  right: 0;
  z-index: 30;
  height: 4px;
  background: rgba(21, 23, 28, 0.08);
}

.scroll-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--coral), var(--gold));
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 40;
  transform: translateY(-160%);
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 6px;
  background: var(--rail);
  color: var(--paper-strong);
  padding: 0.65rem 0.9rem;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

body.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 620ms ease, transform 620ms ease;
}

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

.nav-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: grid;
  width: var(--rail-width);
  grid-template-rows: auto 1fr auto;
  gap: 2.5rem;
  border-right: 1px solid rgba(255, 250, 240, 0.12);
  background:
    linear-gradient(180deg, rgba(40, 100, 216, 0.16), transparent 42%),
    var(--rail);
  color: var(--paper-strong);
  padding: 1.25rem;
}

.brand {
  display: grid;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--rail);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-text {
  max-width: 12rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.05;
}

.site-nav {
  display: grid;
  align-content: center;
  gap: 0.45rem;
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.15rem;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.72rem 0.78rem;
  color: rgba(255, 250, 240, 0.72);
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.site-nav a span,
.section-kicker,
.card-label,
.project-status span,
.tags span,
.profile-points span,
.stack-list span,
.rail-note span {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0;
}

.site-nav a span {
  color: rgba(255, 250, 240, 0.42);
  font-size: 0.78rem;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(255, 250, 240, 0.08);
  color: var(--paper-strong);
  transform: translateX(3px);
  outline: 0;
}

.site-nav a.is-active span {
  color: var(--gold);
}

.rail-note {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.07);
  padding: 0.95rem;
}

.rail-note span {
  color: rgba(255, 250, 240, 0.56);
  font-size: 0.74rem;
}

.rail-note strong {
  font-size: 0.94rem;
  line-height: 1.25;
}

.page-shell {
  width: calc(100% - var(--rail-width));
  margin-left: var(--rail-width);
}

.hero {
  display: grid;
  min-height: 92svh;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.62fr);
  align-items: end;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(2rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
}

.hero-copyblock {
  padding-bottom: clamp(0.5rem, 3vw, 2.5rem);
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.9rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 650px;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.65rem;
}

.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  line-height: 1.1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

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

.button-primary {
  background: var(--ink);
  color: var(--paper-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 250, 240, 0.6);
  color: var(--ink);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--ink);
}

.profile-dossier {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.dossier-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--ink);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 14px 14px 0 var(--blue);
}

.dossier-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.dossier-card.dark {
  background: var(--rail);
  color: var(--paper-strong);
}

.card-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dossier-card.dark .card-label {
  color: var(--gold);
}

.dossier-card strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.2;
}

.dossier-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.dossier-card.dark p {
  color: rgba(255, 250, 240, 0.64);
}

.section {
  width: min(100% - clamp(2rem, 8vw, 7rem), var(--max));
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 0;
  border-bottom: 1px solid var(--line);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(310px, 0.65fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.section-heading.compact {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(260px, 0.42fr);
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.6rem;
}

.section-heading p,
.profile-copy p,
.project-card p,
.project-card li,
.workflow-board p,
.contact-copy {
  color: var(--muted);
}

.section-heading p,
.profile-copy p,
.contact-copy {
  margin: 0;
  font-size: 1.04rem;
}

.profile-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.profile-points span,
.tags span,
.project-status span,
.stack-list span {
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-points span {
  border: 1px solid var(--line-strong);
  background: var(--paper-strong);
  padding: 0.42rem 0.65rem;
  color: var(--ink);
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-strong);
  overflow: hidden;
}

.workflow-board article {
  min-height: 15rem;
  border-right: 1px solid var(--line);
  padding: 1.1rem;
  transition: background 160ms ease;
}

.workflow-board article:last-child {
  border-right: 0;
}

.workflow-board article:hover {
  background: #f8f3e7;
}

.workflow-board article span {
  display: inline-flex;
  margin-bottom: 3.8rem;
  color: var(--coral);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

.workflow-board p {
  margin: 0.7rem 0 0;
  font-size: 0.96rem;
}

.project-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
}

.project-card,
.stack-panel {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-strong);
}

.project-card {
  display: grid;
  align-content: start;
  padding: clamp(1.2rem, 3vw, 2rem);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-card.featured {
  background:
    linear-gradient(135deg, rgba(40, 100, 216, 0.12), transparent 44%),
    var(--paper-strong);
}

.project-card h3 {
  margin-top: 1.1rem;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.project-card p {
  margin: 0.85rem 0 0;
}

.project-card ul {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
}

.project-status,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-status span {
  border: 1px solid rgba(232, 93, 74, 0.32);
  background: rgba(232, 93, 74, 0.08);
  padding: 0.28rem 0.55rem;
  color: #9d3025;
}

.tags {
  margin-top: 1.25rem;
}

.tags span {
  border: 1px solid rgba(40, 100, 216, 0.26);
  background: rgba(40, 100, 216, 0.08);
  padding: 0.35rem 0.6rem;
  color: #214c9b;
}

.stack-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1.48fr);
  grid-template-areas:
    "heading tools"
    "heading credentials";
  gap: 1rem 1.25rem;
  align-items: stretch;
}

.stack-layout .section-heading {
  grid-area: heading;
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

.stack-layout .section-heading h2 {
  max-width: 8ch;
  font-size: clamp(2.8rem, 5.5vw, 5.4rem);
  line-height: 0.95;
}

.stack-layout .tools-panel {
  grid-area: tools;
}

.stack-layout .credentials {
  grid-area: credentials;
}

.stack-panel {
  padding: clamp(1.2rem, 3vw, 1.8rem);
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.stack-list span {
  border: 1px solid rgba(47, 159, 132, 0.28);
  background: rgba(47, 159, 132, 0.08);
  padding: 0.52rem 0.65rem;
  color: #1c6d59;
}

.credential-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.credential-list li {
  display: grid;
  gap: 0.15rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
}

.credential-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.credential-list strong {
  line-height: 1.22;
}

.credential-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (min-width: 1440px) {
  .stack-layout {
    grid-template-columns: minmax(22rem, 0.72fr) minmax(280px, 0.58fr) minmax(360px, 0.9fr);
    grid-template-areas: "heading tools credentials";
  }

  .stack-layout .credentials {
    min-height: 100%;
  }
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  width: min(100% - clamp(2rem, 8vw, 7rem), var(--max));
  margin: clamp(3rem, 7vw, 5rem) auto;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--rail);
  color: var(--paper-strong);
  padding: clamp(1.4rem, 4vw, 2.6rem);
}

.contact-section .section-kicker {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--gold);
}

.contact-section h2 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4rem);
}

.contact-copy {
  max-width: 720px;
  margin: 1rem 0 0;
  color: rgba(255, 250, 240, 0.66);
}

.contact-section .button-primary {
  background: var(--paper-strong);
  color: var(--rail);
}

.contact-section .button-secondary {
  border-color: rgba(255, 250, 240, 0.24);
  background: rgba(255, 250, 240, 0.08);
  color: var(--paper-strong);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1080px) {
  :root {
    --rail-width: 5.4rem;
  }

  .nav-rail {
    align-items: center;
    padding: 1rem 0.7rem;
  }

  .brand-text,
  .rail-note,
  .site-nav a {
    font-size: 0;
  }

  .site-nav a {
    justify-content: center;
    width: 3.5rem;
    min-height: 3.5rem;
    padding: 0;
  }

  .site-nav a span {
    font-size: 0.78rem;
  }

  .site-nav a:hover,
  .site-nav a:focus-visible,
  .site-nav a.is-active {
    transform: none;
  }

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

  .hero,
  .stack-layout {
    grid-template-columns: 1fr;
  }

  .stack-layout {
    grid-template-areas:
      "heading"
      "tools"
      "credentials";
  }

  .stack-layout .section-heading {
    position: static;
  }

  .stack-layout .section-heading h2 {
    max-width: 10ch;
  }
}

@media (max-width: 780px) {
  html {
    scroll-padding-top: 1rem;
    scroll-padding-bottom: 6rem;
  }

  .scroll-progress {
    left: 0;
  }

  .nav-rail {
    position: fixed;
    inset: auto 0 0 0;
    width: auto;
    height: 4.8rem;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    border-top: 1px solid rgba(255, 250, 240, 0.14);
    border-right: 0;
    padding: 0.55rem;
  }

  .brand,
  .rail-note {
    display: none;
  }

  .site-nav {
    grid-template-columns: repeat(4, 1fr);
    align-content: stretch;
    gap: 0.35rem;
  }

  .site-nav a {
    width: auto;
    min-height: 3.6rem;
  }

  .page-shell {
    width: 100%;
    margin-left: 0;
    padding-bottom: 4.8rem;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 3.5rem 1rem 2.8rem;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 5.7rem);
  }

  .dossier-photo {
    aspect-ratio: 16 / 11;
    box-shadow: 8px 8px 0 var(--blue);
  }

  .section,
  .contact-section {
    width: min(100% - 2rem, var(--max));
  }

  .two-column,
  .section-heading.compact,
  .project-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .workflow-board {
    grid-template-columns: 1fr 1fr;
  }

  .workflow-board article:nth-child(2) {
    border-right: 0;
  }

  .workflow-board article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .workflow-board {
    grid-template-columns: 1fr;
  }

  .workflow-board article,
  .workflow-board article:nth-child(2) {
    border-right: 0;
  }

  .workflow-board article:nth-child(3) {
    border-bottom: 1px solid var(--line);
  }

  .workflow-board article span {
    margin-bottom: 2rem;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  body.js .reveal {
    opacity: 1;
    transform: none;
  }
}
