/*
Purpose: shared styles for Mullusi public trust, policy, and disclosure routes.
Governance scope: static legal/security route rendering, no-JavaScript reachability, and footer trust navigation.
Dependencies: trust route HTML files and Mullusi static assets.
Invariants: no secrets, no runtime proof claims, no JavaScript dependency, no inline style dependency.
*/

:root {
  color-scheme: dark;
  --bg: #050609;
  --panel: #0d1018;
  --panel-soft: #111521;
  --line: #272d40;
  --ink: #e9eaef;
  --muted: #99a0b4;
  --accent: #5ce6c4;
  --warm: #e8b15c;
  --blue: #8ab4ff;
  --warn: #f0d28f;
  --page-bg: #080a10;
  --panel-wash: rgba(255, 255, 255, 0.035);
  --panel-ink: rgba(0, 0, 0, 0.28);
  --panel-ink-soft: rgba(0, 0, 0, 0.18);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: Inter, "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-soft: #edf2f7;
  --line: #d8e0ea;
  --ink: #111827;
  --muted: #455366;
  --accent: #0f766e;
  --warm: #b45309;
  --blue: #415fb2;
  --warn: #8a4b0f;
  --page-bg: #f7f8fb;
  --panel-wash: rgba(15, 23, 42, 0.035);
  --panel-ink: rgba(255, 255, 255, 0.78);
  --panel-ink-soft: rgba(255, 255, 255, 0.68);
}

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

:root[data-lang="am"] h1,
:root[data-lang="am"] h2,
:root[data-lang="am"] h3 {
  font-family: var(--sans);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  transform: translateY(-200%);
  background: var(--accent);
  color: #050609;
  padding: 0.75rem 1rem;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

nav,
main,
footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.nav-links a,
.footer-links a {
  text-decoration: none;
}

.nav-links a:hover,
.footer-links a:hover {
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel-ink-soft);
  color: var(--ink);
  font: 12px/1 var(--sans);
  padding: 0 12px;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-dot {
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

.theme-toggle[aria-pressed="true"] .theme-dot {
  background: linear-gradient(90deg, transparent 0 50%, currentColor 50% 100%);
}

main {
  padding: 44px 0 80px;
}

.eyebrow {
  color: var(--warm);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
}

h1 {
  max-width: 13ch;
  margin-top: 16px;
  font-size: 72px;
}

h2 {
  font-size: 36px;
}

h3 {
  font-size: 20px;
}

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

code {
  color: var(--accent);
}

.lede {
  max-width: 76ch;
  margin-top: 18px;
  font-size: 18px;
}

.trust-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.62fr);
  gap: 24px;
  align-items: end;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, var(--panel-wash), color-mix(in srgb, var(--panel-ink-soft) 88%, transparent));
  padding: 16px;
}

.trust-hero-copy {
  min-width: 0;
}

.trust-readout-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(92, 230, 196, 0.24);
  background:
    linear-gradient(180deg, rgba(92, 230, 196, 0.08), transparent),
    var(--panel-ink);
  padding: 12px;
}

.trust-readout-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(92, 230, 196, 0.32);
  background: rgba(92, 230, 196, 0.05);
  padding: 10px;
}

.trust-readout-head span,
.trust-readout-card dt {
  color: var(--warm);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.trust-readout-head strong {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
}

.trust-readout-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.trust-readout-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: color-mix(in srgb, var(--panel-ink-soft) 72%, transparent);
  padding: 10px;
}

.trust-readout-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.trust-readout-card p {
  margin: 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.actions,
.route-list,
.policy-grid,
.control-grid {
  display: grid;
  gap: 14px;
}

.actions {
  grid-template-columns: repeat(3, minmax(0, max-content));
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 9px 14px;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  text-align: center;
}

.button.primary {
  background: var(--accent);
  color: #050609;
  font-weight: 700;
}

.policy-grid,
.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 32px;
}

.trust-boundary {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(92, 230, 196, 0.2);
  background: var(--panel-ink-soft);
}

.trust-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.trust-flow span,
.trust-flow strong {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trust-flow span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  width: 8px;
  height: 1px;
  background: rgba(92, 230, 196, 0.44);
}

.trust-flow strong {
  border-color: rgba(232, 177, 92, 0.55);
  color: var(--warm);
}

.trust-state-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.trust-state-grid div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel-ink-soft);
}

.trust-state-grid span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trust-state-grid strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.trust-boundary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.trust-route-map {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
  border: 1px solid rgba(92, 230, 196, 0.18);
  background:
    linear-gradient(135deg, rgba(92, 230, 196, 0.07), transparent 48%),
    var(--panel-ink-soft);
  padding: 16px;
}

.trust-route-map h2 {
  margin-top: 8px;
  font-size: 28px;
}

.trust-route-map p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.trust-route-map nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.trust-route-map a {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 116px;
  border: 1px solid var(--line);
  background: var(--panel-ink-soft);
  padding: 12px;
  text-decoration: none;
}

.trust-route-map a:hover,
.trust-route-map a:focus-visible,
.trust-route-map a[aria-current="page"] {
  border-color: rgba(92, 230, 196, 0.48);
  background:
    linear-gradient(180deg, rgba(92, 230, 196, 0.1), transparent),
    color-mix(in srgb, var(--panel-ink-soft) 88%, transparent);
}

.trust-route-map a[aria-current="page"] {
  box-shadow: inset 0 2px 0 var(--accent);
}

.trust-route-map span {
  color: var(--warm);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trust-route-map strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.trust-response-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.trust-response-map article {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(92, 230, 196, 0.18);
  background:
    linear-gradient(145deg, rgba(92, 230, 196, 0.08), transparent 48%),
    var(--panel-ink-soft);
  padding: 18px;
}

.trust-response-map article::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--warm), transparent);
  opacity: 0.72;
}

.trust-response-map span {
  display: block;
  margin-bottom: 11px;
  color: var(--warm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trust-response-map strong {
  display: block;
  color: var(--ink);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.trust-response-map p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.panel,
.policy-card,
.control-card,
.notice {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--panel-wash), transparent),
    color-mix(in srgb, var(--panel) 86%, transparent);
  padding: 20px;
}

.policy-card,
.control-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 100%;
}

.policy-card h2,
.control-card h2,
.panel h2 {
  font-size: 31px;
  overflow-wrap: anywhere;
}

.policy-card h2,
.control-card h2 {
  color: var(--ink);
}

.policy-card h2::before,
.control-card h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  margin-bottom: 14px;
  background: var(--accent);
}

.policy-card p,
.control-card p {
  margin: 0;
}

.notice {
  margin-top: 18px;
  background:
    linear-gradient(135deg, rgba(240, 210, 143, 0.1), transparent 42%),
    color-mix(in srgb, var(--panel) 86%, transparent);
}

.notice strong {
  color: var(--warn);
}

section {
  margin-top: 34px;
}

ul,
ol {
  margin: 16px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

li + li {
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 16px;
  background: var(--panel-ink-soft);
}

th,
td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

footer {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 34px 0 48px;
  font-size: 13px;
}

.footer-links {
  padding-bottom: 2px;
}

@media (max-width: 760px) {
  nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 8px;
    padding: 12px 0;
  }

  nav .brand { margin-right: auto; }

  .nav-links {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    gap: 8px 14px;
  }

  .actions,
  .policy-grid,
  .control-grid,
  .trust-response-map,
  .trust-hero {
    grid-template-columns: 1fr;
  }

  .trust-hero {
    gap: 16px;
    padding: 12px;
  }

  .trust-readout-head {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .trust-readout-head strong {
    text-align: left;
  }

  .actions {
    gap: 8px;
    margin-top: 14px;
  }

  .button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    font-size: 11px;
    letter-spacing: 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .policy-card h2,
  .control-card h2,
  .panel h2 {
    font-size: 28px;
  }

  .lede {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.45;
  }

  section {
    margin-top: 22px;
  }

  .trust-boundary {
    gap: 8px;
    margin-top: 18px;
    padding: 10px;
  }

  .trust-flow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .trust-flow span,
  .trust-flow strong {
    min-height: 44px;
    padding: 4px;
    font-size: 10px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .trust-flow span:not(:last-child)::after {
    display: none;
  }

  .trust-state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .trust-state-grid div {
    padding: 8px 6px;
  }

  .trust-state-grid span {
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .trust-state-grid strong {
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .trust-boundary p {
    font-size: 12px;
    line-height: 1.35;
  }

  .trust-route-map {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
    padding: 10px;
  }

  .trust-route-map h2 {
    font-size: 24px;
  }

  .trust-route-map nav {
    grid-template-columns: 1fr;
  }

  .trust-route-map a {
    min-height: 0;
    padding: 10px;
  }

  main {
    padding-top: 16px;
  }

  h1 {
    max-width: 100%;
    margin-top: 10px;
    font-size: 30px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  :root[data-lang="am"] h1 {
    font-size: 26px;
    line-height: 1.3;
  }

  h2 {
    font-size: 30px;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
