/* Zavira AI.
   An editorial page with an engineer's ruler: serif text on white paper, ink rules and title blocks
   for structure, line drawings for the system. One accent colour, and it only ever means privacy:
   the Privacy Gateway, its placeholders and its line in the drawings. */

:root {
  --paper: #FFFFFF;
  --paper-2: #F6F6F4;
  --ink: #15171A;
  --ink-2: #4A4F56;
  --muted: #5A5F66;
  --rule: #DCDCD8;
  --faint: #C4C6C9;
  --accent: #C2410C;
  --on-ink-accent: #FB923C;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --frame: 80rem;
  --pad: clamp(20px, 4vw, 40px);
  --head-h: 76px;

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121315; --paper-2: #1A1C1F; --ink: #EDEDEA; --ink-2: #BCC0C4; --muted: #A3A8AE;
    --rule: #34373B; --faint: #4A4E53; --accent: #F07A3E; --on-ink-accent: #B23A08;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121315; --paper-2: #1A1C1F; --ink: #EDEDEA; --ink-2: #BCC0C4; --muted: #A3A8AE;
  --rule: #34373B; --faint: #4A4E53; --accent: #F07A3E; --on-ink-accent: #B23A08;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--head-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.6 var(--serif); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(42px, 5.6vw, 80px); line-height: 1.03; letter-spacing: -0.025em; }
h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.05; }
h3 { font-size: 23px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; max-width: 64ch; }
.lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.55; color: var(--ink-2); max-width: 36rem; }
.muted { color: var(--ink-2); }
.label { font: 600 15px/1.4 var(--sans); color: var(--muted); }
.sans { font-family: var(--sans); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--pad); top: 12px; z-index: 40; background: var(--paper); border: 1px solid var(--ink); padding: 10px 14px; font-family: var(--sans); }

.wrap {
  max-width: var(--frame); margin-inline: auto;
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
}

/* ---------- header ---------- */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--ink); }
.site-head .wrap { display: flex; align-items: center; gap: 16px 40px; min-height: var(--head-h); }
.wordmark { font: 500 27px/1 var(--serif); letter-spacing: -0.01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 30px; font: 500 15px/1.4 var(--sans); }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]:not(.btn-line) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px; }
.nav-toggle { display: none; }
@media (max-width: 1000px) {
  .site-head .wrap { flex-wrap: wrap; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; margin-left: auto; min-height: 44px; padding: 0 18px;
    font: 600 15px var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--ink); cursor: pointer;
  }
  .js .nav { display: none; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 16px; }
  .js .site-head[data-open] .nav { display: grid; gap: 2px; padding: 4px 0 22px; }
  .js .site-head[data-open] .nav a { padding: 10px 0; font-size: 18px; color: var(--ink); }
  .js .site-head[data-open] .nav .btn-line { justify-self: start; margin-top: 10px; }
}

/* ---------- buttons and links ---------- */
.btn, .btn-line {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px;
  font: 600 16px/1 var(--sans); text-decoration: none; border: 1px solid var(--ink); transition: background-color .2s ease, color .2s ease;
}
.btn { background: var(--ink); color: var(--paper); }
.btn:hover { background: transparent; color: var(--ink); }
.btn-line { background: transparent; color: var(--ink); min-height: 44px; padding: 0 20px; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.textlink { font: 600 16px/1.4 var(--sans); color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.textlink:hover { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; margin-top: 6px; }

/* ---------- sections ---------- */
.band { border-top: 1px solid var(--ink); }
.band.tint { background: var(--paper-2); }
.band > .wrap { padding-block: clamp(64px, 9vw, 104px); }
.stack { display: flex; flex-direction: column; gap: 22px; }
.split { display: flex; flex-wrap: wrap; gap: 24px 80px; align-items: start; }
.split > .side { flex: 1 1 260px; min-width: 0; }
.split > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.split > .side h2 { font-size: clamp(30px, 3vw, 40px); line-height: 1.1; }
.split > .main > .tblock { max-width: 46rem; }
.intro { display: flex; flex-wrap: wrap; gap: 20px 80px; align-items: end; margin-bottom: clamp(36px, 5vw, 56px); }
.intro > h2 { flex: 1 1 420px; max-width: 15ch; }
.intro > p { flex: 1 1 420px; }
.statement { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.35; letter-spacing: -0.01em; max-width: 36ch; }

/* ---------- hero ---------- */
.hero > .wrap { padding-block: clamp(64px, 9vw, 112px); display: flex; flex-wrap: wrap; gap: 64px 80px; align-items: center; }
.hero .copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { max-width: 14ch; }
.hero .aside { flex: 1 1 460px; min-width: 0; }
.hero.solo h1 { max-width: 20ch; }

/* ---------- title blocks: the ruled boxes from a drawing sheet ---------- */
.tblock { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border: 1px solid var(--ink); font: 13.5px/1.4 var(--sans); margin: 0; }
.tblock > div { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--ink); }
.tblock > div:last-child { border-right: 0; }
.tblock dt, .tblock .k { color: var(--muted); }
.tblock dd, .tblock .v { margin: 0; font-weight: 600; }
.tblock .v.gw { color: var(--accent); }
@media (max-width: 640px) {
  .tblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tblock > div { border-bottom: 1px solid var(--ink); }
  .tblock > div:nth-child(2n) { border-right: 0; }
  .tblock > div:nth-last-child(-n+2):nth-child(odd), .tblock > div:last-child { border-bottom: 0; }
}

/* ---------- the redacted document ---------- */
.doc { border: 1px solid var(--ink); border-bottom: 0; background: var(--paper); padding: clamp(24px, 3.4vw, 40px); display: flex; flex-direction: column; gap: 16px; font-size: 18px; line-height: 1.75; }
.doc p { max-width: none; }
.doc .where { font: 600 13px/1.4 var(--sans); color: var(--muted); }
.rd { position: relative; white-space: nowrap; }
.rd .bar {
  position: absolute; left: -3px; right: -3px; top: 3px; bottom: 2px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; overflow: hidden; transform-origin: left center;
}
.rd .bar span { font: 500 0.56em/1 var(--mono); letter-spacing: 0.04em; color: var(--on-ink-accent); }
.js .redact .rd .bar { transform: scaleX(0); }
.js .redact .rd .bar span { opacity: 0; }
.js .redact.in .rd .bar { animation: rd-wipe 9s ease-in-out infinite; animation-delay: var(--d, 0s); }
.js .redact.in .rd .bar span { animation: rd-label 9s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes rd-wipe { 0%, 10% { transform: scaleX(0); } 18%, 82% { transform: scaleX(1); } 90%, 100% { transform: scaleX(0); } }
@keyframes rd-label { 0%, 22% { opacity: 0; } 30%, 76% { opacity: 1; } 84%, 100% { opacity: 0; } }
.ph { font: 500 0.82em/1 var(--mono); color: var(--accent); white-space: nowrap; }

/* three stages of a request (Privacy Gateway page) */
.stages { border: 1px solid var(--ink); }
.stages .doc { border: 0; border-bottom: 1px solid var(--ink); }
.stages .doc.out { background: var(--paper-2); }
.stages .doc:last-child { border-bottom: 0; }
.stages + .tblock { border-top: 0; }
.drawing.wide { max-width: 860px; }
.drawing .t-mono { fill: var(--ink-2); font-family: var(--mono); font-size: 13px; }
.stages .gate { display: flex; align-items: center; gap: 12px; padding: 0 clamp(24px, 3.4vw, 40px); font: 600 13px/1 var(--sans); color: var(--accent); border-bottom: 1px solid var(--ink); min-height: 40px; }
.stages .gate::before { content: ""; width: 14px; height: 2px; background: var(--accent); }

/* ---------- line drawings ---------- */
.drawing { margin: 0; }
.drawing svg { display: block; width: 100%; height: auto; }
.drawing .slab { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.drawing .slab-edge { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.drawing .guide { fill: none; stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 5; }
.drawing .leader { stroke: var(--ink); stroke-width: 1; }
.drawing .box { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.drawing .gwline { stroke: var(--accent); stroke-width: 2; fill: none; }
.drawing .gwmark { stroke: var(--accent); stroke-width: 2.4; }
.drawing .t { fill: var(--ink); font-family: var(--serif); font-size: 20px; }
.drawing .t-sm { fill: var(--ink-2); font-family: var(--sans); font-size: 14px; }
.drawing .t-gw { fill: var(--accent); font-family: var(--sans); font-size: 15px; font-weight: 600; }
.js .drawing .ln { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .drawing.in .ln { animation: ln-draw 1.4s cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: var(--d, 0s); }
.js .drawing .fade { opacity: 0; }
.js .drawing.in .fade { animation: ln-fade .6s ease forwards; animation-delay: var(--d, 0s); }
@keyframes ln-draw { to { stroke-dashoffset: 0; } }
@keyframes ln-fade { to { opacity: 1; } }

/* ---------- lists ---------- */
.ruled { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ruled > li { border-top: 1px solid var(--rule); padding: 16px 0 18px; display: flex; flex-direction: column; gap: 4px; }
.ruled > li:first-child { border-top-color: var(--ink); }
.ruled > li:last-child { border-bottom: 1px solid var(--ink); }
.ruled p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.layers { display: flex; flex-wrap: wrap; gap: 48px 72px; align-items: center; }
.layers > .drawing { flex: 1 1 520px; min-width: 0; }
.layers > .ruled { flex: 1 1 380px; min-width: 0; }

.spec { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
.spec > div { border-top: 1px solid var(--rule); padding: 16px 0 22px; display: flex; flex-direction: column; gap: 6px; }
.spec > div:nth-child(-n+2) { border-top-color: var(--ink); }
.spec dt { font: 14px/1.4 var(--sans); color: var(--muted); }
.spec dd { margin: 0; font-size: 21px; line-height: 1.35; }
@media (max-width: 720px) { .spec { grid-template-columns: minmax(0, 1fr); } .spec > div:nth-child(2) { border-top-color: var(--rule); } }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 4px 20px; padding: 22px 0 24px; border-top: 1px solid var(--rule); }
.steps > li:first-child { border-top-color: var(--ink); }
.steps > li:last-child { border-bottom: 1px solid var(--ink); }
.steps > li::before { content: counter(step); grid-row: span 2; font: 400 34px/1 var(--serif); color: var(--ink); }
.steps p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }

.cols { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 0 40px; }
.cols > * { border-top: 1px solid var(--ink); padding: 18px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.cols p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); gap: 0; } .cols > * { padding-bottom: 22px; } }

/* What we build: one block per layer */
.layer-head { display: flex; flex-direction: column; gap: 14px; }
.layer-head .label { display: flex; align-items: center; gap: 10px; }
.layer-head svg { width: 40px; height: 22px; flex: none; }
.layer-head svg polygon { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.layer-head svg polygon.on { fill: var(--ink); }
.points { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 18px; }
.points li::marker { color: var(--muted); }

/* ---------- contact ---------- */
.addr { font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.01em; overflow-wrap: anywhere; }

/* ---------- closing band ---------- */
.closing { background: var(--ink); color: var(--paper); }
.closing .wrap { padding-block: clamp(72px, 9vw, 104px); display: flex; flex-wrap: wrap; gap: 32px 80px; align-items: end; }
.closing h2 { flex: 999 1 520px; max-width: 16ch; font-size: clamp(34px, 4.4vw, 60px); }
.closing p { color: var(--paper); opacity: .8; font-size: 19px; margin-top: 14px; }
.closing .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.closing .btn:hover { background: transparent; color: var(--paper); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--ink); font: 15px/1.5 var(--sans); }
.site-foot .wrap { padding-block: 48px 36px; display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.site-foot .wordmark { font-size: 24px; display: inline-block; margin-bottom: 12px; }
.site-foot p { color: var(--muted); max-width: 34ch; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-foot ul a { color: var(--ink-2); text-decoration: none; }
.site-foot ul a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.site-foot .fine { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; max-width: none; }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .site-foot .wrap > div:first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  .js .redact .rd .bar, .js .redact.in .rd .bar { transform: none; animation: none; }
  .js .redact .rd .bar span, .js .redact.in .rd .bar span { opacity: 1; animation: none; }
  .js .drawing .ln, .js .drawing.in .ln { stroke-dashoffset: 0; animation: none; }
  .js .drawing .fade, .js .drawing.in .fade { opacity: 1; animation: none; }
  .btn, .btn-line, .textlink { transition: none; }
}
