*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1b1b1b;
  --muted: #5b6169;
  --line: #dcdfe3;
  --accent: #8a1f2b;
  --accent-deep: #6d1721;
  --dark: #16181c;
  --soft: #f3f2ef;
  --radius: 4px;
  --font-display: "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Helvetica Neue", Arial, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

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

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

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nav a {
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .18em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -.02em;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}

h3 {
  line-height: 1.25;
}

.hero {
  padding: 90px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 72px;
  align-items: center;
}

.hero-lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.25rem;
}

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

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  transition: background .18s ease, color .18s ease;
}

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

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

.button.secondary {
  background: #fff;
  border: 1px solid var(--text);
}

.button.secondary:hover {
  color: #fff;
  background: var(--text);
}

.mini-resume {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 55px;
}

.mini-resume div {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mini-resume span,
.skills-grid span {
  display: block;
  color: #7a828b;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .11em;
}

.mini-resume strong {
  display: block;
  margin-top: 6px;
  font-size: .95rem;
}

.profile-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-photo {
  height: 230px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.profile-photo img {
  max-width: 70%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.profile-info {
  padding: 28px;
}

.profile-info ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.profile-info li + li {
  margin-top: 8px;
}

.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--soft);
}

.society-section {
  background: #e9f1ef;
}

.section-dark {
  color: #fff;
  background: var(--dark);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-heading > p:last-child,
.section-intro {
  color: var(--muted);
}

.section-heading.light .eyebrow,
.section-heading.light > p:last-child {
  color: #aab2bc;
}

.split {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 90px;
}

.body-copy {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.04rem;
}

.body-copy .lead {
  color: #2a2f36;
  font-size: 1.23rem;
}

.coding-layout {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 72px;
  align-items: center;
}

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

.coding-stat {
  min-height: 132px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: #fff;
}

.coding-stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.coding-stat span {
  margin-top: 8px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

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

.highlight-card {
  min-height: 270px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  border: 1px solid #2d333b;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #1d2026;
  transition: background .18s ease, border-color .18s ease;
}

.highlight-card:hover {
  background: #24282f;
  border-color: var(--accent);
}

.highlight-card span,
.feature-row span,
.item-type {
  color: #d98a94;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.highlight-card h3 {
  margin-top: 35px;
  font-size: 1.5rem;
}

.highlight-card p {
  color: #aeb6bf;
}

.highlight-card strong {
  margin-top: auto;
  color: #fff;
}

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

.item-card {
  min-height: 220px;
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: #fff;
  transition: box-shadow .18s ease;
}

.item-card:hover {
  box-shadow: 0 10px 30px rgba(20,25,30,.1);
}

.item-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #f6e9ea;
  color: var(--accent);
  font-weight: 900;
}

.item-card h3 {
  margin: 12px 0 10px;
}

.item-card p {
  color: var(--muted);
  font-size: .92rem;
}

.item-card strong {
  color: var(--accent);
  font-size: .86rem;
}

.feature-list {
  border-top: 1px solid var(--line);
}

.feature-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  gap: 20px;
  align-items: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.feature-row-with-image {
  grid-template-columns: 90px minmax(0, 1fr) 250px 50px;
  gap: 20px;
}

.feature-image {
  width: 250px;
  height: 158px;
  object-fit: cover;
  border: 1px solid var(--accent);
  border-radius: 3px;
  transition: transform .3s ease;
}

.feature-row-with-image:hover .feature-image {
  transform: scale(1.03);
}

.feature-row:hover h3 {
  color: var(--accent);
}

.feature-number {
  color: #8a929c;
  font-size: .8rem;
  font-weight: 850;
}

.feature-row h3 {
  margin: 6px 0 4px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  transition: color .18s ease;
}

.feature-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.feature-arrow {
  font-size: 1.5rem;
  color: var(--accent);
}

.chess-section {
  background: var(--soft);
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.chess-stat {
  min-height: 180px;
  padding: 26px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--accent);
}

.chess-stat span {
  display: block;
  color: #7b838d;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .11em;
}

.chess-stat strong {
  display: block;
  margin-top: 30px;
  font-family: var(--font-display);
  font-size: 2.6rem;
  color: var(--accent);
  letter-spacing: -.01em;
}

.chess-stat small {
  color: var(--muted);
}

/* Cards with a photo header */
.item-card.photo-card {
  display: block;
  padding: 0;
  overflow: hidden;
}

.card-thumb {
  overflow: hidden;
  background: var(--soft);
}

.card-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform .4s ease;
}

.item-card.photo-card:hover .card-thumb img {
  transform: scale(1.05);
}

.item-card.photo-card > div:last-child {
  padding: 24px 26px 28px;
}

/* Institutional "in numbers" band */
.numbers-band {
  padding: 72px 0;
  color: #fff;
  background: var(--accent);
}

.numbers-band .eyebrow {
  color: rgba(255, 255, 255, .75);
}

.numbers-band h2 {
  margin-bottom: 44px;
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.number-item {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .35);
}

.number-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
}

.number-item span {
  display: block;
  margin-top: 10px;
  font-size: .9rem;
  color: rgba(255, 255, 255, .85);
}

/* Pull quote */
.quote-block {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.quote-block blockquote {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  line-height: 1.4;
}

.quote-block cite {
  color: var(--muted);
  font-size: .82rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.skills-grid > div {
  padding: 25px 22px 10px 0;
  border-right: 1px solid var(--line);
}

.skills-grid > div:not(:first-child) {
  padding-left: 22px;
}

.skills-grid > div:last-child {
  border-right: 0;
}

.skills-grid p {
  color: var(--muted);
  font-size: .92rem;
}

footer {
  padding: 55px 0 45px;
  border-top: 4px solid var(--accent);
  background: var(--soft);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: #6f7780;
  font-size: .86rem;
}

.footer-row strong {
  color: var(--text);
}

.footer-row p {
  margin: 2px 0 0;
}

.footer-links {
  display: flex;
  gap: 22px;
}

@media (max-width: 900px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .coding-layout {
    grid-template-columns: 1fr;
    gap: 40px;

  .highlight-grid,
  .item-grid {
    grid-template-columns: repeat(2, 1fr);
  }


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

  .skills-grid > div:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .menu-button {
    display: block;
  }

  .nav {
    position: absolute;
    top: 66px;
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 16px 40px rgba(0,0,0,.1);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 10px 12px;
  }

  .hero {
    padding: 64px 0;
  }

  h1 {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .section {
    padding: 74px 0;
  }

  .mini-resume,
  .highlight-grid,
  .item-grid,
  .chess-board,
  .numbers-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .feature-row {
    grid-template-columns: 48px 1fr 30px;
  }

  .feature-row-with-image {
    grid-template-columns: 48px 1fr 30px;
    gap: 20px;
  }

  .feature-image {
    grid-column: 2;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-top: 12px;
  }

  .feature-row-with-image .feature-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .skills-grid > div,
  .skills-grid > div:not(:first-child) {
    padding-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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