:root {
  --bg: #f6f1e8;
  --bg-accent: #efe0ce;
  --surface: rgba(255, 252, 247, 0.78);
  --surface-strong: #fffaf2;
  --text: #182126;
  --muted: #586167;
  --line: rgba(24, 33, 38, 0.12);
  --primary: #c75d2c;
  --primary-deep: #8b3d1c;
  --shadow: 0 20px 60px rgba(44, 28, 17, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1160px;
  --anchor-offset: 5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(199, 93, 44, 0.14), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(23, 105, 93, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f8f5ef 50%, #f3ede2 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("source_imgs/background.svg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.16;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 33, 38, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 38, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 90%);
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

.site-header,
.site-footer,
.section,
.hero-card,
.contact-card,
.project-card,
.panel,
.strength-item {
  backdrop-filter: blur(18px);
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 1rem;
  z-index: 10;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand,
.site-nav a,
.button {
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 700;
}

.section {
  margin-top: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-height: calc(100vh - 7rem);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.compact-section {
  padding: 1.1rem;
}

.compact-section .eyebrow {
  margin-bottom: 0.9rem;
}

section[id],
main[id] {
  scroll-margin-top: var(--anchor-offset);
}

#about {
  min-height: auto;
}

#education {
  min-height: auto;
}

#experience {
  min-height: auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  min-height: calc(100dvh - 9rem);
}

.hero-copy,
.hero-card,
.contact-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-copy {
  padding-top: 4rem;
}

.hero-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.eyebrow,
.project-index,
.card-label {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-deep);
  font-weight: 800;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.65rem 0 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.hero-location:focus-visible {
  outline: 2px solid rgba(139, 61, 28, 0.35);
  outline-offset: 6px;
  border-radius: 999px;
}

.location-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.location-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
  fill: currentColor;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Playfair Display", serif;
  line-height: 0.98;
}

h1 {
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 15ch;
}

h3 {
  font-size: 1.3rem;
}

p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.hero-text {
  max-width: 52ch;
  margin: 1.5rem 0 0;
  font-size: 1.08rem;
  line-height: 1.9;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3rem;
  margin-top: 1.8rem;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary-deep);
  font-weight: 700;
  text-decoration: none;
}

.hero-links a:hover {
  text-decoration: underline;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
}

.link-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
  fill: currentColor;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

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

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

.button-primary:hover {
  background: var(--primary-deep);
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.35);
}

.hero-card,
.contact-card,
.panel,
.project-card,
.strength-item {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.86);
}

.hero-card {
  align-self: start;
  height: fit-content;
}

.hero-copy > *:not(.hero-title-row),
.hero-card,
.site-header,
.site-footer,
#about,
#work,
.strengths,
#contact {
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 220ms ease;
}

body.map-focus .hero {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.map-focus .site-header,
body.map-focus .site-footer,
body.map-focus .hero-copy > *:not(.hero-title-row),
body.map-focus .hero-card,
body.map-focus #about,
body.map-focus #work,
body.map-focus .strengths,
body.map-focus #contact {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  visibility: hidden;
}

body.map-focus .hero-title-row h1 {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  visibility: hidden;
}

.hero-portrait {
  margin-bottom: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4 / 4.6;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

.hero-metrics {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}

.hero-metrics li {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.metric-label {
  color: var(--muted);
}

.section-heading {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.about-grid,
.card-grid,
.strength-list {
  display: grid;
  gap: 1rem;
}

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

.education-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.education-dates {
  margin: 0;
  white-space: nowrap;
  font-size: 0.95rem;
}

.education-location {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.experience-meta {
  margin: 0.35rem 0 0;
  font-style: italic;
  color: var(--text);
}

.experience-list {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.experience-list li + li {
  margin-top: 0.6rem;
}

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

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

.project-card,
.strength-item {
  min-height: 100%;
}

.site-footer {
  margin-top: 0.5rem;
  padding: 0.35rem 1rem 0.75rem;
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

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

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

@media (max-width: 920px) {
  .hero,
  .card-grid,
  .strength-list,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: calc(100dvh - 7rem);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 0.75rem;
  }

  .site-header {
    padding: 0.9rem 1rem;
    border-radius: 24px;
  }

  .site-nav {
    gap: 0.85rem;
    font-size: 0.95rem;
  }

  .section {
    padding: 1.25rem;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }
}

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

  body {
    scroll-snap-type: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

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