:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #5f6c72;
  --paper: #f7f3ea;
  --surface: #fffdf7;
  --accent-red: #BE0032;
  --featured-red: #9b1c31;
  --red-dark: #6f1026;
  --red-soft: #fde3ea;
  --gold: #c99728;
  --line: rgba(23, 32, 38, 0.14);
  --shadow: 0 24px 60px rgba(23, 32, 38, 0.14);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

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

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(23, 32, 38, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 36px rgba(23, 32, 38, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.site-header.is-scrolled {
  border-color: rgba(190, 0, 50, 0.18);
  box-shadow: 0 18px 48px rgba(23, 32, 38, 0.12);
  transform: translateY(-2px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 8px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(23, 32, 38, 0.08);
  border-radius: 10px;
  background: rgba(247, 243, 234, 0.58);
}

.site-nav a {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  background: rgba(190, 0, 50, 0.08);
  color: var(--accent-red);
  outline: none;
}

.nav-toggle {
  display: none;
}

.section {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 84px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100svh - 72px);
  padding-top: 48px;
  padding-bottom: 64px;
}

.hero h1,
.section-heading h2,
.intro h2,
.contact h2 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.4rem, 5.35vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.13rem;
}

.seeking-line {
  width: fit-content;
  margin: 22px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--accent-red);
  border-radius: 8px;
  background: rgba(190, 0, 50, 0.07);
  color: var(--red-dark);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-red);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

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

.button-secondary {
  background: transparent;
}

.button:hover,
.button:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 36px 0 0;
}

.quick-stats div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.quick-stats dt {
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-media {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 460px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(135deg, rgba(190, 0, 50, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(217, 93, 57, 0.18), transparent 46%),
    #f1e6d3;
}

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

.portrait-hero img {
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
  object-position: center 36%;
}

.portrait-caption {
  position: absolute;
  right: 22px;
  bottom: 22px;
  max-width: min(320px, calc(100% - 44px));
  padding: 16px;
  border: 1px solid rgba(255, 253, 247, 0.28);
  border-radius: 8px;
  background: rgba(23, 32, 38, 0.72);
  color: var(--surface);
  backdrop-filter: blur(14px);
}

.portrait-caption span {
  display: block;
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portrait-caption strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  line-height: 1.15;
}

.intro,
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 56px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.intro h2,
.contact h2,
.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 1;
}

.intro p:last-child,
.contact p:not(.eyebrow):not(.contact-note) {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.contact h2 + p {
  margin-top: 22px;
}

.contact .contact-note {
  width: fit-content;
  margin-top: 20px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent-red);
  border-radius: 8px;
  background: rgba(190, 0, 50, 0.07);
  color: var(--red-dark);
  font-weight: 900;
}

.section-heading {
  display: block;
  margin-bottom: 32px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.skill-columns section,
.education-grid article,
.timeline-item,
.contact-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-card {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: 24px;
}

.project-card.featured {
  grid-column: span 2;
  background: var(--featured-red);
  color: var(--surface);
}

.project-card.featured p,
.project-card.featured .project-meta {
  color: rgba(255, 253, 247, 0.74);
}

.project-media {
  margin: auto 0 18px;
}

.tag-list + .text-link {
  margin-top: auto;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
}

.project-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-media figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-gallery img {
  aspect-ratio: 4 / 3;
}

.project-gallery figcaption {
  grid-column: 1 / -1;
}

.featured .project-media img {
  border-color: rgba(255, 253, 247, 0.18);
}

.featured .project-media figcaption {
  color: rgba(255, 253, 247, 0.66);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-card h3,
.skill-columns h3,
.education-grid h3,
.timeline-item h3 {
  margin: 26px 0 10px;
  font-size: 1.45rem;
  line-height: 1.15;
}

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

.project-card p + .tag-list {
  margin-top: 22px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}

.tag-list li {
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: rgba(190, 0, 50, 0.07);
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 900;
}

.featured .tag-list li {
  background: rgba(255, 253, 247, 0.1);
  color: var(--red-soft);
}

.featured .text-link {
  color: var(--red-soft);
}

.text-link {
  width: fit-content;
  color: var(--accent-red);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.detail-nav {
  margin-left: auto;
}

.detail-page {
  max-width: 980px;
}

.detail-page h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.detail-lede {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.2rem;
}

.detail-hero-image {
  margin: 42px 0;
}

.detail-hero-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-hero-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-grid section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-grid h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.detail-grid p {
  margin: 0;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.error-page {
  min-height: calc(100svh - 90px);
  display: grid;
  align-content: center;
}

.error-page h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.error-page p:not(.eyebrow) {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.detail-breakdown {
  margin-top: 56px;
}

.detail-breakdown h2 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 1;
  letter-spacing: 0;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.detail-stack section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-stack h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.detail-stack p {
  margin: 0;
  color: var(--muted);
}

.detail-stack p + p {
  margin-top: 14px;
}

.detail-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  color: var(--muted);
  list-style: none;
}

.detail-list li {
  padding-left: 14px;
  border-left: 3px solid rgba(190, 0, 50, 0.22);
}

.detail-list strong {
  color: var(--ink);
}

.poster-section {
  margin-top: 56px;
}

.poster-section h2 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 1;
  letter-spacing: 0;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.poster-grid figure {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.poster-grid img {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  border-radius: 6px;
  background: #f4f1ea;
}

.poster-grid figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  border-top: 1px solid var(--line);
}

.sticky-heading {
  position: sticky;
  top: 96px;
  display: block;
  margin-bottom: 0;
  align-self: start;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  padding: 24px;
}

.timeline-date {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-columns,
.education-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-columns section,
.education-grid article {
  padding: 24px;
}

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

.contact {
  align-items: center;
}

.contact-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.contact-panel a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.contact-panel a::after {
  content: ">";
  color: var(--accent-red);
}

.contact-panel a:hover,
.contact-panel a:focus-visible {
  background: rgba(201, 151, 40, 0.13);
  outline: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.site-footer p {
  max-width: 560px;
  margin: 4px 0 0;
}

.site-footer a {
  color: var(--accent-red);
  font-weight: 900;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .nav-toggle span:not(.sr-only) {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .nav-toggle.is-open span:not(.sr-only):nth-child(2) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.is-open span:not(.sr-only):nth-child(3) {
    opacity: 0;
  }

  .nav-toggle.is-open span:not(.sr-only):nth-child(4) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 24px;
    display: none;
    width: min(280px, calc(100vw - 48px));
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .detail-nav {
    position: static;
    display: flex;
    width: auto;
    padding: 4px;
    flex-direction: row;
    align-items: center;
    border: 1px solid rgba(23, 32, 38, 0.08);
    background: rgba(247, 243, 234, 0.58);
    box-shadow: none;
  }

  .hero,
  .intro,
  .split,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 32px;
  }

  .hero-media {
    min-height: 360px;
  }

  .portrait-hero img {
    min-height: 360px;
  }

  .project-grid,
  .skill-columns,
  .education-grid,
  .detail-grid,
  .poster-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-column: auto;
  }

  .sticky-heading {
    position: static;
  }
}

@media (max-width: 620px) {
  .site-header,
  .section,
  .site-footer {
    width: calc(100% - 32px);
  }

  .site-header {
    top: 8px;
    padding: 10px;
  }

  .detail-nav {
    gap: 2px;
  }

  .detail-nav a {
    padding: 6px 8px;
    font-size: 0.88rem;
  }

  .section {
    padding: 56px 0;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: 2.65rem;
  }

  .hero-actions,
  .quick-stats,
  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .hero-media {
    min-height: 280px;
  }

  .portrait-hero img {
    min-height: 280px;
  }

  .portrait-caption {
    right: 14px;
    bottom: 14px;
  }

}

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