:root {
  color-scheme: light;
  --ink: #1a211f;
  --muted: #65706c;
  --paper: #f4eee1;
  --panel: #fffaf0;
  --panel-rgb: 255, 250, 240;
  --night: #101615;
  --night-soft: #18211f;
  --line: rgba(26, 33, 31, 0.14);
  --line-strong: rgba(26, 33, 31, 0.28);
  --gold: #d89b35;
  --gold-dark: #9a6421;
  --red: #a84b3f;
  --green: #496f55;
  --blue: #2d6f78;
  --intro-text: #37423f;
  --header-scrolled: rgba(244, 238, 225, 0.95);
  --tag-bg: rgba(45, 111, 120, 0.13);
  --tag-text: #164b52;
  --shadow: 0 18px 48px rgba(20, 26, 24, 0.16);
  --max-width: 1160px;
  font-family: Arial, Helvetica, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f6efe3;
  --muted: #b8c0bb;
  --paper: #0e1413;
  --panel: #17201d;
  --panel-rgb: 23, 32, 29;
  --night: #070b0b;
  --night-soft: #101918;
  --line: rgba(246, 239, 227, 0.13);
  --line-strong: rgba(246, 239, 227, 0.28);
  --gold: #e6aa43;
  --gold-dark: #f2c56f;
  --red: #d17667;
  --green: #8fb284;
  --blue: #62a7b0;
  --intro-text: #dce3dd;
  --header-scrolled: rgba(14, 20, 19, 0.94);
  --tag-bg: rgba(98, 167, 176, 0.18);
  --tag-text: #a9dce2;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-140%);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 54px);
  color: var(--panel);
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background: var(--header-scrolled);
  color: var(--ink);
  box-shadow: 0 8px 28px rgba(26, 33, 31, 0.1);
  backdrop-filter: blur(14px);
}

.brand,
.site-nav,
.header-actions,
.hero-actions,
.site-footer,
.connect-section {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.78rem;
}

.site-nav {
  gap: clamp(12px, 3vw, 28px);
  font-size: 0.92rem;
  font-weight: 700;
}

.header-actions {
  gap: clamp(14px, 3vw, 28px);
}

.site-nav a {
  text-decoration: none;
  opacity: 0.86;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  opacity: 1;
}

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.08);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 12px;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: rgba(216, 155, 53, 0.16);
}

.theme-toggle-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
}

:root[data-theme="dark"] .theme-toggle-icon {
  background: transparent;
  box-shadow: inset -4px -2px 0 0 currentColor;
}

.hero {
  position: relative;
  min-height: 78svh;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 100px clamp(20px, 6vw, 76px) 32px;
  background: var(--night);
  color: var(--panel);
}

#quest-canvas,
.hero-shade {
  position: absolute;
  inset: 0;
}

#quest-canvas {
  width: 100%;
  height: 100%;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(13, 18, 17, 0.95), rgba(13, 18, 17, 0.64) 44%, rgba(13, 18, 17, 0.18)),
    linear-gradient(0deg, rgba(13, 18, 17, 0.88), rgba(13, 18, 17, 0.06) 54%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(850px, 100%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(3.7rem, 10vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.22;
}

.hero-copy {
  max-width: 780px;
  margin: 20px 0 0;
  color: rgba(255, 250, 240, 0.9);
  font-size: clamp(1.08rem, 2vw, 1.34rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button.primary {
  background: var(--gold);
  color: #201506;
}

.button.secondary {
  border-color: rgba(255, 250, 240, 0.45);
  color: var(--panel);
}

.section .button.secondary {
  border-color: var(--line-strong);
  color: var(--ink);
}

.signal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(960px, 100%);
  margin: 26px 0 0;
  padding: 0;
}

.signal-list div {
  border-top: 1px solid rgba(255, 250, 240, 0.28);
  padding-top: 12px;
}

.signal-list dt {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-list dd {
  margin: 4px 0 0;
  color: rgba(255, 250, 240, 0.9);
  font-weight: 700;
}

.section {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(62px, 9vw, 108px) 0;
}

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

.section-heading {
  max-width: 820px;
}

.section-heading p:not(.section-kicker),
.connect-section p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 6vw, 72px);
  margin-top: 34px;
  color: var(--intro-text);
  font-size: clamp(1.05rem, 1.8vw, 1.24rem);
}

.intro-grid p {
  margin: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.work-card,
.skill-card,
.reception-card,
.reference-card,
.education-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--panel-rgb), 0.82);
  padding: 24px;
}

.work-card {
  grid-column: span 3;
  min-height: 252px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.work-card.featured {
  grid-column: span 6;
  min-height: 230px;
  background:
    linear-gradient(135deg, rgba(216, 155, 53, 0.18), rgba(45, 111, 120, 0.12)),
    var(--panel);
  border-color: rgba(154, 100, 33, 0.28);
  box-shadow: var(--shadow);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span {
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.work-card p,
.skill-card p,
.timeline-item p,
.education-grid p {
  margin: 0;
  color: var(--muted);
}

.skills-grid,
.reception-grid,
.reference-grid,
.education-grid {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.skills-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-number {
  width: max-content;
  color: var(--red);
  font-weight: 800;
}

.reception-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.reception-card {
  min-height: 260px;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(180deg, rgba(216, 155, 53, 0.1), rgba(var(--panel-rgb), 0.82) 44%),
    var(--panel);
}

.reception-card blockquote {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.18;
}

.reception-card figcaption {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.reception-card a {
  width: max-content;
  color: var(--gold-dark);
  font-weight: 800;
  text-decoration: none;
}

.reception-card a:hover,
.reception-card a:focus-visible {
  text-decoration: underline;
}

.experience-section {
  width: min(980px, calc(100% - 40px));
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 12px;
  width: 2px;
  background: var(--line-strong);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  padding-left: 42px;
}

.timeline-item::before {
  position: absolute;
  top: 8px;
  left: 5px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-dark);
  content: "";
}

.timeline-date {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-dark);
  font-size: 0.83rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-item h3 + p {
  margin-top: 5px;
  font-weight: 700;
}

.reference-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reference-card {
  min-height: 235px;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.reference-card blockquote {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.28;
}

.reference-card figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

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

.education-grid article {
  min-height: 180px;
}

.education-grid p {
  margin-top: 10px;
}

.education-grid span {
  display: inline-block;
  margin-top: 14px;
  color: var(--green);
  font-weight: 800;
}

.connect-section {
  justify-content: space-between;
  gap: 36px;
}

.connect-section > div {
  max-width: 760px;
}

.connect-section h2 {
  max-width: 14ch;
}

.connect-section .button {
  flex: 0 0 auto;
}

.contact-actions,
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer {
  justify-content: space-between;
  gap: 18px;
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 980px) {
  .skills-grid,
  .reception-grid,
  .reference-grid,
  .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle {
    width: max-content;
  }

  .hero {
    min-height: 80svh;
    padding-top: 132px;
  }

  .signal-list,
  .intro-grid,
  .skills-grid,
  .reception-grid,
  .reference-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

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

  .work-card,
  .work-card.featured {
    grid-column: auto;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .connect-section,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .site-nav {
    gap: 9px;
    font-size: 0.8rem;
  }

  .theme-toggle {
    min-height: 34px;
    padding: 6px 10px;
  }

  .hero {
    min-height: 80svh;
    padding: 126px 18px 32px;
  }

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

  h2 {
    font-size: clamp(1.95rem, 12vw, 3rem);
  }

  .section,
  .experience-section {
    width: calc(100% - 32px);
  }

  .button {
    width: 100%;
  }

  .hero-actions {
    align-items: stretch;
  }

  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal-list {
    display: none;
  }

  .timeline-item {
    padding-left: 34px;
  }
}
