:root {
  --navy: #081b35;
  --sky: #cce9f4;
  --sky-hover: #a9d7e8;
  --paper: #ffffff;
  --ink: #66666d;
  --muted: #777780;
  --line: #dbe5eb;
  --shadow: 0 24px 70px rgba(2, 15, 32, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--navy);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0 clamp(16px, 6.5vw, 132px);
  color: var(--ink);
  background: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.68;
}

a {
  color: #246884;
}

a:hover {
  color: var(--navy);
}

/* Main white page */

.site-card {
  --card-padding: clamp(28px, 5vw, 68px);

  width: min(1680px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--card-padding);
  background: var(--paper);
  box-shadow: var(--shadow);
}

/* Header and navigation */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: clamp(42px, 6vw, 72px);
}

.site-name {
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link,
.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 18px;
  color: var(--navy);
  background: var(--sky);
  border-radius: 3px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.nav-link:hover,
.contact-button:hover {
  color: var(--navy);
  background: var(--sky-hover);
  transform: translateY(-1px);
}

.nav-link.active {
  color: white;
  background: var(--navy);
}

/* General typography */

h1,
h2,
h3 {
  color: #5f5f66;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

h1 {
  margin: 0 0 20px;
  line-height: 1.08;
}

h2 {
  margin: 0 0 16px;
}

h3 {
  margin: 0 0 7px;
}

p {
  margin: 0 0 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #377893;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.placeholder {
  color: var(--muted);
}

/* Homepage */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  align-items: center;
  gap: clamp(42px, 7vw, 92px);
}

.intro p:not(.eyebrow) {
  max-width: 620px;
  font-size: 1.04rem;
}

.portrait-wrap {
  justify-self: center;
  width: min(100%, 330px);
}

.portrait-wrap img,
.portrait-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
}

.portrait-wrap img {
  display: block;
  object-fit: cover;
}

.portrait-placeholder {
  display: grid;
  place-content: center;
  color: white;
  text-align: center;
  background: linear-gradient(145deg, #153b62, #081b35);
  box-shadow: 18px 18px 0 var(--sky);
}

.portrait-placeholder span {
  font-family: Georgia, serif;
  font-size: 4.3rem;
  line-height: 1;
}

.portrait-placeholder small {
  margin-top: 12px;
  color: var(--sky);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Contact button inside biography */

.intro .contact-row {
  display: flex;
  width: 100%;
  justify-content: center;
  padding-top: 20px;
}

.contact-button {
  min-width: 140px;
}

/* Homepage section dividers */

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin:
    clamp(62px, 9vw, 118px)
    calc(-1 * var(--card-padding))
    0;
  color: #7ce6e5;
  background: rgba(113, 113, 122, 0.55);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 24px;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  border-top: 2px dashed #7ce6e5;
}

/* Education section on homepage */

.education-section {
  max-width: 1380px;
  margin: 0 auto;
  padding:
    clamp(50px, 7vw, 92px)
    clamp(8px, 5vw, 90px)
    clamp(42px, 5vw, 72px);
}

.education-section h2 {
  margin-bottom: clamp(32px, 4vw, 52px);
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  text-align: center;
}

.education-list {
  display: grid;
  gap: clamp(20px, 2.5vw, 34px);
  font-size: clamp(0.95rem, 1.3vw, 1.18rem);
}

.education-list p {
  margin: 0;
}

/* Research, Teaching, Education, and CV pages */

.page-content {
  max-width: 790px;
  margin: 0 auto;
}

.page-content > h1,
.hobby-hero h1 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
}

.page-content h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
}

.page-content h3 {
  font-size: 1rem;
}

.page-content p {
  font-size: 0.94rem;
}

.page-intro {
  max-width: 680px;
  color: #35485c;
  font-size: 1rem;
}

.content-section {
  margin-top: 38px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.item-card {
  margin: 0 0 14px;
  padding: 17px 20px 13px;
  background: #f5f9fb;
  border-left: 4px solid var(--sky-hover);
}

.item-card p {
  margin-bottom: 7px;
  font-size: 0.88rem;
}

/* Running and triathlon page */

.personal-page {
  max-width: 1100px;
}

.hobby-hero {
  max-width: 820px;
  margin-bottom: 40px;
  padding-left: 24px;
  border-left: 5px solid var(--sky-hover);
}

.hobby-hero h1 {
  margin-bottom: 16px;
}

.hobby-intro {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-style: italic;
  line-height: 1.7;
}

.race-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}

.race-panel {
  padding: clamp(22px, 3vw, 32px);
  background: #f5f9fb;
  border-top: 5px solid var(--navy);
}

.race-number {
  margin: 0 0 5px;
  color: #4b91a9;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.race-panel h2,
.photo-section h2 {
  margin-bottom: 14px;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
}

.race-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-style: italic;
}

.race-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.race-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}

.race-list li:first-child {
  padding-top: 0;
}

.race-list strong {
  color: var(--navy);
  font-size: 0.94rem;
  font-weight: 700;
}

.race-list span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.running-quote {
  margin-top: 22px;
  padding: 15px 17px;
  color: var(--navy);
  background: white;
  border-left: 4px solid var(--sky-hover);
}

.running-quote p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-style: italic;
}

/* Photo gallery */

.photo-section {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

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

.photo-gallery figure {
  margin: 0;
}

.photo-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.photo-gallery img:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(8, 27, 53, 0.18);
}

.photo-gallery figcaption {
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}
.photo-gallery img.photo-align-top {
  object-position: center 20%;
}
/* Tablet and mobile */

@media (max-width: 780px) {
  body {
    padding: 0;
  }

  .site-card {
    --card-padding: 22px;

    min-height: 100vh;
    padding: 28px var(--card-padding) 48px;
    box-shadow: none;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 42px;
  }

  nav {
    width: 100%;
  }

  .nav-link {
    flex: 1;
    padding-inline: 10px;
  }

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

  .portrait-wrap {
    grid-row: 1;
    width: min(76vw, 290px);
  }

  .portrait-placeholder {
    box-shadow: 12px 12px 0 var(--sky);
  }

  .intro .contact-row {
    padding-top: 22px;
  }

  .section-divider {
    margin-inline: -22px;
  }

  .section-divider span {
    font-size: 0.7rem;
  }

  .education-section {
    padding-inline: 0;
  }

  .education-list {
    gap: 20px;
    font-size: 0.95rem;
  }

  .hobby-hero {
    padding-left: 18px;
  }

  .race-columns,
  .photo-gallery {
    grid-template-columns: 1fr;
  }

  .race-list strong,
  .race-list span {
    display: block;
    margin-left: 0;
  }

  .race-list span {
    margin-top: 3px;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .contact-button,
  .photo-gallery img {
    transition: none;
  }
}

/* Printing */

@media print {
  html,
  body {
    background: white;
  }

  body {
    padding: 0;
  }

  .site-card {
    width: 100%;
    box-shadow: none;
  }

  .site-header nav {
    display: none;
  }
}
