:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --ink: #17191c;
  --muted: #626a73;
  --line: #ddd7cb;
  --blue: #2458a6;
  --teal: #0b766d;
  --amber: #c77b22;
  --shadow: 0 20px 60px rgba(38, 34, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

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

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

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

.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: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(247, 244, 238, 0.92);
  border-bottom: 1px solid rgba(221, 215, 203, 0.85);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 22px);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

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

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.section {
  padding: 88px clamp(18px, 5vw, 64px);
}

.page-main {
  min-height: calc(100vh - 145px);
}

.page-section {
  min-height: calc(100vh - 145px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  align-items: center;
  min-height: calc(100vh - 74px);
  gap: clamp(32px, 6vw, 88px);
  padding-top: 44px;
}

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

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.7rem, 5.5vw, 4.45rem);
}

h2 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 4.1rem);
}

h3 {
  font-size: 1.2rem;
}

.hero-copy,
.section-heading + p,
.resume-panel p {
  color: var(--muted);
}

.hero-copy {
  max-width: 660px;
  margin: 20px 0 0;
  font-size: clamp(1.03rem, 1.6vw, 1.18rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(23, 25, 28, 0.12);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

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

.button.secondary {
  background: transparent;
}

.hero-visual {
  position: relative;
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
  object-position: center 36%;
  box-shadow: var(--shadow);
}

.section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 34px;
}

.about-section,
.projects-section,
.contact-section {
  background: var(--surface);
}

.page-section.about-section,
.page-section.projects-section,
.page-section.contact-section {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 68px);
  color: var(--muted);
  font-size: 1.08rem;
}

.about-grid p {
  margin: 0;
}

.personality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 42px;
}

.personality-grid article {
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(38, 34, 28, 0.08);
}

.personality-grid article:nth-child(1) {
  border-top: 5px solid var(--teal);
}

.personality-grid article:nth-child(2) {
  border-top: 5px solid var(--blue);
}

.personality-grid article:nth-child(3) {
  border-top: 5px solid var(--amber);
}

.personality-grid article:nth-child(4) {
  border-top: 5px solid var(--ink);
}

.personality-grid p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
}

.about-photo-section {
  display: grid;
  gap: 24px;
  margin-top: 58px;
}

.about-photo-section .section-heading {
  max-width: 880px;
  margin-bottom: 0;
}

.about-photo-section .section-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.about-photo-section .section-heading p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
}

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

.photo-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(38, 34, 28, 0.08);
}

.photo-card.wide {
  grid-column: 1 / -1;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.photo-card figcaption {
  padding: 16px 18px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.skills-grid,
.projects-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.skills-grid article,
.project-card,
.contact-grid a {
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.skills-grid article {
  border-top: 5px solid var(--blue);
}

.skills-grid article:nth-child(2) {
  border-top-color: var(--teal);
}

.skills-grid article:nth-child(3) {
  border-top-color: var(--amber);
}

.skills-grid article:nth-child(4) {
  border-top-color: var(--ink);
}

.skills-grid p,
.project-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

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

.project-groups {
  display: grid;
  gap: 54px;
}

.project-group {
  display: grid;
  gap: 20px;
}

.project-group-heading {
  display: grid;
  gap: 4px;
}

.project-group-heading h2 {
  max-width: 820px;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

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

.project-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.project-topline a {
  color: var(--blue);
}

.project-detail {
  display: grid;
  gap: 32px;
}

.project-detail-copy {
  max-width: 920px;
  color: var(--muted);
  font-size: 1.08rem;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 920px;
}

.artifact-grid.single-artifact {
  grid-template-columns: minmax(0, 460px);
}

.artifact-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.artifact-card p {
  margin: 12px 0 24px;
  color: var(--muted);
}

.slide-viewer {
  display: grid;
  gap: 18px;
  max-width: 980px;
}

.slide-viewer-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.slide-viewer-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.slide-counter {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.slide-stage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.slide-stage img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface);
}

.slide-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.paper-viewer {
  display: grid;
  gap: 18px;
  max-width: 1120px;
}

.paper-frame {
  width: 100%;
  min-height: min(78vh, 980px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.resume-section {
  background: linear-gradient(180deg, #f7f4ee 0%, #eee8dc 100%);
  color: var(--ink);
}

.resume-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(38, 34, 28, 0.1);
}

.resume-details {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin: 42px auto 0;
}

.resume-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(38, 34, 28, 0.08);
}

.resume-card:nth-child(3n + 2) {
  border-left-color: var(--teal);
}

.resume-card:nth-child(3n) {
  border-left-color: var(--amber);
}

.resume-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.resume-card ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.resume-card li + li {
  margin-top: 8px;
}

.resume-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px;
}

.resume-panel h2 {
  max-width: 720px;
}

.resume-panel p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
}

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

.resume-panel .button.light {
  border-color: var(--ink);
  color: var(--ink);
}

.education-section {
  background: var(--bg);
}

.education-overview,
.coursework-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1120px;
}

.degree-card,
.course-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(38, 34, 28, 0.08);
}

.degree-card {
  min-height: 170px;
  padding: 24px;
}

.degree-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.coursework-intro {
  max-width: 820px;
  margin: 52px 0 22px;
}

.coursework-intro h2 {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.coursework-intro p {
  margin: 14px 0 0;
  color: var(--muted);
}

.course-card {
  padding: 0;
}

.course-card summary {
  cursor: pointer;
  padding: 22px 24px;
  color: var(--ink);
  font-weight: 800;
}

.course-card summary::marker {
  color: var(--teal);
}

.course-card p {
  margin: 0;
  padding: 0 24px 24px;
  color: var(--muted);
}

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

.contact-grid a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease;
}

.contact-grid a:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
}

.contact-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 5vw, 64px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    padding: 12px;
  }

  .site-nav a::after {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual img {
    aspect-ratio: 4 / 5;
    max-height: 680px;
    object-position: center 28%;
  }

  .about-grid,
  .projects-grid,
  .contact-grid,
  .artifact-grid,
  .personality-grid,
  .photo-grid,
  .education-overview,
  .coursework-grid {
    grid-template-columns: 1fr;
  }

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

  .resume-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 580px) {
  .section {
    padding: 64px 18px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-visual img {
    aspect-ratio: 3 / 4;
    max-height: 560px;
    object-position: center 24%;
  }

  h1 {
    font-size: 2.5rem;
  }

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

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