/* Domusar — public site (DOMUS-149)
 *
 * The colours, the type and the arch all come from the apps' design system
 * (docs/design-system.md and android/core .../theme/Color.kt). Nothing is invented here: a
 * landing page in a different palette reads as a different product.
 *
 * The rule that organises the page: warm means a person acted. In the apps it is spent on
 * two moments, quotes arriving and a rating being given. Here it is spent on the same ones:
 * the quote count and step 02. Everything else is process rather than people, and stays blue
 * or neutral.
 */

/* ── Typefaces, served from this site ─────────────────────────────────────────────
 * OFL-licensed (see fonts/OFL-*.txt). Served from here rather than a CDN on purpose: a page
 * that will link a privacy policy should not leak every visitor's IP to a third party just
 * to fetch a typeface.
 */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/Archivo-Variable.ttf') format('truetype-variations'),
       url('fonts/Archivo-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya Sans';
  src: url('fonts/AlegreyaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya Sans';
  src: url('fonts/AlegreyaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────────────────────────── */
:root {
  --ground: #EDF1F6;         /* Limewash */
  --ink: #2F3030;            /* Lintel */
  --muted: #5A6672;
  --primary: #1F6FA8;        /* PortalBlue */
  --on-primary: #FFFFFF;
  --sky: #7CBBDF;            /* SkyBlue */
  --warm: #A9502C;           /* LightTertiary */
  --surface: #F3F6FA;        /* surfaceContainer */
  --surface-high: #E7EDF3;
  --rule: #D5DEE6;           /* outlineVariant, decorative */
  --outline: #7A8B9A;

  /* The design system's shape scale: 6 / 10 / 14 / 20 / 28 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* A reading measure, not a container width. 64ch was the first guess and ran to about 86
   * characters a line — `ch` is the width of the "0" glyph, and in a proportional face the
   * average character is narrower, so the cap buys less than the number suggests. 54ch lands
   * near 70, inside the range where the eye reliably finds the next line. */
  --measure: 54ch;
  /* Longer than --measure. A policy is read in sequence rather than glanced at, and a
   * narrow column makes an already long document feel endless. */
  --measure-prose: 66ch;

  /* Deep crimson, not Material's red-orange: the warm end of the palette is already spent on
   * "a person acted", and a warning must never read as good news. */
  --error: #8C1D18;
  --error-container: #F9DEDC;
  --on-error-container: #410E0B;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0E1620;       /* Nightfall */
    --ink: #E4EBF2;
    --muted: #A8B7C6;
    --primary: #7CBBDF;      /* in dark the icon's own blue finally shows at full strength */
    --on-primary: #04283E;
    --warm: #E8956B;         /* DarkTertiary */
    --surface: #17212D;
    --surface-high: #1E2937;
    --rule: #2E3B49;
    --outline: #5B6C7C;
    --error: #FFB4AB;
    --error-container: #93000A;
    --on-error-container: #FFDAD6;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  /* Body sizes run a point larger than the default: Alegreya Sans has a modest x-height and
   * the audience is every adult who owns a home. */
  font: 400 1.0625rem/1.65 'Alegreya Sans', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, .eyebrow, .step__n, .count__n, .btn {
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
}

/* The personality lives in the tracking: large sizes are set tight so they read as built
 * rather than typed, while labels open up so they read as signage. */
h1, h2 { letter-spacing: -0.022em; font-weight: 700; line-height: 1.08; margin: 0; }
h3 { letter-spacing: -0.012em; font-weight: 600; line-height: 1.2; margin: 0; }

h1 { font-size: clamp(2.25rem, 6.2vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }

p { margin: 0; }
img, svg { max-width: 100%; }

a { color: var(--primary); }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lede { color: var(--muted); font-size: 1.15rem; max-width: 46ch; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.site-head__mark { display: flex; align-items: center; gap: 0.6rem; }
.site-head__mark img { width: 2rem; height: 2rem; border-radius: var(--r-sm); }
.site-head__mark span {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.15rem;
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 8vw, 6rem);
}

.hero__copy > * + * { margin-top: 1.15rem; }

.hero h1 .accent { color: var(--primary); }

/* ── The arch ────────────────────────────────────────────────────────────────────
 * The brand signature, and it is spent exactly once on this page — the same discipline the
 * apps keep, where it lives only in an order thumbnail and the sign-in panel. That is what
 * keeps it memorable instead of turning it into texture.
 *
 * The head is a true semicircle: the horizontal radius is half the width (50%), and the
 * vertical one is that same measure expressed against the height. At a 4:5 ratio that is
 * 40%. The foot is barely rounded, because a doorway meets the floor.
 */
.arch {
  aspect-ratio: 4 / 5;
  border-radius: 50% 50% var(--r-lg) var(--r-lg) / 40% 40% var(--r-lg) var(--r-lg);
  background: linear-gradient(170deg, var(--sky), #A8D2EA);
  display: grid;
  place-items: end center;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .arch { background: linear-gradient(170deg, #2C6A93, #17384F); }
}

/* The order card: the product's real artifact, not an ornament. Category, approximate
 * location, when it was posted, and how many quotes arrived. */
.order-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  box-shadow: 0 10px 30px rgb(15 30 45 / 0.16);
}

.order-card__top { display: flex; align-items: center; gap: 0.8rem; }

/* The thumbnail repeats the arch small, which is exactly where it lives in the app. */
.order-card__thumb {
  flex: none;
  width: 2.75rem;
  height: 3.4rem;
  border-radius: 50% 50% var(--r-sm) var(--r-sm) / 40% 40% var(--r-sm) var(--r-sm);
  background: var(--sky);
  display: grid;
  place-items: center;
  color: #0E1620;
}

.order-card__meta { min-width: 0; }
.order-card__meta strong { font-family: 'Archivo', sans-serif; font-weight: 600; font-size: 1.05rem; }
.order-card__meta span { display: block; color: var(--muted); font-size: 0.92rem; }

.order-card__count {
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  /* Warm: a person did something here. */
  color: var(--warm);
}

/* Tabular figures, as in the app: a card holding 3 and one holding 12 have to align. */
.count__n {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}
.count__label { font-family: 'Archivo', sans-serif; font-weight: 500; font-size: 0.95rem; }

/* ── Categories ──────────────────────────────────────────────────────────────────
 * Deliberately quiet: ordinary corners, no arch and no warm. The arch is the signature and
 * is spent once; warm means a person acted. A list of trades is neither.
 */
.cats { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4rem); }

.chips {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chips li {
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 0.5rem 0.9rem;
}

/* ── Steps ───────────────────────────────────────────────────────────────────────
 * Numbered because it is a real sequence: without publishing there are no quotes, and
 * without quotes there is nothing to choose. The order is information, not decoration.
 */
.steps { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4rem); }

.steps__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 2rem;
}

.step__n {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: var(--outline);
  display: block;
  margin-bottom: 0.5rem;
}

.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); }

/* The only step where another person acts. Same meaning as the count above. */
.step--human .step__n { color: var(--warm); }
.step--human h3 { color: var(--warm); }

/* ── Audiences ───────────────────────────────────────────────────────────────── */
.audiences { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4rem); }

.audiences__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  padding: clamp(1.4rem, 3vw, 2rem);
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.panel p { color: var(--muted); }
.panel ul { margin: 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: 0.4rem; }

/* Two columns, label beside text. Every other section fills the width, so a lone capped
 * paragraph floating in a wide band read as a mistake rather than a measure. Putting the
 * eyebrow in its own column uses the width, keeps the line length readable, and makes the
 * label/content relationship structural instead of just stacked. */
.trust {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
}

/* The eyebrow is small caps against 1.15rem body: matching the boxes at the top leaves it
 * sitting visibly high, so nudge it onto the paragraph's first line. */
.trust .eyebrow { padding-top: 0.35rem; }
.trust p { max-width: var(--measure); font-size: 1.15rem; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-foot img { width: 7.5rem; display: block; }

/* No link: there is no Play listing yet. A dead button is worse than no button. */
.soon {
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px dashed var(--outline);
  border-radius: var(--r-md);
  padding: 0.5rem 0.9rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 56rem) {
  .hero { grid-template-columns: 1fr; }
  /* The arch must not swallow the screen on a phone. */
  .hero__figure { max-width: 20rem; margin-inline: auto; width: 100%; }
  .steps__grid { grid-template-columns: 1fr; }
  .audiences__grid { grid-template-columns: 1fr; }
  /* Stacked, the grid's own row gap replaces the column gap — no margin needed. */
  .trust { grid-template-columns: 1fr; }
  .trust .eyebrow { padding-top: 0; }
}

/* ── Motion ──────────────────────────────────────────────────────────────────────
 * One staggered entrance on load. Nothing on scroll.
 */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero__copy > *, .hero__figure {
  animation: rise 620ms cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}
.hero__copy > *:nth-child(1) { animation-delay: 40ms; }
.hero__copy > *:nth-child(2) { animation-delay: 110ms; }
.hero__copy > *:nth-child(3) { animation-delay: 180ms; }
.hero__figure { animation-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Document pages ──────────────────────────────────────────────────────────────
 * The privacy policy (DOMUS-148) and anything else that is mostly prose. Reuses the tokens
 * above so a legal page still looks like the same product, rather than like a PDF someone
 * pasted onto the site.
 */
.doc { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }

.doc h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); margin-bottom: 0.75rem; }
.doc__updated { color: var(--muted); font-size: 0.95rem; }

.prose { max-width: var(--measure-prose); margin-top: 2.5rem; }
.prose > * + * { margin-top: 1.1rem; }

.prose h2 {
  font-size: 1.35rem;
  letter-spacing: -0.012em;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.prose h3 { font-size: 1.08rem; margin-top: 1.75rem; }
.prose ul { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.5rem; }
.prose strong { font-weight: 700; }

/* The document is not approved for use yet. Crimson rather than warm: warm means a person
 * acted, and "do not link this from a store listing" is the opposite of good news. */
.notice {
  background: var(--error-container);
  color: var(--on-error-container);
  border-left: 4px solid var(--error);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.1rem 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.notice__title {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.doc__back {
  display: inline-block;
  margin-top: 3rem;
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
}

/* ── Not found ───────────────────────────────────────────────────────────────── */
.nf { padding-block: clamp(4rem, 12vw, 8rem); }
.nf p { color: var(--muted); margin-top: 1rem; max-width: var(--measure); }
.nf a { font-family: 'Archivo', sans-serif; font-weight: 500; }
