/* TAI Labs GovTech site.
 *
 * Deliberately the same register as the Open DSA dashboard it fronts: a
 * statistical agency, not a campaign. The pitch is that our numbers survive
 * hostile review, so a page that reads as persuasion argues against itself.
 * No hero imagery, no gradients, no animated counters, no logo wall.
 *
 * Tokens mirror web/src/styles/tokens.css. This is the only file here where a
 * raw colour value may appear.
 */

:root {
  --paper:      #EFEFE9;
  --card:       #F7F7F3;
  --rule:       #C9CBC2;
  --rule-firm:  #ADB1A6;
  --ink:        #16261F;
  --muted:      #5C6660;

  --official:   #2A4B7C;
  --alt:        #1F6F5C;

  /* Status triad, from the Sri Lankan flag, inherited from the dashboard.
     ONLY ever for target compliance or verification state. Never decorative. */
  --breach:     #7C2230;
  --watch:      #B8791A;
  --clear:      #4A6B4E;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --content-max: 1080px;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums lining-nums;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.1; margin: 0 0 1rem; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); margin: 0 0 0.6rem; }
h3 { font-size: 1.02rem; margin: 0 0 0.35rem; }

a { color: var(--official); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--official); outline-offset: 2px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 100; }

.wrap { max-width: var(--content-max); margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); }

/* --- Header --------------------------------------------------------------- */
header.site {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  position: sticky; top: 0; z-index: 20;
}
.bar { display: flex; align-items: center; gap: 1.25rem; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 0.55rem; font-weight: 600; }
.brand .mark { font-family: var(--serif); font-size: 1.1rem; letter-spacing: -0.01em; }
.brand .sub { font-size: 0.76rem; color: var(--muted); font-weight: 400; }
nav.site { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
nav.site a { color: var(--muted); text-decoration: none; font-size: 0.87rem; }
nav.site a:hover { color: var(--ink); text-decoration: underline; }

/* --- Sections ------------------------------------------------------------- */
section { padding: 3.5rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }
.eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem;
}
.lede { font-size: 1.12rem; color: var(--ink); margin: 0 0 1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: 4.5rem 0 3.5rem; }
.hero .rules { margin: 2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0; }
.hero .rules li {
  border-top: 1px solid var(--rule);
  padding: 0.85rem 0 0.85rem 1.6rem;
  position: relative;
  max-width: var(--measure);
}
.hero .rules li::before {
  content: counter(r); counter-increment: r;
  position: absolute; left: 0; top: 0.85rem;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
}
.hero .rules { counter-reset: r; }

/* --- Cards ---------------------------------------------------------------- */
.grid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.grid.two   { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cell { background: var(--card); padding: 1.15rem 1.25rem; }
.cell h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; }
.cell p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.cell .who {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem;
}
.cell .built {
  display: inline-block; margin-top: 0.55rem;
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--clear);
  border: 1px solid var(--clear); border-radius: 2px; padding: 0.1rem 0.35rem;
}

/* --- Showcase ------------------------------------------------------------- */
.showcase {
  border: 1px solid var(--rule-firm); background: var(--card);
  padding: 1.5rem; margin-top: 1.25rem;
}
.showcase .status {
  display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  border-top: 1px solid var(--rule); margin-top: 1.1rem; padding-top: 0.8rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--breach); }
.btn {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  padding: 0.5rem 0.95rem; font-size: 0.9rem; font-family: inherit; cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: transparent; color: var(--ink); }

/* --- Table ---------------------------------------------------------------- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* --- Form ----------------------------------------------------------------- */
form.contact { max-width: 34rem; margin-top: 1.25rem; }
.field { margin-bottom: 0.9rem; }
label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.25rem; }
input, textarea, select {
  width: 100%; font: inherit; font-size: 0.92rem;
  padding: 0.5rem 0.6rem; background: var(--card);
  border: 1px solid var(--rule-firm); border-radius: 2px; color: var(--ink);
}
textarea { min-height: 6.5rem; resize: vertical; }
.formnote { font-size: 0.82rem; color: var(--muted); margin-top: 0.7rem; }
.result { margin-top: 0.9rem; padding: 0.7rem 0.85rem; border: 1px solid var(--rule-firm); background: var(--card); font-size: 0.9rem; }
.result.ok { border-color: var(--clear); }
.result.bad { border-color: var(--breach); }
.result[hidden] { display: none; }

/* --- Footer --------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--rule); background: var(--card);
  padding: 2rem 0; font-size: 0.85rem; color: var(--muted);
}
footer.site a { color: var(--muted); }
.foot { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
