@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/outfit-latin.woff2") format("woff2");
}

:root {
  --canvas: #e7ebf2;
  --bg: #ffffff;
  --ink: #12151c;
  --muted: #5b6472;
  --line: #e1e6ef;
  --accent: #1d4ed8;
  --sans: Outfit, "Avenir Next", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #07080c;
    --bg: #12151c;
    --ink: #f4f6fb;
    --muted: #aeb6c4;
    --line: #2a3140;
    --accent: #9db7ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #07080c;
  --bg: #12151c;
  --ink: #f4f6fb;
  --muted: #aeb6c4;
  --line: #2a3140;
  --accent: #9db7ff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, var(--bg));
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.4rem 0.7rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

a:hover {
  text-decoration-color: var(--accent);
}

p {
  text-wrap: pretty;
}

.page {
  max-width: 68rem;
  margin: 1.25rem auto;
  padding: 1.75rem 1.75rem 1.5rem;
  background: var(--bg);
  border-radius: 18px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
}

.hero {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.5rem 1.75rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-copy nav {
  order: -1;
}

.portrait {
  display: block;
  width: 8.5rem;
  height: 8.5rem;
  min-width: 0;
  max-width: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.contacts li {
  max-width: 100%;
}

.contacts a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
}

.contacts .contact-icon-link {
  width: 2.75rem;
  padding: 0;
}

.contact-icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

.contacts a:hover,
.contacts a:focus-visible {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}

h1 {
  margin: 0.45rem 0 0;
  font-size: clamp(2.6rem, 5vw, 3.7rem);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.statement {
  margin: 0.45rem 0 0;
  color: var(--accent);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

h2 a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

h2 a:hover {
  color: var(--accent);
}

.logo {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.04em;
  fill: currentColor;
}

.chapters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 1.35rem 0 0;
}

.chapters li {
  min-width: 0;
}

.when {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin: 0.28rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.detail {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.earlier {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.earlier strong {
  font-weight: 650;
}

@media (max-width: 800px) {
  .page {
    margin: 0;
    padding: 1.25rem 1.25rem 2rem;
    padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
    border-radius: 0;
    box-shadow: none;
  }

  .hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
  }

  .hero-copy {
    display: contents;
  }

  .portrait {
    order: 1;
    flex: 0 0 clamp(88px, 25vw, 112px);
    width: clamp(88px, 25vw, 112px);
    height: auto;
    aspect-ratio: 1;
    border-radius: 14px;
  }

  .hero h1 {
    order: 0;
    flex: 1 1 9rem;
    min-width: 0;
    margin: 0;
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .hero .statement {
    order: 2;
    flex: 1 0 100%;
    max-width: 38ch;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.4;
    text-wrap: pretty;
  }

  .hero nav {
    order: 3;
    flex: 1 0 100%;
  }

  .chapters {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0.25rem;
  }

  .chapters li {
    padding: 1.2rem 0;
    border-top: 1px solid var(--line);
  }

  .chapters li:first-child {
    border-top: 0;
  }

  .detail {
    margin-top: 0.5rem;
    line-height: 1.6;
  }

  .earlier {
    margin-top: 0;
    padding-top: 1.2rem;
    line-height: 1.6;
  }
}

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

@media print {
  body {
    background: white;
    color: black;
  }

  .page {
    margin: 0;
    box-shadow: none;
  }

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

  .skip {
    display: none;
  }
}
