/* Tokens: the only place raw colors live. */
:root {
  --paper: #FFFFFF;
  --ink: #000000;
  --graphite: #5C5C5C;
  --rule: #D6D6D6;
  --wash: #F4F4F4;
  --blue: #1F3DFF;
  --highlight: #FFE94D;
  --highlight-soft: #FFF6B8;

  --font: "Fira Sans", system-ui, sans-serif;
  --t-xs: .8125rem;
  --t-s: .9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.3125rem;
  --t-xl: 1.75rem;
  --t-xxl: 2.75rem;

  /* Horizontal page padding; content spans the full viewport width. */
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --r-control: 6px;
  --r-box: 3px;
  --r-slab: 4px;
}

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

body,
h1,
h2,
h3,
h4,
p {
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* Base type */
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-m);
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1 {
  font-size: var(--t-xl);
  font-weight: 600;
  line-height: 1.15;
}

h2 {
  font-size: var(--t-l);
  font-weight: 600;
  line-height: 1.15;
}

a {
  color: var(--blue);
  text-underline-offset: .15em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: .5rem;
  left: .75rem;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-control);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Header */
.site-header {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header__brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 3.5rem;
  color: var(--ink);
  font-size: var(--t-m);
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  min-width: 0;
  /* Overlap the header's 1px rule so the active bar sits on the bottom edge. */
  margin-bottom: -1px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav__link {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-height: calc(3.5rem + 1px);
  color: var(--graphite);
  font-size: var(--t-s);
  text-decoration: none;
  white-space: nowrap;
}

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

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

.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--blue);
}

/* The nav scrolls, so an outside ring would be clipped. */
.site-nav__link:focus-visible {
  outline-offset: -3px;
}

/* Account controls share the existing header; the nav gets its own mobile row. */
.account-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: .5rem;
  margin-left: auto;
  min-height: 3.5rem;
}

.account-status {
  max-width: 12rem;
  font-size: var(--t-xs);
  color: var(--graphite);
}

@media (max-width: 760px) {
  .site-header {
    flex-wrap: wrap;
    column-gap: 1rem;
    row-gap: 0;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
  }
}
/* Main */
main {
  display: block;
  padding: 2.5rem var(--gutter) 4rem;
}

main:focus {
  outline: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-control);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-s);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--wash);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--ink);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  padding-inline: .5rem;
}

.btn--quiet:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: var(--rule);
  background: var(--paper);
  color: var(--graphite);
  text-decoration: none;
  cursor: not-allowed;
}

.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
  background: var(--wash);
}

.btn--quiet:disabled,
.btn--quiet[aria-disabled="true"] {
  border-color: transparent;
  background: transparent;
}

/* Selects */
select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 100%;
  min-height: 44px;
  padding: .5rem 2.5rem .5rem .75rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-control);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right .85rem center;
  background-repeat: no-repeat;
  background-size: .75rem auto;
  color: var(--ink);
  font-size: var(--t-m);
  line-height: 1.3;
  cursor: pointer;
}

select:disabled {
  border-color: var(--rule);
  background-color: var(--wash);
  color: var(--graphite);
  cursor: not-allowed;
}

/* Form field: label above control */
.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.field > label,
.field__label {
  color: var(--ink);
  font-size: var(--t-s);
  font-weight: 500;
}

/* Loading / error / empty messages */
.state {
  color: var(--graphite);
  font-size: var(--t-m);
}

/* Coming soon pages */
.coming-soon__note {
  margin-top: 3.5rem;
  color: var(--graphite);
  font-size: var(--t-xl);
  font-weight: 400;
  line-height: 1.15;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
