/* ThreadWare landing site — resets, fonts and link colours.
   All layout and colour lives inline in index.html, so this file stays small.
   IBM Plex Sans / Mono, SIL OFL 1.1, served locally — no external font CDN. */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/IBMPlexSans-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-500-latin.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #0E1216;
  color: #E9EDF0;
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: #FF6600; text-decoration: none; }
a:hover { color: #FF853D; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #FF6600;
  outline-offset: 2px;
}
img { max-width: 100%; }
input, textarea, button { font-family: inherit; }
::placeholder { color: #78838E; }

/* ------------------------------------------------------------------
   Mobile nav toggle (button is unhidden by js/site.js below 900px).
   ------------------------------------------------------------------ */
#nav-toggle {
  display: none;
  width: 40px; height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid #3D4A56;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
#nav-toggle span { display: block; height: 2px; background: #E9EDF0; border-radius: 1px; }
#nav-toggle:not([hidden]) { display: flex; }

/* Form status line states (set by js/site.js). */
#form-status.is-error { color: #FF853D; }
#form-status.is-ok    { color: #35C46F; }
button[disabled] { opacity: .6; cursor: progress; }

/* ------------------------------------------------------------------
   Tablet and below (≤ 900px): one column, menu button, tighter rhythm.
   Styles are inline in index.html, so these use !important overrides.
   ------------------------------------------------------------------ */
@media (max-width: 900px) {
  /* Header: hide the inline nav, show the menu button, drop "Request access"
     from the bar (it is repeated in the hero and contact). */
  header nav#site-nav { display: none !important; }
  header nav#site-nav.is-open {
    display: flex !important;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 0; padding: 8px 20px 16px;
    background: rgba(14,18,22,0.98);
    border-bottom: 1px solid #2A333C;
  }
  header nav#site-nav.is-open a { padding: 14px 0; border-top: 1px solid #2A333C; font-size: 17px !important; }
  header .tw-bar { padding: 12px 20px !important; gap: 16px !important; }
  header .tw-bar > div > a[href="#contact"] { display: none !important; }

  section > div[style*="grid-template-columns"],
  section div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  section, footer { padding-left: 20px !important; padding-right: 20px !important; }
  section { padding-top: 72px !important; }
  section#top { padding-top: 48px !important; }
  footer { padding-top: 56px !important; }

  section#top h1 { font-size: 38px !important; }
  section#top h1 + p { font-size: 18px !important; margin-top: 20px !important; }
  section h2 { font-size: 30px !important; }
  section h3 { font-size: 20px !important; }

  /* Hero CTA row: full-width stacked buttons. */
  section#top > div[style*="flex-wrap"] > a { flex: 1 1 100%; text-align: center; }
  section#top > div[style*="flex-wrap"] > span { flex: 1 1 100%; }

  /* Label/value rows: stack label above text instead of a fixed column. */
  section div[style*="grid-template-columns:170px"],
  section div[style*="grid-template-columns:260px"],
  section div[style*="grid-template-columns:64px"] { gap: 8px !important; padding-top: 20px !important; padding-bottom: 20px !important; }
  section div[style*="grid-template-columns:64px"] > span { font-size: 20px !important; }
  section div[style*="grid-template-columns:64px"] > p,
  section div[style*="grid-template-columns:260px"] > p { font-size: 17px !important; }

  /* "One record, every thread" list loses its left rule indent. */
  section#what div[style*="border-left"] { border-left: 0 !important; padding-left: 0 !important; }

  /* Cards and panel. */
  section#ai div[style*="border-radius:12px"] { padding: 18px !important; }
  section#ai img[style*="height:420px"] { height: 260px !important; }
  #contact > div { padding: 24px 20px !important; gap: 32px !important; }
  #contact h2 { font-size: 28px !important; }

  /* Footer stacks. */
  footer > div > div[style*="margin-left:auto"] { margin-left: 0 !important; flex-wrap: wrap; gap: 12px 20px !important; }
}

/* ------------------------------------------------------------------
   Phones (≤ 480px): tighten further.
   ------------------------------------------------------------------ */
@media (max-width: 480px) {
  section#top h1 { font-size: 32px !important; letter-spacing: -0.02em !important; }
  section#top h1 + p { font-size: 17px !important; }
  section h2 { font-size: 26px !important; }
  section, footer { padding-left: 16px !important; padding-right: 16px !important; }
  header .tw-bar { padding: 10px 16px !important; }
  header .tw-bar img { height: 22px !important; }
  header .tw-bar a[href*="play.google.com"] { padding: 8px 12px !important; font-size: 14px !important; }
  section#top img[alt="The ThreadWare home board"] { min-height: 180px; object-fit: cover; object-position: left top; }
  section#top div[style*="margin-top:64px"] { margin-top: 40px !important; border-radius: 10px !important; }
  section#about span[style*="font-size:34px"] { font-size: 28px !important; }
  #contact > div { padding: 20px 16px !important; }
  input, textarea { font-size: 16px !important; } /* prevents iOS zoom-on-focus */
}

/* ------------------------------------------------------------------
   Document pages (/privacy, /deleteaccount, /terms, /support).
   Lifted out of privacy/index.html's inline <style> so all four share
   one definition. Mirrors the MudBlazor look of PrivacyComponent.razor:
   centred title, mono caption date, content in a MudPaper-style panel.
   ------------------------------------------------------------------ */
.doc-wrap  { max-width: 1100px; margin: 0 auto; padding: 48px 32px 80px; }
.doc-title { font-size: 26px; font-weight: 800; text-align: center; color: #FF6600; margin: 0; letter-spacing: -0.01em; }
.doc-date  { display: block; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #78838E; margin: 8px 0 24px; }
.doc-back  { font-size: 14px; color: #A5B0BA; }

.doc-paper { background: #161C22; border: 1px solid #2A333C; border-radius: 12px; padding: 32px; font-size: 16px; line-height: 1.6; color: #A5B0BA; }
.doc-paper h2 { font-size: 22px; font-weight: 600; color: #E9EDF0; margin: 32px 0 10px; letter-spacing: -0.01em; }
.doc-paper h2:first-child { margin-top: 0; }
.doc-paper h3 { font-size: 17px; font-weight: 600; color: #E9EDF0; margin: 22px 0 8px; }
.doc-paper p  { margin: 0 0 12px; }
.doc-paper ul, .doc-paper ol { margin: 0 0 12px; padding-left: 22px; }
.doc-paper li { margin: 4px 0; }
.doc-paper strong { color: #E9EDF0; font-weight: 600; }

/* Body copy is indented off the panel edge; h2/h3 stay flush left so the
   section headings read as the outer rail. Child selectors only, so nested
   lists inside an <li> are not indented a second time. --doc-indent shrinks
   on narrow screens, where the horizontal room is worth more. */
.doc-paper { --doc-indent: 18px; }
.doc-paper > p               { padding-left: var(--doc-indent); }
.doc-paper > ul,
.doc-paper > ol              { padding-left: calc(22px + var(--doc-indent)); }
.doc-paper > .doc-note,
.doc-paper > .doc-scroll     { margin-left: var(--doc-indent); }

/* Opening paragraph, one step up in size. */
.doc-lead { font-size: 17px; color: #C3CCD4; }

/* Primary action (the "email us to delete your account" link). */
.doc-cta {
  display: inline-block;
  font-size: 16px; font-weight: 600;
  color: #14181C; background: #FF6600;
  border-radius: 8px; padding: 13px 20px;
  margin: 4px 0 12px;
}
.doc-cta:hover { color: #14181C; background: #FF853D; }

/* Callout for "what to expect" / caveats. Left rule, no fill. */
.doc-note {
  border-left: 2px solid #FF6600;
  padding: 2px 0 2px 16px;
  margin: 0 0 16px;
}
.doc-note p:last-child { margin-bottom: 0; }

/* Numbered route ("do this, then this"). */
.doc-steps li { margin: 8px 0; }

/* Deleted / retained tables. Wrapper scrolls rather than the page. */
.doc-scroll { overflow-x: auto; margin: 0 0 16px; }
.doc-table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid #2A333C; }
.doc-table th { color: #E9EDF0; font-weight: 600; }
.doc-table tr:last-child td { border-bottom: 0; }

@media (max-width: 900px) {
  .doc-wrap  { padding: 32px 20px 64px; }
  .doc-paper { padding: 20px; --doc-indent: 12px; }
}
@media (max-width: 480px) {
  .doc-wrap  { padding: 24px 16px 56px; }
  .doc-paper { padding: 16px; --doc-indent: 8px; }
  .doc-title { font-size: 22px; }
  /* The indent eats into the scroll wrapper, so let the tables go narrower
     before they start scrolling. */
  .doc-table { min-width: 380px; }
}
