/* Congrua public site.
 *
 * Colours are the Congrua palette (see brand.html). Every colour on the page
 * comes from a token below, so dark mode is one block of overrides.
 */

:root {
  /* Palette */
  --ink: #14213d;
  --ink-soft: #2b3a5c;
  --verdigris: #0e7c74;
  --verdigris-light: #43c0b2;
  --seafoam: #d7efeb;
  --marigold: #f4a42c;
  --marigold-light: #f6b347;
  --honey: #fdecc8;
  --cream: #fbf7ef;
  --sand: #f1e9da;
  --slate: #55606e;
  --iris: #5b5bd6;

  /* Roles */
  --bg: var(--cream);
  --surface: #ffffff;
  --surface-alt: var(--sand);
  --text: var(--ink);
  --text-muted: var(--slate);
  --accent: var(--verdigris);
  --accent-soft: var(--seafoam);
  --warm: var(--marigold);
  --warm-soft: var(--honey);
  --line: rgba(20, 33, 61, 0.12);
  --mark-arc: var(--verdigris);
  --mark-dot: var(--marigold);
  --band-bg: var(--ink);
  --band-text: #f7f3ea;
  --band-muted: #b9c2cf;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --max: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1626;
    --surface: #15223a;
    --surface-alt: #1a2944;
    --text: #eaf0f2;
    --text-muted: #a3b0bd;
    --accent: var(--verdigris-light);
    --accent-soft: rgba(67, 192, 178, 0.14);
    --warm: var(--marigold-light);
    --warm-soft: rgba(246, 179, 71, 0.14);
    --line: rgba(234, 240, 242, 0.12);
    --mark-arc: var(--verdigris-light);
    --mark-dot: var(--marigold-light);
    --band-bg: #15223a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1626;
  --surface: #15223a;
  --surface-alt: #1a2944;
  --text: #eaf0f2;
  --text-muted: #a3b0bd;
  --accent: var(--verdigris-light);
  --accent-soft: rgba(67, 192, 178, 0.14);
  --warm: var(--marigold-light);
  --warm-soft: rgba(246, 179, 71, 0.14);
  --line: rgba(234, 240, 242, 0.12);
  --mark-arc: var(--verdigris-light);
  --mark-dot: var(--marigold-light);
  --band-bg: #15223a;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 76px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  font-variation-settings: "opsz" 144;
}

/* On phones the h1 is ~38px, and the opsz-144 hairlines drop out on
   Android Chrome (the H crossbar vanished: "Help" read as "I Iclp").
   A step down keeps the display look with crossbars that survive. */
@media (max-width: 899px) {
  h1 {
    font-variation-settings: "opsz" 96;
  }
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-variation-settings: "opsz" 96;
}

h3 {
  font-size: 1.35rem;
  font-variation-settings: "opsz" 36;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 32px;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 40em;
}

/* ---------- Logo ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.logo svg {
  height: 30px;
  width: auto;
}

.logo .arc {
  stroke: var(--mark-arc);
}

.logo .dot,
.mark .dot {
  fill: var(--mark-dot);
}

.mark .arc {
  stroke: var(--mark-arc);
}

.logo .word {
  stroke: currentColor;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.95rem;
}

.nav a:not(.button) {
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:not(.button):hover {
  color: var(--text);
}

.nav .nav-link {
  display: none;
}

@media (min-width: 760px) {
  .nav .nav-link {
    display: inline;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  background: var(--ink);
  color: #f7f3ea;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(20, 33, 61, 0.18);
}

.button.small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.button.warm {
  background: var(--marigold);
  color: var(--ink);
}

:root[data-theme="dark"] .button:not(.ghost):not(.warm) {
  background: var(--verdigris-light);
  color: #0d1626;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button:not(.ghost):not(.warm) {
    background: var(--verdigris-light);
    color: #0d1626;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
}

@media (min-width: 900px) {
  .hero {
    padding: 112px 0 128px;
  }
}

.hero .wrap {
  position: relative;
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.25fr 1fr;
  }
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero .lede {
  margin-top: 24px;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-art {
  position: relative;
  max-width: min(420px, 62vw);
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 1;
}

.hero-art svg {
  width: 100%;
  height: 100%;
}

.ring {
  fill: none;
  stroke-linecap: round;
}

.ring-1 {
  stroke: var(--mark-arc);
  stroke-width: 22;
}

.ring-2 {
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.35;
}

.ring-3 {
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.2;
  stroke-dasharray: 2 8;
}

.hero-art .dot {
  fill: var(--mark-dot);
}

.orbit {
  transform-origin: 200px 200px;
  animation: spin 60s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbit {
    animation: none;
  }
}

/* ---------- Sections ---------- */

section {
  padding: 88px 0;
}

.section-head {
  max-width: 44em;
  margin-bottom: 48px;
}

.section-head h2 {
  margin-top: 12px;
}

.section-head .lede {
  margin-top: 18px;
}

/* Three pillars */

.pillars {
  display: grid;
  gap: 20px;
}

@media (min-width: 860px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px 30px;
}

.pillar .icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 22px;
}

.pillar.warm .icon {
  background: var(--warm-soft);
  color: var(--warm);
}

.pillar .icon svg {
  width: 24px;
  height: 24px;
}

.pillar .kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pillar h3 {
  margin: 6px 0 12px;
}

.pillar p {
  color: var(--text-muted);
}

.pillar ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.pillar li {
  position: relative;
  padding-left: 22px;
}

.pillar li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm);
}

/* Insight band */

.band {
  background: var(--band-bg);
  color: var(--band-text);
}

.band .eyebrow {
  color: var(--verdigris-light);
}

.band .lede {
  color: var(--band-muted);
}

.insight-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .insight-grid {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.insight-list {
  display: grid;
  gap: 22px;
  margin-top: 32px;
}

.insight-list div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
}

.insight-list .tick {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(67, 192, 178, 0.16);
  color: var(--verdigris-light);
  display: grid;
  place-items: center;
}

.insight-list strong {
  display: block;
  color: var(--band-text);
}

.insight-list span {
  color: var(--band-muted);
  font-size: 0.97rem;
}

.dashboard {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 28px;
}

.dashboard .dash-title {
  font-size: 0.85rem;
  color: var(--band-muted);
  margin-bottom: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.bar-row .label {
  color: var(--band-muted);
}

.bar-row .value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--verdigris-light);
}

.bar.warm span {
  background: var(--marigold-light);
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.stat {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
}

.stat small {
  color: var(--band-muted);
  font-size: 0.82rem;
}

/* Your name, not ours */

.yours {
  display: grid;
  gap: 48px;
}

@media (min-width: 960px) {
  .yours {
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: 64px;
  }
}

.yours .copy p + p {
  margin-top: 16px;
}

.yours .copy p {
  color: var(--text-muted);
}

.yours .copy strong {
  color: var(--text);
}

.brands {
  display: grid;
  gap: 16px;
}

@media (min-width: 560px) {
  .brands {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tenant {
  --t: #1f4e8c;
  --t-soft: #e7eef8;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tenant .bar-top {
  height: 8px;
  background: var(--t);
}

.tenant .body {
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.tenant .badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--t);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.tenant .name {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
}

.tenant .url {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.tenant .fake-field {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: auto;
}

.tenant .fake-button {
  height: 34px;
  border-radius: 8px;
  background: var(--t);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.tenant.green {
  --t: #2f7a3a;
}

.tenant.clay {
  --t: #b4532a;
}

.caption {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}

/* Foundations */

.foundations {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 720px) {
  .foundations {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .foundations {
    grid-template-columns: repeat(4, 1fr);
  }
}

.foundation {
  background: var(--surface);
  padding: 28px 24px;
}

.foundation h3 {
  font-size: 1.12rem;
  margin-bottom: 10px;
}

.foundation p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Name origin */

.origin {
  background: var(--surface-alt);
}

.origin-inner {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 860px) {
  .origin-inner {
    grid-template-columns: auto 1fr;
    gap: 72px;
  }
}

.origin .mark {
  width: 160px;
  height: 160px;
}

.origin .def {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.35;
  font-variation-settings: "opsz" 48;
}

.origin .def i {
  color: var(--accent);
}

.origin p.small {
  margin-top: 18px;
  color: var(--text-muted);
  max-width: 42em;
}

/* Contact */

.contact {
  text-align: center;
}

.contact .lede {
  margin: 18px auto 0;
}

.contact .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.contact .email {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
}

.site-footer .logo svg {
  height: 24px;
}

.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-muted);
}

/* ---------- Brand page ---------- */

.brand-hero {
  padding: 72px 0 24px;
}

.brand-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.brand-section h2 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.brand-section > .wrap > p {
  color: var(--text-muted);
  max-width: 44em;
  margin-bottom: 28px;
}

.logo-tiles {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .logo-tiles {
    grid-template-columns: 2fr 1fr;
  }
}

.logo-tile {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 40px;
  position: relative;
}

.logo-tile.light {
  background: #fbf7ef;
}

.logo-tile.dark {
  background: #14213d;
}

.logo-tile.verd {
  background: #0e7c74;
}

.logo-tile img {
  max-height: 64px;
  width: auto;
}

.logo-tile img.square {
  max-height: 112px;
}

.logo-tile .tag {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-size: 0.78rem;
  color: #55606e;
}

.logo-tile.dark .tag,
.logo-tile.verd .tag {
  color: #b9c2cf;
}

.swatches {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.swatch {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
}

.swatch .chip {
  height: 110px;
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 600;
}

.swatch .meta {
  padding: 14px;
  font-size: 0.88rem;
}

.swatch .meta b {
  display: block;
  font-size: 0.98rem;
}

.swatch code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.swatch .role {
  margin-top: 6px;
  color: var(--text-muted);
}

.swatch-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 14px;
}

.type-specimen {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .type-specimen {
    grid-template-columns: 1fr 1fr;
  }
}

.specimen {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 28px;
}

.specimen .big {
  font-size: 3.4rem;
  line-height: 1;
  margin: 12px 0 16px;
}

.specimen .big.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
}

.specimen .big.text {
  font-family: var(--font-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.specimen p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.rules {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .rules {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rule {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
}

.rule h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.rule p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contrast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.contrast-table th,
.contrast-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.contrast-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contrast-table tr:last-child td {
  border-bottom: none;
}

.pair {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}
