/* ==========================================================================
   BMS Development Studio — site styles
   One stylesheet. No build step, no preprocessor.

   All colour lives in the custom properties below. Change the token,
   never the usage. Light and dark are both defined; dark is driven by
   prefers-color-scheme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surface and text */
  --paper: #ECEDF2;
  --tile: #FFFFFF;
  --ink: #16192A;
  --muted: #565C74;
  --line: #D6D9E4;

  /* Accent. Two blues on purpose: the deep cobalt loses contrast on dark
     grounds, so dark mode uses the lighter one. Don't collapse them. */
  --accent: #1F49D6;
  --accent-soft: #DEE6FB;

  /* Text that sits on top of a solid --accent fill. Follows the accent:
     white on cobalt, near-black on the light dark-mode blue. */
  --on-accent: #FFFFFF;

  /* Shape. 30px is the widget radius the whole page is built around. */
  --radius-tile: 30px;
  --radius-inner: 18px;
  --radius-pill: 999px;

  /* Rhythm */
  --gap: 20px;
  --pad-tile: 28px;
  --wrap: 1080px;
  --measure: 64ch;

  /* Tiles are flat: a hairline separates them from the ground, no shadow. */
  --shadow-tile: none;
  --tile-border: 1px solid var(--line);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1119;
    --tile: #191D2B;
    --ink: #EDEEF4;
    --muted: #9AA1BA;
    --line: #2A3044;
    --accent: #7FA3FF;
    --accent-soft: #1A2440;
    --on-accent: #0F1119;
  }
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 1.4rem + 3.2vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
}

h3 {
  font-size: 1.25rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

p:last-child,
ul:last-child,
ol:last-child,
dl:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

strong {
  font-weight: 600;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 10;
  transform: translateY(-200%);
  background: var(--tile);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}

.muted {
  color: var(--muted);
}

.measure {
  max-width: var(--measure);
}

/* --------------------------------------------------------------------------
   4. Header and footer
   -------------------------------------------------------------------------- */

.site-header {
  padding: clamp(20px, 3vw, 32px) 0;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px;
  margin-inline-start: -4px;
  text-decoration: none;
  border-radius: 10px;
}

.brand img {
  width: 132px;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--tile);
  color: var(--accent);
}

.site-footer {
  margin-top: auto;
  padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 40px);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer__inner {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  align-items: baseline;
  justify-content: space-between;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer__legal {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   5. Tiles and grid — the Home Screen
   -------------------------------------------------------------------------- */

main {
  padding-bottom: clamp(24px, 4vw, 40px);
}

.section {
  margin-top: clamp(32px, 5vw, 56px);
}

/* The hero is the first thing under the header, so it keeps no top margin. */
.section--hero {
  margin-top: 0;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: var(--gap);
  padding-inline: 4px;
}

.section__head h2 {
  margin: 0;
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

.tile {
  background: var(--tile);
  border: var(--tile-border);
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-tile);
  padding: var(--pad-tile);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile > :last-child {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile--fit {
    align-self: start;
  }
}

@media (min-width: 940px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tile--flat {
  background: none;
  box-shadow: none;
  border-color: transparent;
  padding-inline: 4px;
}

.tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

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

.btn--secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn--secondary:hover {
  background: var(--line);
  color: var(--ink);
}

.btn--quiet {
  background: none;
  border-color: var(--line);
  color: var(--ink);
}

.btn--quiet:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   7. Leads, status lines and the app list
   -------------------------------------------------------------------------- */

/* Every page opens with its headline set directly on the ground, no tile. */
.bare-lead {
  padding: clamp(8px, 2vw, 20px) 4px clamp(4px, 1vw, 12px);
}

.bare-lead h1 {
  max-width: 20ch;
}

.bare-lead--xl h1 {
  font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.5rem);
  max-width: 18ch;
}

.lead-status {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 12px;
}

/* Inner pages pair the lead with a short spec list on the right. */
@media (min-width: 860px) {
  .lead-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
}

.lead-specs {
  padding: clamp(8px, 2vw, 20px) 4px 0;
}

.lead-specs .tile__title {
  margin-bottom: 8px;
}

/* The app index reads as rows, not cards: name, one line, where to go. */
.app-list {
  border-top: 1px solid var(--line);
}

.app-row {
  display: grid;
  gap: 12px 40px;
  padding: clamp(22px, 2.6vw, 32px) 4px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
  .app-row {
    grid-template-columns: minmax(0, 22ch) minmax(0, 1fr) auto;
    align-items: start;
    gap: 0 40px;
  }
}

.app-row__head {
  min-width: 0;
}

.app-row h3 {
  margin: 0;
  font-size: 1.3125rem;
}

.app-row h3 a {
  color: var(--ink);
  text-decoration: none;
}

.app-row h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.app-row__status {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 2px 0 0;
}

.app-row__body {
  color: var(--muted);
  margin: 0;
}

.app-row .tile__actions {
  margin: 0;
}

/* --------------------------------------------------------------------------
   8. Tile heading
   -------------------------------------------------------------------------- */

.tile__title {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.15;
  margin: 0;
}

/* --------------------------------------------------------------------------
   9. Spec list
   -------------------------------------------------------------------------- */

.specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}

.specs > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.specs > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.specs dt {
  color: var(--muted);
  font-size: 0.9375rem;
}

.specs dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

/* --------------------------------------------------------------------------
   10. Long-form pages (support, privacy)
   -------------------------------------------------------------------------- */

.tile--prose {
  max-width: calc(var(--measure) + 2 * var(--pad-tile));
}

.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin-top: 2rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 0.4em;
}

/* A placeholder that has not been filled in yet. Deliberately loud so it
   cannot ship by accident. */
.todo {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0 6px;
  font-weight: 600;
  font-size: 0.9em;
}
