/*
 * astrodexa.com — the page's own layout, on dexa-style.
 *
 * Every colour, size, face and radius here is a dexa-style token, and every
 * button, card, chip, label, section and page head is a dx- unit from
 * base.css (copied from the pinned tag by build.sh). This file holds only what
 * the kit does not: the header bar, the masthead, the feature and plan grids,
 * the footer, and the legal-page column. No hex values, no local button or card
 * recipe: adopting a unit means the local copy is gone (STYLE-CONTRACT R5).
 *
 * Light is the default; dark is :root[data-theme='dark'], which the tokens
 * answer by themselves. Nothing here needs a theme rule.
 */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

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

/* ---- Header ------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--paper);
  border-bottom: var(--border-hairline) solid var(--rule);
}

.site-head__bar {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  min-height: 3.75rem;
}

/* The wordmark, as the site's masthead draws it: Playfair caps, the DEXA half
   in the brand green, the monogram on its own dark chip. */
.masthead {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.masthead:hover {
  color: var(--ink);
}

.masthead .dexa {
  color: var(--brand-green);
}

.masthead__glyph {
  flex: 0 0 auto;
  width: 1.3em;
  height: 1.3em;
  border-radius: var(--radius-xs);
  border: var(--border-hairline) solid var(--rule-strong);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  margin-left: auto;
}

.site-nav__link {
  font-family: var(--font-ui);
  font-size: var(--step--1);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
}

/* AT 640px AND BELOW (F3, Q1 APP-015) the two in-page links fold behind a
   Menu button instead of vanishing: the bar keeps the wordmark, Menu, the
   day/night switch and the way into the app, and Menu opens the links in a
   panel under the bar. js/nav.js marks the nav `data-nav-ready` when it has
   wired the button; without it the links simply stay in the bar. */
@media (max-width: 640px) {
  .site-head__bar {
    position: relative;
  }

  .masthead__glyph {
    display: none;
  }

  .site-head .masthead {
    font-size: var(--step-1);
  }

  .site-nav {
    gap: var(--space-2xs);
  }

  /* One row at 390: the bar's buttons keep their words on one line. */
  .site-nav .dx-btn {
    --dx-btn-pad-x: 0.6rem;
    white-space: nowrap;
  }

  /* 44px, as every control in the bar should be on a phone. */
  .site-nav__menu {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .site-nav[data-nav-ready] .site-nav__links {
    display: none;
  }

  .site-nav[data-nav-ready][data-open] .site-nav__links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: var(--z-header);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2xs) var(--space-s) var(--space-s);
    background: var(--paper);
    border-bottom: var(--border-hairline) solid var(--rule);
  }

  .site-nav[data-nav-ready][data-open] .site-nav__link {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    font-size: var(--step-0);
  }
}

@media (min-width: 641px) {
  .site-nav__menu {
    display: none;
  }
}

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

.hero {
  padding-block: var(--space-3xl) var(--space-2xl);
}

.hero .dx-page-head__title {
  max-width: 18ch;
}

.hero .dx-actions {
  margin-top: var(--space-m);
}

/* ---- Feature grid ------------------------------------------------------ */

.feature-grid {
  --dx-grid-min: 17rem;
  margin-top: var(--space-l);
  list-style: none;
}

.feature-grid p:not([class]) {
  color: var(--ink-soft);
}

/* A card with no picture keeps its own height (V1 visual pass): stretched to
   the row of a picture card it stood ~200 px tall with nothing in the lower
   half. It sits at the top of its cell instead. */
.feature-grid > li:not(:has(.shot, .shot-pair)) {
  align-self: start;
}

/* ---- Product images ---------------------------------------------------- */

/*
 * The frame is drawn here, never baked into the PNG (research
 * release-screenshots-2026-10-07: no device frame in the pixels), so it follows
 * the theme. Desktop shots are 1440x900 @2x, the phone shot 390x844 @3x; each
 * <img> carries its CSS size as width/height, so nothing shifts while it loads.
 */
.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--border-hairline) solid var(--rule-strong);
  border-radius: var(--radius-l);
  background: var(--paper-sunken);
  box-shadow: var(--shadow-mid);
}

/* A light/dark pair follows the page's switch, not the OS: one of the two shows.
   Scoped under .shot so it outranks the `.shot img` rule above. */
.shot .shot__dark,
:root[data-theme='dark'] .shot .shot__light {
  display: none;
}

:root[data-theme='dark'] .shot .shot__dark {
  display: block;
}

/* The hero: the desk with the phone standing in front of its lower right corner. */
.hero-shots {
  position: relative;
  padding-bottom: var(--space-xl);
}

.shot--phone {
  position: absolute;
  right: clamp(var(--space-s), 4vw, var(--space-m));
  bottom: 0;
  width: clamp(5.5rem, 17%, 12rem);
}

/* A neutral bezel, not a vendor's phone: the product is a web app. */
.shot--phone img {
  border: 0.35rem solid var(--ink-soft);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-mid), 0 0 0 var(--border-hairline) var(--rule-strong);
}

/* In a feature card the image leads, above the title. */
.feature-grid .shot,
.feature-grid .shot-pair {
  margin-bottom: var(--space-s);
}

.shot-pair {
  display: grid;
  gap: var(--space-s);
}

/* The one card with two images takes two columns where the grid has two. */
@media (min-width: 48rem) {
  /* dense: the card after it fills the cell the wide card could not. */
  .feature-grid {
    grid-auto-flow: dense;
  }

  .feature-grid__wide {
    grid-column: span 2;
  }

  .shot-pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Plans ------------------------------------------------------------- */

#pricing {
  margin-bottom: var(--space-3xl);
}

.billing {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-block: var(--space-l);
}

.plan-grid {
  --dx-grid-min: 17rem;
  align-items: stretch;
}

.plan--featured {
  border-color: var(--accent);
}

.plan__price {
  font-family: var(--font-ui);
  color: var(--ink-faint);
  font-size: var(--step--1);
}

.plan__price strong {
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: var(--weight-semibold);
  color: var(--ink);
}

.plan__list {
  display: grid;
  gap: var(--space-2xs);
  margin-top: var(--space-xs);
  list-style: none;
  font-family: var(--font-ui);
  color: var(--ink-soft);
}

.plan__list li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: baseline;
}

.plan__list li::before {
  content: "\2713";
  color: var(--status-success);
  font-weight: var(--weight-bold);
}

.plan .dx-card__foot .dx-btn {
  width: 100%;
}

.plan-note {
  margin-top: var(--space-m);
}

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

.site-foot {
  padding-block: var(--space-2xl) var(--space-l);
  background: var(--paper-sunken);
  border-top: var(--border-hairline) solid var(--rule);
}

.site-foot__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: var(--space-l);
}

.site-foot__brand {
  display: grid;
  gap: var(--space-2xs);
  align-content: start;
}

.site-foot__col ul {
  display: grid;
  gap: var(--space-2xs);
  margin-top: var(--space-2xs);
  list-style: none;
  font-family: var(--font-ui);
}

.site-foot__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-s);
  border-top: var(--border-hairline) solid var(--rule);
}

/* ---- Legal pages (privacy, terms and their archived versions) ----------
   The documents themselves are untouched until the legal pass; only their
   column and colours ride the tokens. */

.legal-page {
  padding: var(--space-2xl) clamp(var(--space-s), 4vw, var(--space-m)) var(--space-3xl);
}

.legal-content {
  max-width: var(--width-prose);
  margin: 0 auto;
  line-height: var(--leading-prose);
}

.legal-content h1 {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2xs);
}

.legal-content .last-updated {
  font-family: var(--font-ui);
  color: var(--ink-faint);
  margin-bottom: var(--space-xl);
}

.legal-content h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
}

.legal-content h3 {
  font-size: var(--step-1);
  margin-top: var(--space-l);
  margin-bottom: var(--space-xs);
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  color: var(--ink-soft);
  margin-bottom: var(--space-s);
}

.legal-content ul,
.legal-content ol {
  padding-left: var(--space-m);
}

.legal-content li {
  margin-bottom: var(--space-2xs);
}

.legal-content strong {
  color: var(--ink);
}

.legal-content hr {
  border: none;
  border-top: var(--border-hairline) solid var(--rule);
  margin: var(--space-xl) 0 var(--space-l);
}

.legal-content blockquote {
  margin: var(--space-m) 0;
  padding: var(--space-s) var(--space-m);
  border-left: var(--border-thick) solid var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-style: italic;
}

.legal-content blockquote p {
  margin-bottom: 0;
}

/* Wide tables scroll inside their wrapper instead of the page. */
.legal-content .table-wrap {
  overflow-x: auto;
  margin: var(--space-m) 0 var(--space-l);
  border: var(--border-hairline) solid var(--rule);
  border-radius: var(--radius-xs);
}

.legal-content table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.legal-content thead th {
  background: var(--paper-sunken);
  color: var(--ink);
  font-weight: var(--weight-semibold);
  text-align: left;
  white-space: nowrap;
}

.legal-content th,
.legal-content td {
  padding: var(--space-xs) var(--space-s);
  border-bottom: var(--border-hairline) solid var(--rule);
  vertical-align: top;
}

.legal-content tbody tr:last-child td {
  border-bottom: none;
}

/* The banner on a superseded version. */
.legal-content .archive-notice {
  padding: var(--space-xs) var(--space-s);
  margin-bottom: var(--space-l);
  border-left: var(--border-thick) solid var(--status-warning);
  background: var(--status-warning-soft);
  color: var(--ink);
}

.legal-content .version-link {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: var(--border-hairline) solid var(--rule);
  font-family: var(--font-ui);
}
