/* Reset, shell layout, and the quality floor (focus, motion, responsiveness). */

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -240px, #10192a 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--data);
  text-decoration-color: color-mix(in srgb, var(--data) 40%, transparent);
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-ligatures: none;
}

/* Quality floor: every interactive control shows a visible focus ring. */
:focus-visible {
  outline: 2px solid var(--data);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 50;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-2) var(--s-4);
  transition: top var(--motion-tamper);
}
.skip-link:focus {
  top: var(--s-3);
}

/* ---- App shell ---------------------------------------------------------- */

.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-5);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

.shell-nav {
  display: flex;
  gap: var(--s-1);
  margin-left: auto;
  /* min-width:0 is what actually lets the flex item clip instead of spilling
     past the viewport on narrow screens. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.shell-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  padding: var(--s-1) var(--s-3);
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--ink);
}
.nav-link[aria-current="page"] {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel);
}

.shell-main {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--s-6) var(--s-5) var(--s-7);
}

.shell-footer {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--s-5);
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint);
  font-size: var(--step--1);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
}

/* ---- Generic layout primitives ------------------------------------------ */

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.stack-tight {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  /* Rows must be able to shrink so their nowrap children can ellipsize
     rather than push the page wider than the viewport. */
  min-width: 0;
  max-width: 100%;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--s-5);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.lede {
  color: var(--ink-muted);
  max-width: 68ch;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .shell-header {
    padding: 0 var(--s-4);
    gap: var(--s-3);
  }
  .brand span {
    display: none;
  }
  .shell-main {
    padding: var(--s-5) var(--s-4) var(--s-6);
  }
}
