:root {
  --bg: #fffefa;
  --ink: #20201d;
  --muted: #6d685f;
  --faint: #e7e1d8;
  --accent: #5f7384;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
  letter-spacing: -0.004em;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(95, 115, 132, 0.16);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

a {
  color: var(--ink);
  text-decoration-color: rgba(77, 98, 104, 0.38);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease, transform 160ms ease;
}

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

a:focus-visible {
  outline: 2px solid rgba(77, 98, 104, 0.55);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  transform: translateY(-180%);
  background: var(--bg);
  border: 1px solid var(--faint);
  padding: 0.4rem 0.55rem;
  z-index: 1;
}

.skip:focus {
  transform: translateY(0);
}

.page {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 42px 0 78px;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 78px;
  font-size: 15px;
  line-height: 1.4;
}

.name {
  font-weight: 600;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 13px;
}

.site-nav [aria-current="page"] {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

h1 {
  max-width: 15.5ch;
  margin: 0;
  font-size: 60px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.home-title {
  max-width: none;
}

.home-title span {
  display: block;
  white-space: nowrap;
}

.detail-title {
  max-width: none;
  font-size: 56px;
}

.detail-meta {
  display: grid;
  gap: 5px;
  max-width: 34rem;
  margin: 30px 0 54px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.detail-meta strong {
  color: var(--ink);
  font-weight: 500;
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(77, 98, 104, 0.34);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

.button-link:hover {
  border-color: rgba(77, 98, 104, 0.7);
  background: rgba(95, 115, 132, 0.07);
  color: var(--ink);
}

.button-link:active {
  transform: translateY(1px);
}

.detail-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
}

.detail-block {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.detail-block h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.detail-block p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.58;
}

.detail-block code {
  font-family: inherit;
  font-size: 0.98em;
  color: inherit;
  background: rgba(95, 115, 132, 0.08);
  border-radius: 3px;
  padding: 0.02em 0.18em;
}

.detail-block p + p {
  margin-top: 14px;
}

.article-figure {
  justify-self: center;
  width: min(calc(100vw - 32px), 1100px);
  max-width: calc(100vw - 32px);
  margin: 2px 0 4px;
}

.detail-block > .article-figure {
  margin-top: 18px;
  margin-bottom: 20px;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.case-quote {
  position: relative;
  margin: 20px 0 18px;
  padding: 22px 0 24px 28px;
  border-left: 2px solid var(--accent);
}

.case-quote p {
  max-width: 31rem;
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.case-quote p::before {
  content: open-quote;
}

.case-quote p::after {
  content: close-quote;
}

.case-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 44px;
  margin: 22px 0 2px;
  padding-left: 28px;
  border-left: 2px solid var(--accent);
}

.case-metrics .metric {
  display: grid;
  gap: 5px;
}

.case-metrics .figure {
  color: var(--ink);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.018em;
  white-space: nowrap;
}

.case-metrics .label {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}

.detail-list.detail-bullets {
  padding-left: 1.15rem;
  list-style: disc;
  list-style-position: outside;
}

.detail-list.article-list {
  gap: 14px;
}

.detail-list strong {
  font-weight: 500;
}

.detail-block p + .detail-list,
.detail-block .detail-list + p {
  margin-top: 14px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs [aria-current="page"] {
  color: var(--accent);
}

.intro {
  max-width: 36rem;
  margin: 28px 0 0;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.018em;
  text-wrap: pretty;
}

.note {
  max-width: 38rem;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.66;
}

.section {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 2rem;
  padding: 31px 0 35px;
  border-top: 1px solid var(--faint);
  scroll-margin-top: 2rem;
}

.section:first-of-type {
  margin-top: 64px;
}

.section-compact:first-of-type {
  margin-top: 38px;
}

.section:target h2 {
  color: var(--accent);
}

h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.items {
  display: grid;
  gap: 22px;
}

.items article h3 {
  margin: 0;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.items article p {
  max-width: 33rem;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.meta {
  margin-top: 5px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-top: 74px;
  padding-top: 26px;
  border-top: 1px solid var(--faint);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section-compact + .site-footer {
  margin-top: 38px;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    transition-delay: 0.001ms !important;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 17px;
  }

  .page {
    width: min(calc(100% - 28px), var(--max));
    padding-top: 26px;
  }

  .section,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    margin-bottom: 56px;
  }

  .site-nav {
    gap: 0.75rem;
  }

  h1 {
    font-size: 40px;
    line-height: 1.02;
  }

  .detail-title {
    font-size: 40px;
  }

  .home-title span {
    white-space: normal;
  }

  .detail-flow {
    gap: 30px;
  }

  .detail-block p,
  .detail-list {
    font-size: 16px;
  }

  .case-quote {
    margin: 18px 0 16px;
    padding: 18px 0 20px 20px;
  }

  .case-quote p {
    font-size: 21px;
    line-height: 1.32;
  }

  .intro {
    max-width: 100%;
    font-size: 22px;
  }

  .section {
    gap: 12px;
    padding: 27px 0 31px;
  }

  .section:first-of-type {
    margin-top: 52px;
  }

  .section-compact:first-of-type {
    margin-top: 34px;
  }

  .section-compact + .site-footer {
    margin-top: 28px;
  }
}
