/* Shared stylesheet for the static, indexable pages (`/`, the tenant site and
   the two legal documents). These pages are plain HTML on purpose — Flutter
   web paints into a <canvas>, so nothing it renders is crawlable. See
   `.ai/SEO.md`.

   Colours mirror `packages/theme/lib/src/color_styling.dart`. They are
   duplicated here rather than generated because these pages ship without the
   Dart toolchain; if a brand colour changes there, change it here too.

   Light only, on purpose. `ThemeController.load()` sets dark from a stored
   preference and nothing else — `isDark = stored == 'dark'` — so it never
   follows the operating system, and a first-time visitor to the Flutter
   pages always saw light. A `prefers-color-scheme` block here would put a
   page in dark that the app itself would have shown light, and would hide
   the logo, whose SVG paints a fixed `#232673`. */

:root {
  --brand-50: #f0f1fc;
  --brand-100: #e1e2fc;
  --brand-200: #ccccf8;
  --brand-400: #9087f6;
  --brand-500: #7561eb;
  --brand-600: #5f47cf;
  --brand-700: #4931a8;
  --brand-800: #311a7a;
  --logo-mark: #232673;

  --page: #f6f6f9;
  --card: #ffffff;
  --sunken: #f3f3f7;
  --border: #e0e1e5;

  --text-primary: #1e1f26;
  --text-secondary: #5c5d64;
  --text-muted: #88898e;
  --on-brand: #ffffff;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 20px -10px rgba(16, 24, 40, 0.12);
  --shadow-raised: 0 2px 6px rgba(16, 24, 40, 0.06), 0 18px 40px -22px rgba(16, 24, 40, 0.28);

  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --shell: 1180px;
  --gutter: 24px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* `display:block` above outranks the user agent's `[hidden]{display:none}`,
   so an inline SVG toggled with the attribute would otherwise stay visible —
   which is how both theme icons ended up drawn at once. */
img[hidden],
svg[hidden] {
  display: none;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}

a:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

/* Visible only to screen readers and crawlers — used for the headings that
   the visual design expresses through layout rather than text. */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--card);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

section {
  padding: 72px 0;
}

@media (max-width: 760px) {
  section {
    padding: 48px 0;
  }
}

.section-sunken {
  background: var(--sunken);
}

.section-card {
  background: var(--card);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 10px;
}

.section-title {
  font-size: 32px;
  margin-bottom: 12px;
}

.section-lede {
  color: var(--text-secondary);
  max-width: 62ch;
  font-size: 17px;
}

.section-head {
  margin-bottom: 40px;
}

.section-head.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-head.center .section-lede {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 760px) {
  .section-title {
    font-size: 26px;
  }
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--brand-700);
  color: var(--on-brand);
}

.btn-secondary {
  background: var(--card);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--brand-400);
  color: var(--text-primary);
}

.btn-ghost-on-brand {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-ghost-on-brand:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-lockup:hover {
  text-decoration: none;
  color: var(--text-primary);
}

.brand-lockup img {
  height: 32px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.site-nav a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-primary);
  cursor: pointer;
}

/* No JS: the menu button is pointless, so it never appears and the nav links
   stay visible at every width instead. The `js` class is set by the inline
   script at the top of each page. */
@media (max-width: 900px) {
  .js .site-nav,
  .js .header-actions .btn-secondary {
    display: none;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .mobile-menu[hidden] {
    display: none;
  }

  .js .mobile-menu {
    display: block;
    border-top: 1px solid var(--border);
    background: var(--card);
    padding: 16px var(--gutter) 24px;
  }

  /* `:not(.btn)` matters: this rule is more specific than `.btn`, so without
     it the two buttons in the menu render as plain blocks — left-aligned text,
     no pill, no height. */
  .js .mobile-menu a:not(.btn) {
    display: block;
    padding: 10px 0;
    font-weight: 600;
    color: var(--text-primary);
  }

  .js .mobile-menu .btn {
    margin-top: 8px;
  }
}

@media (min-width: 901px) {
  .mobile-menu {
    display: none;
  }
}

.site-nav {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .site-header .shell {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
  }
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Company/Resources entries have no page behind them yet: printed, not
   linked. */
.footer-list li {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-list {
  list-style: none;
}

.footer-list li {
  margin-bottom: 8px;
}

.footer-list a {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --------------------------------------------------------------- dialog */

dialog.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text-primary);
  box-shadow: var(--shadow-raised);
  overflow: auto;
}

dialog.modal::backdrop {
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(2px);
}

.modal-body {
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.modal-head h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
}

.modal-lede {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-close {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--sunken);
  color: var(--text-primary);
}

/* ----------------------------------------------------------------- form */

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.field textarea {
  resize: vertical;
  min-height: 74px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-400);
  outline: 2px solid color-mix(in srgb, var(--brand-400) 35%, transparent);
  outline-offset: 0;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 380px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

.field-error {
  color: #b42318;
  font-size: 12px;
  margin-top: 5px;
}

.send-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 18px 0 10px;
}

.send-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 380px) {
  .send-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

dialog.modal-narrow {
  width: min(400px, calc(100vw - 32px));
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--brand-600);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--brand-50);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  margin: 4px 0 16px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand-600);
  cursor: pointer;
}

#login-error {
  margin: 0 0 14px;
}

#login-submit[disabled] {
  cursor: progress;
}

/* ---------------------------------------------------------------- prose */

.prose {
  max-width: 78ch;
  margin: 0 auto;
}

.prose h2 {
  font-size: 22px;
  margin: 36px 0 10px;
}

.prose h3 {
  font-size: 17px;
  margin: 24px 0 8px;
  font-weight: 700;
}

.prose p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 22px;
  list-style: disc;
  color: var(--text-secondary);
}

.prose li {
  margin-bottom: 6px;
}

.prose strong {
  color: var(--text-primary);
}

.doc-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}

/* ------------------------------------------------------------ tab strips */

/* `_TabChip` from the Flutter page: a pill that is brand-filled and white
   when selected, and a bordered card colour when not. Both tab strips on the
   landing page use it. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.tab-chip {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.tab-chip:hover {
  border-color: var(--brand-400);
  color: var(--text-primary);
}

.tab-chip[aria-selected="true"] {
  background: var(--brand-600);
  border-color: transparent;
  color: var(--on-brand);
}

/* Inactive panels stay in the document — the text inside them is the point of
   these pages, and a crawler reads it whether or not it is displayed. */
.tab-panel[hidden] {
  display: none;
}

.industry-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 900px) {
  .industry-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

.industry-panel h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.industry-panel .section-lede {
  font-size: 16px;
}

.mock-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.mock-panel .mock-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

/* ------------------------------------------------------- browser chrome */

/* The screens band's frame, with the address strip the Flutter page drew. */
.browser-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--sunken);
}

.browser-url {
  margin-left: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.browser-frame img {
  width: 100%;
  display: block;
}

/* ---------------------------------------------------------------- glyphs */

/* Single-colour icons, tinted the way `SvgPicture`'s `srcIn` filter tints
   them in the app — a CSS mask rather than an <img>, so one file serves any
   colour the design asks for. */
.glyph-tile {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-50);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.glyph {
  width: 22px;
  height: 22px;
  background-color: var(--brand-600);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.glyph-on-brand {
  background-color: #fff;
}

/* -------------------------------------------------------------- accordion */

.faq-item {
  border-top: 1px solid var(--border);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.faq-q::after {
  content: "+";
  flex: none;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1;
}

.faq-q[aria-expanded="true"]::after {
  content: "–";
  color: var(--brand-600);
}

.faq-a {
  color: var(--text-secondary);
  padding: 0 0 20px;
  max-width: 78ch;
}

/* No JS: every answer stays visible rather than being unreachable. */
.js .faq-a[hidden] {
  display: none;
}
