/* ==========================================================================
   Public pages — About and Docs.

   Loaded alongside app.css, which still owns every token, font-face and base
   component (buttons, cards, tables, badges). Nothing here redeclares a
   colour or a font; it only adds the layout these two pages need that the
   authenticated app never did: a public header, a hero, a docs sidebar, and
   the comparison table.
   ========================================================================== */

body { background: var(--paper); }

.pubnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.5rem;
  column-gap: 1.5rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.pubnav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.35rem;
  flex: 1;
  font-size: 0.88rem;
}

.pubnav__links a { color: var(--ink-2); text-decoration: none; }
.pubnav__links a:hover { color: var(--ink); }
.pubnav__links a[aria-current='page'] { color: var(--ink); font-weight: 600; }

/* flex-shrink: 0 so the actions keep their own width and, if the row is too
   narrow for everything, it's .pubnav__links (least essential — the wordmark
   already links home) that wraps to a second line first. */
.pubnav__actions { display: flex; align-items: center; flex-shrink: 0; gap: 0.6rem; }

/* --- Hero ------------------------------------------------------------ */

.pubhero {
  background: var(--panel);
  color: var(--on-panel);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 3vw, 2rem);
}

.pubhero__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  gap: 1.75rem;
}

.pubhero .wordmark { color: var(--on-panel); }

.pubhero__lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 18ch;
}

.pubhero__strip { min-height: 3.5rem; display: flex; align-items: center; }

.pubhero .tile {
  background: color-mix(in srgb, var(--tile-colour) 20%, #000 12%);
  border-color: color-mix(in srgb, var(--tile-colour) 45%, transparent);
  color: color-mix(in srgb, var(--tile-colour) 72%, #fff);
}
.pubhero .tile[data-tint='digits'],
.pubhero .tile[data-tint='symbol'] { --tile-colour: var(--on-panel-2); color: var(--on-panel); }

.pubhero__note {
  font-size: 0.95rem;
  color: var(--on-panel-2);
  max-width: 48ch;
}

.pubhero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* --- Shared content width -------------------------------------------- */

.pubmain {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem) 5rem;
}

.pubmain > * + * { margin-block-start: clamp(2rem, 5vw, 3.25rem); }

.prose { max-width: 68ch; }
.prose p { margin-block-end: 1rem; }
.prose p:last-child { margin-block-end: 0; }
.prose > * + * { margin-block-start: 1rem; }

/* --- About: two philosophies, side by side ---------------------------- */

.split-intro {
  display: grid;
  gap: 2rem;
}

@media (min-width: 52rem) {
  .split-intro { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .split-intro__col + .split-intro__col { padding-inline-start: 3rem; border-inline-start: 1px solid var(--line); }
}

.split-intro__col h2 { font-size: 1.2rem; margin-block-end: 0.6rem; }
.split-intro__col p { color: var(--ink-2); }

/* --- Comparison table --------------------------------------------------- */

.table-wrap { -webkit-overflow-scrolling: touch; }

.compare { border-collapse: collapse; width: 100%; }
.compare th, .compare td { padding: 0.7rem 0.9rem; }

/* The base `th` rule elsewhere forces nowrap, which is fine for short data
   labels but clipped "Password Ninja Pro"-length headers on a phone screen.
   Headers are short single words now ("Standard"/"Pro"), so letting them wrap
   is just insurance; auto table-layout is what actually matters here — a
   fixed percentage split gave "-" the same column width as "Up to 25 lists,
   5,000 words each", cramming the long values into a sliver on a phone
   instead of letting the browser give each column what its content needs. */
.compare thead th {
  position: sticky;
  top: 3.6rem;
  background: var(--surface);
  white-space: normal;
}
.compare tbody th {
  text-align: start;
  font-weight: 500;
  color: var(--ink);
  white-space: normal;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.87rem;
}
.compare td { text-align: center; font-size: 0.87rem; }
.compare td:first-of-type,
.compare th:first-child { text-align: start; }

.compare__group th {
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Below this, three real columns of prose don't fit a phone regardless of
   layout algorithm — "Up to 25 lists, 5,000 words each" needs more width
   than a third of 380px can give it. So each row becomes a small stack
   instead: the feature name as a heading, Standard and Pro underneath it
   with their own labels, which is the standard way to make a comparison
   table readable on a narrow screen rather than merely less cramped. */
@media (max-width: 34rem) {
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .compare, .compare tbody, .compare tr { display: block; width: 100%; }
  .compare__group th { display: block; position: static; padding: 0.5rem 0.9rem; }
  .compare tbody tr:not(.compare__group) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
  }
  .compare tbody tr:last-child { border-bottom: none; }
  .compare tbody th {
    grid-column: 1 / -1;
    padding: 0 0 0.4rem;
    font-weight: 600;
  }
  .compare td {
    display: block;
    width: auto;
    padding: 0;
    text-align: start;
    font-size: 0.85rem;
  }
  .compare td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-block-end: 0.2rem;
  }
}

.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--ink-3); }
.compare .value { font-size: 0.84rem; color: var(--ink-2); }

/* --- Highlight cards (used sparingly, not as a repeating grid kit) ---- */

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}

/* --- Docs shell --------------------------------------------------------- */

.docs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem) 6rem;
}

@media (min-width: 62rem) {
  .docs { grid-template-columns: 15rem 1fr; align-items: start; gap: 3rem; }
}

.docs__nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 62rem) {
  .docs__nav { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
}

.docs__group { display: flex; flex-direction: column; gap: 0.15rem; }
.docs__group-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.3rem 0.7rem;
}

.docs__nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.87rem;
}
.docs__nav a:hover { background: var(--surface); color: var(--ink); }
.docs__nav a.active { background: var(--surface); color: var(--violet); font-weight: 600; box-shadow: var(--shadow); }

.docs__content { min-width: 0; }

.docs__content section { scroll-margin-top: 5.5rem; }
.docs__content section + section {
  margin-block-start: 3rem;
  padding-block-start: 3rem;
  border-top: 1px solid var(--line);
}

.docs__content h2 { font-size: 1.55rem; margin-block-end: 0.6rem; }
.docs__content h3 {
  font-size: 1.1rem;
  margin-block-start: 2rem;
  margin-block-end: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.docs__content h3:first-child { margin-block-start: 0; }
.docs__content > section > p.lead { color: var(--ink-2); max-width: 62ch; margin-block-end: 1.25rem; }
.docs__content p { max-width: 68ch; }
.docs__content p + p { margin-block-start: 0.85rem; }
.docs__content .table-wrap { margin-block: 0.85rem 1.1rem; }
.docs__content .code { margin-block: 0.6rem 1.1rem; }
.docs__content ul, .docs__content ol { max-width: 68ch; padding-inline-start: 1.3rem; margin: 0.6rem 0 1.1rem; }
.docs__content li + li { margin-block-start: 0.35rem; }

.method {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  color: #fff;
}
.method--get { background: var(--tint-green); }
.method--post { background: var(--violet); }
.method--patch { background: var(--tint-orange); }
.method--delete { background: var(--danger); }

.path { font-family: var(--font-mono); font-size: 0.95rem; }

.codehead {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-block-end: 0.3rem;
}

/* --- Closing CTA ---------------------------------------------------------- */

.pubcta { text-align: center; display: grid; gap: 0.75rem; justify-items: center; }

/* --- Footer -------------------------------------------------------------- */

.pubfoot {
  border-top: 1px solid var(--line);
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 2.5rem;
}
.pubfoot__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.pubfoot__inner a { color: var(--ink-2); }
