:root {
  color-scheme: light;
  --page: #f4f1eb;
  --paper: #fffefb;
  --ink: #1b1d1f;
  --muted: #666b6f;
  --line: #d8d3ca;
  --accent: #ff0000;
  --link: #155f68;
  --measure: 52.5rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  font-size: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4.6rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--accent);
  background: var(--paper);
}

.header-link {
  justify-self: start;
  padding: 0.45rem 0;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
  opacity: 0.62;
}

.header-link:hover {
  opacity: 0.9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-actions-left {
  justify-self: start;
}

.language {
  display: inline-flex;
  align-items: center;
  justify-self: end;
}

.language img {
  display: block;
  width: 1.35rem;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}

.brand {
  display: block;
  grid-column: 2;
  width: min(13rem, 44vw);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

main {
  width: min(100% - 2.5rem, var(--measure));
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(5rem, 10vw, 8rem);
}

.intro {
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.status,
.section-label {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.26rem color-mix(in srgb, var(--accent) 18%, transparent);
}

h1,
h2 {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

h1 {
  max-width: 46rem;
  margin: 0 0 1.4rem;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: balance;
}

.dek {
  max-width: 41rem;
  margin: 0;
  color: var(--muted);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.18rem, 3vw, 1.48rem);
  line-height: 1.5;
}

.published,
.github {
  padding: clamp(2.2rem, 5vw, 3.4rem) 0;
  border-top: 1px solid var(--accent);
}

.published h2,
.github h2 {
  max-width: 44rem;
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 400;
  line-height: 1.24;
  text-wrap: balance;
}

.published h2 a {
  color: inherit;
  text-decoration: none;
}

.published h2 a:hover {
  color: var(--link);
}

.published p:not(.section-label),
.github p:not(.section-label) {
  max-width: 42rem;
  margin: 0 0 1.25rem;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.7;
}

.text-link {
  display: inline-block;
  font-weight: 700;
}

.text-link::after {
  content: " →";
  color: var(--accent);
}

.legal-page {
  padding-top: clamp(3rem, 8vw, 5.5rem);
}

.legal-intro {
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.legal-content section {
  padding: clamp(1.8rem, 4vw, 2.6rem) 0;
  border-top: 1px solid var(--accent);
}

.legal-content h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 400;
  line-height: 1.25;
}

.legal-content p {
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.7;
}

.legal-content p + p {
  margin-top: 0.35rem;
}

.site-footer {
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--accent);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

@media (min-width: 42rem) {
  h1 {
    white-space: nowrap;
  }

  .title-subject {
    white-space: nowrap;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #151718;
    --paper: #1b1e20;
    --ink: #f0eee8;
    --muted: #aaaead;
    --line: #35393b;
    --accent: #ff0000;
    --link: #77cbd2;
  }

  .brand img {
    filter: invert(1);
  }
}

@media (max-width: 34rem) {
  .site-header {
    grid-template-columns: 1fr auto 1fr;
    padding-inline: 1rem;
  }

  .header-link {
    font-size: 0.68rem;
  }

  .header-actions {
    gap: 0.55rem;
  }

  .brand {
    width: min(11rem, 36vw);
  }
}

@media print {
  :root {
    --page: #fff;
    --paper: #fff;
    --ink: #000;
  }

  .site-header,
  .site-footer {
    display: none;
  }

  main {
    padding: 0;
  }
}
