/* fitcode base styles: the design tokens, the page frame, and pieces every page shares. */

:root {
  --bg: #F6F5F2;
  --ink: #121212;
  --ink-2: #5E5E5A;        /* secondary text: 6:1 contrast on --bg */
  --chip: #E9E8E3;
  --chip-hover: #DCDBD5;
  --line: #E4E3DE;
  --card: #FFFFFF;
  --accent: #E0481F;       /* small markers only, never text */

  --sans: 'Host Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --header: 64px;
  --gutter: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--ink-2); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

/* Hidden on screen but still read out by screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transition: top .2s ease;
}
.skip:focus { top: 12px; color: var(--bg); }

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  background: var(--bg);
}
.top-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: flex; align-items: center; gap: 6px; }
.logo {
  margin-right: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.03em;
  text-decoration: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}
.chip:hover { background: var(--chip-hover); color: var(--ink); }
.chip[aria-current="page"] { background: var(--ink); color: var(--bg); }
.chip sup { font-size: 9px; opacity: .7; }

.top-sound { justify-self: end; display: flex; align-items: center; gap: 10px; }
.sound {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  cursor: pointer;
  transition: transform .3s ease;
}
.sound:hover { transform: scale(1.08); }
.sound .bar {
  display: block;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: var(--bg);
  transform: scaleY(.35);
}
.sound[aria-pressed="true"] .bar { animation: eq var(--beat, 1s) ease-in-out infinite; }   /* --beat is set by sound.js */
.sound .bar:nth-child(2) { animation-delay: .25s; }
.sound .bar:nth-child(3) { animation-delay: .5s; }
.sound .bar:nth-child(4) { animation-delay: .12s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---------- Buttons ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform .35s var(--ease), background-color .3s ease;
}
.pill:hover { transform: translateY(-2px); }
.pill-dark { background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); }
.pill-dark:hover { background: #2A2A28; color: var(--bg); }
.pill-light { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.pill .arrow { display: inline-block; transition: transform .35s var(--ease); }
.pill:hover .arrow { transform: translateX(4px); }

/* ---------- Pages that aren't built yet ---------- */

#view { outline: none; }
.soon {
  max-width: 640px;
  min-height: calc(100vh - var(--header));
  margin: 0 auto;
  padding: 40px var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
}
.soon h1 { margin: 0; font-size: clamp(40px, 7vw, 64px); line-height: 1; letter-spacing: -.04em; font-weight: 500; }
.soon-text { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.noscript { padding: 40px var(--gutter); }

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  :root { --header: 60px; --gutter: 16px; }
  .top { grid-template-columns: minmax(0, 1fr) auto; }
  .top-note, #sound-text, .chip sup { display: none; }
  .logo { margin-right: 4px; }
  .chip { padding: 0 9px; }
}

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