/* Base: reset, typography, layout helpers, header, buttons. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text);
  line-height: 1.6;
  overflow-wrap: break-word;
  hyphens: auto;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: var(--h1);
  line-height: 1.08;
}

h2 {
  font-size: var(--h2);
}

h3 {
  font-size: var(--h3);
  line-height: 1.25;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
}

.skip:focus {
  top: 1rem;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand__mark {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
}

.brand__mark-bg {
  fill: var(--brand);
}

.brand__mark-dot {
  fill: var(--highlight);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.nav a:not(.btn) {
  padding-block: 0.5rem;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
  transition: background-size 0.25s var(--ease);
}

.nav a:not(.btn):hover,
.nav a:not(.btn)[aria-current="true"] {
  background-size: 100% 2px;
}

.menu-toggle {
  display: none;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn--light {
  border-color: #ffffff;
  background: transparent;
  color: #ffffff;
}

.btn--light:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--brand);
}

.btn--small {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 15rem));
  gap: 1rem;
}

@media (max-width: 62rem) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a:not(.btn) {
    padding-block: 0.875rem;
    border-bottom: 1px solid var(--line);
    font-size: var(--text);
  }

  .nav .btn {
    margin-top: 1rem;
  }
}

@media (max-width: 36rem) {
  .btn-row {
    grid-template-columns: 1fr;
  }
}
