:root {
  --header-height: 88px;
}

html {
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  padding-top: var(--header-height);
}

.skip-link {
  position: fixed;
  z-index: 1100;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--header-height);
  display: block;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 100%;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header nav {
  height: 100%;
  gap: 26px;
  flex-shrink: 0;
}

.site-header .study-nav {
  justify-self: end;
  gap: 10px;
}

.analysis-index-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 12px;
  white-space: nowrap;
}

.analysis-index-link[aria-current] {
  color: var(--blue-soft);
}

.site-header .study-nav a {
  min-height: 60px;
  padding: 9px 13px;
  gap: 16px;
  border: 1px solid #245777;
  border-radius: 4px;
  background: #102330;
  transition: border-color .15s ease, background-color .15s ease;
}

.site-header .study-nav a:hover,
.site-header .study-nav a:focus-visible,
.site-header .study-nav a[aria-current] {
  border-color: var(--blue);
  background: #14384f;
}

.study-link-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.study-link-label {
  color: var(--blue-soft);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.study-link-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.site-header .section-nav {
  gap: 12px;
  font-size: 12px;
}

.site-header .header-x {
  padding-left: 16px;
}

.mobile-section-menu {
  display: none;
}

.site-header nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  white-space: nowrap;
}

.homepage main {
  display: flex;
  min-height: calc(100svh - var(--header-height));
}

.homepage .hero {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100svh - var(--header-height));
  padding-block: 0 18px;
}

.hero-content {
  margin-block: auto;
  padding-block: 36px;
}

.homepage .hero h1 {
  margin: 0 0 36px;
  font-size: clamp(40px, 5.9vw, 76px);
  line-height: 1.12;
  letter-spacing: -3.8px;
}

.homepage .hero-bottom {
  padding: 0;
  gap: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
}

.secondary-link:hover {
  border-color: var(--muted);
}

.homepage .hero-foot {
  border-bottom: 0;
  padding-block: 18px 0;
  flex-shrink: 0;
}

.homepage .hero-foot .feature-request-link {
  max-width: none;
  color: var(--blue-soft);
  text-align: left;
}

.feature-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.feature-request h2 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.4px;
}

.feature-request p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.feature-request .secondary-link {
  flex-shrink: 0;
}

.collection-page {
  padding-block: 40px 70px;
}

.growth-page h1,
.usage-page h1,
.algo-page h1 {
  margin: 0 0 24px;
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -1.8px;
}

.growth-intro {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.growth-intro p {
  margin: 0 0 16px;
}

.growth-disclaimer {
  max-width: 850px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.growth-disclaimer p {
  margin: 0 0 8px;
}

.growth-resources {
  max-width: 850px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.growth-resource {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.growth-category {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.growth-resource h2 {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.5px;
}

.growth-resource p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.growth-resource > span:last-child {
  color: var(--blue);
  font-size: 24px;
}

.usage-tips {
  max-width: 850px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: usage-tip;
}

.usage-tips li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px 20px;
  padding-block: 26px;
  border-top: 1px solid var(--line);
  counter-increment: usage-tip;
}

.usage-tips li::before {
  grid-row: 1 / 3;
  content: counter(usage-tip, decimal-leading-zero);
  padding-top: 4px;
  color: var(--blue-soft);
  font-size: 13px;
  line-height: 1.7;
}

.usage-tips h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.5px;
}

.usage-tips p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.usage-tips a {
  color: var(--blue-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.usage-tips q {
  color: var(--text);
}

.construction-graphic {
  max-width: 960px;
  margin: 36px 0 0;
}

.construction-graphic img {
  width: 100%;
  height: auto;
}

.experiments-heading {
  margin-bottom: 32px;
}

.experiments-heading h1 {
  margin: 0 0 12px;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -1.8px;
}

.experiments-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

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

.analysis-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1013;
  transition: border-color .15s ease, background-color .15s ease;
}

.analysis-card:hover,
.analysis-card:focus-visible {
  border-color: var(--blue);
  background: #0e151a;
}

.analysis-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .5px;
}

.analysis-meta > :first-child {
  color: var(--blue-soft);
}

.analysis-card h2 {
  margin: 32px 0 14px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
}

.analysis-card > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.analysis-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: auto;
  padding-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
}

.analysis-facts strong {
  color: var(--text);
  font-weight: 600;
}

.analysis-open {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--blue-soft);
  font-size: 13px;
  font-weight: 600;
}

.collection-page .section-heading h1,
.about-page h1 {
  margin: 14px 0 0;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -1.8px;
}

.about-page {
  min-height: calc(100svh - var(--header-height) - 160px);
  padding-block: 40px 70px;
}

.about-page h1 {
  font-size: clamp(36px, 4.7vw, 58px);
}

.about-page > p {
  max-width: 680px;
  margin-block: 28px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--muted);
}

.about-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

@media (max-width: 1000px) {
  .homepage .hero h1 {
    letter-spacing: -2.5px;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .primary-link,
  .hero-actions .secondary-link {
    padding-inline: 16px;
    gap: 15px;
  }

  .homepage .hero-bottom p {
    font-size: 16px;
  }
}

@media (max-width: 1200px) {
  :root {
    --header-height: 132px;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 56px 76px;
    gap: 0 24px;
  }

  .site-header .section-nav {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .site-header .study-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    gap: 10px;
  }
}

@media (max-width: 700px) {
  .feature-request {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

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

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

  .homepage .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: 132px;
  }

  .header-inner {
    grid-template-columns: auto 1fr;
    gap: 0 12px;
  }

  .site-header .wordmark {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-top: 5px;
  }

  .analysis-index-link {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-self: start;
    min-height: 24px;
    font-size: 11px;
  }

  .site-header nav {
    gap: 14px;
    font-size: 11px;
  }

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

  .mobile-section-menu {
    display: block;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .mobile-section-menu summary {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 12px;
    list-style: none;
    cursor: pointer;
  }

  .mobile-section-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-section-menu[open] summary {
    border-color: var(--blue);
  }

  .site-header .mobile-section-menu nav {
    position: absolute;
    top: 52px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 220px;
    max-width: calc(100vw - 40px);
    height: auto;
    padding: 8px;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 16px 40px #0008;
  }

  .site-header .mobile-section-menu nav a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .site-header .study-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }

  .site-header .study-nav a {
    min-height: 64px;
    padding: 9px 10px;
    gap: 8px;
    white-space: normal;
    line-height: 1.4;
  }

  .study-link-label {
    font-size: 8px;
    letter-spacing: .3px;
  }

  .study-link-title {
    font-size: 11.5px;
    line-height: 1.3;
  }

  .homepage .hero {
    padding-bottom: 14px;
  }

  .hero-content {
    padding-block: 28px;
  }

  .homepage .hero h1 {
    font-size: clamp(32px, 8.4vw, 48px);
    line-height: 1.14;
    letter-spacing: -1.5px;
    margin-bottom: 26px;
  }

  .homepage .hero-bottom {
    gap: 22px;
  }

  .homepage .hero-bottom p {
    font-size: 15px;
    line-height: 1.6;
  }

  .hero-actions {
    width: 100%;
    gap: 10px;
  }

  .hero-actions .primary-link,
  .hero-actions .secondary-link {
    min-height: 44px;
    padding: 11px 14px;
    font-size: 12px;
  }

  .homepage .hero-foot {
    padding-top: 16px;
    font-size: 10px;
    line-height: 1.6;
  }

  .collection-page {
    padding-block: 28px 50px;
  }

  .growth-page h1,
  .usage-page h1,
  .algo-page h1 {
    letter-spacing: -1.3px;
  }

  .usage-tips li {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px 12px;
    padding-block: 22px;
  }

  .usage-tips h2 {
    font-size: 22px;
  }

  .usage-tips p {
    font-size: 15px;
  }

  .growth-intro {
    font-size: 16px;
  }

  .growth-resource {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding-block: 22px;
  }

  .growth-category {
    grid-column: 1;
  }

  .growth-resource > div {
    grid-column: 1;
  }

  .growth-resource > span:last-child {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .growth-resource h2 {
    font-size: 22px;
  }

  .collection-page .section-heading h1 {
    font-size: 34px;
    letter-spacing: -1.3px;
  }

  .experiments-heading h1 {
    font-size: 34px;
    letter-spacing: -1.3px;
  }

  .experiments-heading p {
    font-size: 15px;
  }

  .analysis-card {
    padding: 24px;
  }

  .analysis-card h2 {
    margin-top: 24px;
    font-size: 29px;
  }

  .about-page {
    padding-block: 28px 50px;
  }

  .about-page h1 {
    font-size: 37px;
    letter-spacing: -1.4px;
  }

  .about-page > p {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .site-header .wordmark {
    font-size: 20px;
  }

  .site-header .wordmark-fyi {
    font-size: 12px;
  }

  .site-header nav {
    gap: 10px;
    font-size: 10.5px;
  }

  .site-header .section-nav {
    gap: 0 10px;
  }

  .hero-content {
    padding-block: 12px;
  }

  .homepage .hero h1 {
    margin-bottom: 18px;
  }

  .homepage .hero-bottom {
    gap: 18px;
  }
}
