/* 3fts.ai — 3rd From The Sun
   Single stylesheet. No external fonts, no images, no imports.

   COLOUR. The page used to be two-tone: charcoal plus one amber accent. It now
   carries three accents on top of a layered surface scale, so cards can belong to a
   family rather than all looking identical. Amber stays primary because it is the
   brand mark; the others mark subject areas (blue = engineering, green = shipping,
   violet = research).

   Every text colour here is MEASURED against its real background in both colour
   schemes by sites/audit-render.mjs -- a hand-computed ratio is not a measurement,
   and the muted greys are what actually fail in practice.

   THE CSP LIVES IN _headers AND FORBIDS INLINE STYLES (`style-src 'self'` with no
   'unsafe-inline'). So: no style="" attributes anywhere in the HTML, and no <style>
   block inside an inlined SVG. sites/verify-sites.py fails the build if one appears. */

:root {
  --bg: #0a0c0f;
  --bg-soft: #0e1218;
  --surface: #141a23;
  --surface-hi: #1b2431;
  --rule: #1e242c;
  --line: #232c38;

  --text: #eceff3;
  --muted: #a3adb8;
  --faint: #8b95a2;

  --accent:   #f2a93b;  /* amber  — the sun, the studio */
  --accent-2: #79b0ff;  /* blue   — engineering */
  --accent-3: #5fd3a8;  /* green  — open / shipping */
  --accent-4: #c08cf0;  /* violet — research */

  --measure: 34rem;
  --measure-wide: 64rem;
  --gutter: 1.5rem;
  --radius: 14px;
  --radius-sm: 9px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.shell {
  width: 100%;
  max-width: calc(var(--measure-wide) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* A narrower column for prose, so a wide container never produces a 100-character
   line. Both are used on the same page: wide for card grids, narrow for text. */
.prose {
  max-width: var(--measure);
}

.site-header {
  padding-block: 2rem 0;
}

.site-main {
  flex: 1 1 auto;
  padding-block: 2.5rem 0;
}

.site-footer {
  margin-top: 4rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
}

/* The vertical-rhythm rules (.stack > * + *, .card > * + *) live at the END of this
   file on purpose -- see the note there. They have to come AFTER the components, or
   the components' `margin: 0` silently wins on equal specificity. */

/* ---------- wordmark ---------- */

.wordmark {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--muted);
}

/* The brand mark, inlined rather than referenced as an <img> so it cannot become a
   second request and so its colours come from the same variables as the page. Styled
   from this stylesheet, NOT from a <style> inside the SVG: the CSP on this site is
   `style-src 'self'`, which blocks inline style blocks. */
.wordmark__mark {
  width: 26px;
  height: 26px;
  flex: none;
  display: block;
}

.wordmark__mark .m-bg { fill: var(--bg); }
.wordmark__mark .m-sun { fill: var(--accent); }

.wordmark__mark .m-rays {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- typography ---------- */

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.35rem + 3.2vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 1.15rem + 1vw, 1.85rem);
}

h3 {
  margin: 0;
  font-size: 1.0625rem;
}

p {
  margin: 0;
  max-width: var(--measure);
  text-wrap: pretty;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem);
  color: var(--text);
}

.muted { color: var(--muted); }

/* A quieter aside. This class was documented in the design system and the README but
   was missing from this stylesheet -- the worker briefing listed it as available, and
   rule 7 of the gate (orphaned classes) would have failed the build had it been used.
   Defined here so the documented contract is true rather than nearly true. */
.note {
  color: var(--faint);
  font-size: 0.9375rem;
}

/* Small caps label above a heading. Gives every section a scannable entry point. */
.eyebrow {
  display: block;
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow--2 { color: var(--accent-2); }
.eyebrow--3 { color: var(--accent-3); }
.eyebrow--4 { color: var(--accent-4); }

/* ---------- sections ---------- */

.section {
  margin-top: 4.5rem;
}

.section__head {
  max-width: var(--measure);
  margin-bottom: 1.75rem;
}

.rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--rule);
}

/* ---------- cards ---------- */

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

.card {
  position: relative;
  padding: 1.35rem 1.35rem 1.5rem;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* The coloured edge is the whole point: it makes a grid of boxes scannable at a
   glance instead of a wall of identical grey rectangles. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.card--2::before { background: var(--accent-2); }
.card--3::before { background: var(--accent-3); }
.card--4::before { background: var(--accent-4); }

.card--plain { background-color: var(--bg-soft); }
.card--plain::before { background: var(--line); }

.card p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Statistic block: one big number, one short label. */
.stat__value {
  display: block;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.35rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.stat--2 .stat__value { color: var(--accent-2); }
.stat--3 .stat__value { color: var(--accent-3); }
.stat--4 .stat__value { color: var(--accent-4); }

.stat__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- pills ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--bg-soft);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pill--accent { border-color: var(--accent); color: var(--accent); }
.pill--2 { border-color: var(--accent-2); color: var(--accent-2); }
.pill--3 { border-color: var(--accent-3); color: var(--accent-3); }
.pill--4 { border-color: var(--accent-4); color: var(--accent-4); }

/* ---------- checklist ---------- */

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin-top: 0.7rem;
  padding-left: 1.6rem;
  max-width: var(--measure);
  color: var(--muted);
  text-wrap: pretty;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--accent);
}

.checks--2 li::before { background: var(--accent-2); }
.checks--3 li::before { background: var(--accent-3); }

/* ---------- call to action ---------- */

.cta {
  margin-top: 3rem;
  padding: 1.75rem;
  background:
    linear-gradient(180deg, var(--surface-hi), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cta h2 { margin-bottom: 0.5rem; }

/* ---------- links ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

@media (hover: hover) {
  a:hover { text-decoration-thickness: 2px; }
}

/* A link that is the PRIMARY ACTION on its page needs a real hit area. Measured at
   21-22px tall on a phone before this rule, under the 24x24 WCAG 2.5.8 minimum and
   far under the 44px platform guidance. */
.action-link {
  display: inline-block;
  min-height: 44px;
  padding-block: 0.55rem;
  overflow-wrap: anywhere;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

/* A row of links is still a row of TAP TARGETS. Measured at 20px tall on the investor
   page -- under the 24x24 WCAG 2.5.8 minimum. The flex gap alone does not satisfy the
   spacing exception reliably, so the height is set explicitly. */
.link-row a {
  display: inline-block;
  min-height: 44px;
  padding-block: 0.55rem;
}

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

/* ---------- 404 ---------- */

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

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

.site-footer p {
  margin: 0;
  max-width: var(--measure-wide);
  font-size: 0.875rem;
  color: var(--faint);
}

.site-footer .link-row {
  margin-top: 0.9rem;
}

.site-footer a {
  color: var(--muted);
}

/* ---------- skip link ---------- */

/* Kept on-screen and moved with a transform rather than parked at left:-9999px.
   An off-canvas box is a layout hazard in some engines (it can extend the scrollable
   area). */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  transform: translateY(-300%);
  padding: 0.625rem 0.875rem;
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.875rem;
  text-decoration: underline;
}

.skip-link:focus {
  transform: none;
}

/* ---------- motion ---------- */

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

/* ---------- wider screens ---------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }

  .site-header { padding-block: 3rem 0; }
  .site-main { padding-block: 3.5rem 0; }
  .section { margin-top: 5.5rem; }
  .cta { padding: 2.25rem; }
}

/* ---------- vertical rhythm — MUST STAY LAST ----------

   These two rules are the composing layer: `.stack` spaces a column of blocks and
   `.card` spaces the blocks inside a box. They belong to the same specificity as the
   components above (.checks, .pills, .rule all set `margin: 0`), so SOURCE ORDER
   decides the winner.

   Earlier in the file they LOST, silently: `.checks { margin: 0 }` came later and
   wiped the top margin, so a checklist dropped flush against the element above it and
   the page had to be patched with wrapper <div>s in the HTML to recover the spacing.
   That is a design system failing at its one job -- composing -- and a workaround in
   markup is a symptom, not a fix.

   Keeping them last means the components stay free to zero their own margins for
   standalone use, and any block dropped into a `.stack` or `.card` is spaced
   correctly by composition. If you add a component with `margin: 0`, add it ABOVE
   this block. */
.stack > * + * {
  margin-top: 1.15rem;
}

.card > * + * {
  margin-top: 0.6rem;
}
