/* Public landing page for the ISO 20022 Address Parser.
   Brand tokens copied verbatim from the Raafet Choukri design language (section 2).
   Fonts are SELF-HOSTED (not Google Fonts): the served CSP is default-src 'self'
   and the privacy posture forbids third-party calls. Low-motion per the design MD
   (no entrance animations); depth is borders + elevation overlays, not shadows.
   Aesthetic: an engineering spec sheet for payments infrastructure. ASCII only. */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (design MD section 2, verbatim) ---------- */
:root {
  --background: 210 20% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --card-border: 214 20% 92%;
  --border: 214 20% 90%;
  --primary: 199 89% 48%;
  --primary-foreground: 0 0% 100%;
  --secondary: 214 20% 94%;
  --secondary-foreground: 222 47% 11%;
  --muted: 214 20% 92%;
  --muted-foreground: 215 16% 47%;
  --accent: 172 66% 50%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 84% 60%;
  --input: 214 20% 85%;
  --ring: 199 89% 48%;
  --sidebar: 222 47% 11%;
  --sidebar-foreground: 210 20% 98%;
  --chart-4: 43 74% 49%;
  --elevate-1: rgba(0, 0, 0, 0.03);
  --elevate-2: rgba(0, 0, 0, 0.08);
  --radius: 0.5rem;
  --radius-card: 0.75rem;
  --ok-text: 172 66% 24%;
  --warn-text: 43 74% 30%;
  --grid-line: 214 20% 88%;
  /* darker primary for small/large text on the light background (AA contrast) */
  --primary-text: 199 89% 36%;
}

.dark {
  --background: 222 47% 7%;
  --foreground: 210 20% 98%;
  --card: 222 47% 11%;
  --card-foreground: 210 20% 98%;
  --card-border: 222 40% 16%;
  --border: 222 40% 18%;
  --secondary: 222 40% 18%;
  --secondary-foreground: 210 20% 98%;
  --muted: 222 40% 16%;
  --muted-foreground: 215 16% 60%;
  --input: 222 40% 22%;
  --sidebar: 222 47% 5%;
  --elevate-1: rgba(255, 255, 255, 0.04);
  --elevate-2: rgba(255, 255, 255, 0.09);
  --ok-text: 172 66% 58%;
  --warn-text: 43 74% 60%;
  --grid-line: 222 40% 14%;
  --primary-text: 199 89% 48%;
}

/* ---------- Elevation overlays (design MD section 2) ---------- */
.hover-elevate, .active-elevate { position: relative; }
.hover-elevate::after, .active-elevate::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  pointer-events: none;
  z-index: 5;
}
.hover-elevate:hover::after { background: var(--elevate-1); }
.active-elevate:active::after { background: var(--elevate-2); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
body {
  margin: 0;
  font-family: "Inter", "Plus Jakarta Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  font-size: 16px;
}
a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: var(--radius); }
img { max-width: 100%; display: block; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.mono { font-family: "JetBrains Mono", "Fira Code", monospace; }

/* eyebrow label: spec-sheet voice */
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: hsl(var(--primary-text));
}

/* ---------- Nav ---------- */
#top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--background) / 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}
.nav-inner { height: 4rem; display: flex; align-items: center; gap: 0.6rem; }
.brand { font-size: 1.125rem; font-weight: 600; white-space: nowrap; }
.nav-sep { color: hsl(var(--muted-foreground)); }
.nav-product { font-size: 0.875rem; font-weight: 500; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.nav-spacer { flex: 1; }
.nav-link { font-size: 0.875rem; font-weight: 500; color: hsl(var(--muted-foreground)); transition: color 150ms; white-space: nowrap; padding: 0.5rem 0; }
.nav-link:hover { color: hsl(var(--foreground)); text-decoration: none; }
.nav-cta {
  font-size: 0.85rem; font-weight: 600;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--primary));
  padding: 0.4rem 0.85rem; border-radius: var(--radius);
}
.nav-cta:hover { text-decoration: none; }

#theme-toggle {
  height: 2.75rem; width: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid hsl(var(--border)); background: transparent; border-radius: var(--radius);
  color: hsl(var(--foreground)); cursor: pointer;
}
#theme-toggle svg { width: 1.15rem; height: 1.15rem; }
#theme-toggle .icon-moon { display: none; }
.dark #theme-toggle .icon-sun { display: none; }
.dark #theme-toggle .icon-moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: inherit; font-size: 0.95rem; font-weight: 600;
  border-radius: var(--radius); padding: 0.7rem 1.2rem; cursor: pointer;
  border: 1px solid transparent; transition: color 150ms, background-color 150ms, border-color 150ms;
}
.btn svg { width: 1.05rem; height: 1.05rem; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.btn-outline { background: hsl(var(--card)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid hsl(var(--border)); }
/* faint technical grid: a texture, not a decorative orb. Very low contrast. */
.hero::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(hsl(var(--grid-line) / 0.6) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--grid-line) / 0.6) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.7;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  padding: 4rem 0 4.5rem;
  align-items: center;
}
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr 1.15fr; gap: 3rem; padding: 5rem 0 5.5rem; } }

.hero-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary-text));
  border: 1px solid hsl(var(--primary) / 0.25);
  border-radius: 9999px; padding: 0.28rem 0.8rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.85rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin: 1.1rem 0 0;
}
.hero h1 .text-primary { color: hsl(var(--primary-text)); }
.hero-sub { font-size: 1.12rem; color: hsl(var(--muted-foreground)); max-width: 38ch; margin: 1.1rem 0 0; }
.hero-sub code { font-family: "JetBrains Mono", monospace; font-size: 0.92em; color: hsl(var(--foreground)); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.hero-note { margin-top: 1rem; font-size: 0.8rem; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: 0.4rem; }
.hero-note svg { width: 0.95rem; height: 0.95rem; color: hsl(var(--muted-foreground)); flex: none; }

/* product window frame around the real screenshot */
.window {
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius-card);
  background: hsl(var(--card));
  overflow: hidden;
}
.window-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.8rem; border-bottom: 1px solid hsl(var(--card-border));
  background: hsl(var(--secondary));
}
.window-dots { display: flex; gap: 0.35rem; }
.window-dots i { width: 0.6rem; height: 0.6rem; border-radius: 9999px; background: hsl(var(--muted-foreground) / 0.45); display: block; }
.window-url {
  flex: 1; text-align: center;
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; color: hsl(var(--muted-foreground));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.window img { width: 100%; height: auto; }

/* ---------- Pipeline strip ---------- */
.pipeline-wrap { border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.pipeline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.65rem;
  padding: 1.4rem 0; justify-content: center;
}
.pipe-node {
  font-family: "JetBrains Mono", monospace; font-size: 0.78rem; font-weight: 600;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 0.4rem 0.7rem; white-space: nowrap;
}
.pipe-arrow { color: hsl(var(--primary-text)); font-weight: 700; }

/* ---------- Sections ---------- */
section.block { padding: 4.5rem 0; border-bottom: 1px solid hsl(var(--border)); }
.section-head { max-width: 60ch; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.15rem); font-weight: 700; letter-spacing: -0.02em; margin: 0.6rem 0 0; }
.section-head p { color: hsl(var(--muted-foreground)); margin: 0.7rem 0 0; font-size: 1.02rem; }
.section-head code { font-family: "JetBrains Mono", monospace; font-size: 0.9em; color: hsl(var(--foreground)); }

.grid-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 2.2rem; }
@media (min-width: 640px) { .grid-cards.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 880px) { .grid-cards.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--card-border)); border-radius: var(--radius-card);
  padding: 1.4rem;
}
.card .icon-tile {
  width: 2.3rem; height: 2.3rem; border-radius: var(--radius);
  background: hsl(var(--primary) / 0.1); color: hsl(var(--primary));
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.9rem;
}
.card .icon-tile svg { width: 1.25rem; height: 1.25rem; }
.card .step-tag { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: hsl(var(--muted-foreground)); letter-spacing: 0.08em; }
.card h3 { font-size: 1.05rem; font-weight: 600; margin: 0.2rem 0 0.4rem; }
.card p { color: hsl(var(--muted-foreground)); font-size: 0.92rem; margin: 0; }

.preview-note {
  display: flex; gap: 0.55rem; align-items: flex-start;
  margin-top: 1.8rem; font-size: 0.85rem; color: hsl(var(--muted-foreground));
  max-width: 70ch;
}
.preview-note svg { width: 1rem; height: 1rem; flex: none; margin-top: 0.2rem; color: hsl(var(--primary)); }

/* problem section: stat row */
.problem-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; margin-top: 0.5rem; }
@media (min-width: 900px) { .problem-grid { grid-template-columns: 1.2fr 0.8fr; gap: 3rem; } }
.deadline-card {
  border: 1px solid hsl(var(--card-border)); border-radius: var(--radius-card);
  background: hsl(var(--sidebar)); color: hsl(var(--sidebar-foreground));
  padding: 1.6rem;
}
.deadline-card .big { font-family: "JetBrains Mono", monospace; font-size: 2.1rem; font-weight: 600; color: hsl(var(--primary)); letter-spacing: -0.02em; }
.deadline-card .lbl { font-size: 0.85rem; color: hsl(210 20% 80%); margin-top: 0.3rem; }
.deadline-card hr { border: none; border-top: 1px solid hsl(var(--sidebar-foreground) / 0.14); margin: 1.1rem 0; }
.deadline-card .row { font-size: 0.85rem; color: hsl(210 20% 84%); display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.25rem 0; }
.deadline-card .row svg { width: 1rem; height: 1rem; color: hsl(var(--accent)); flex: none; margin-top: 0.15rem; }

/* evidence section */
.evidence-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; margin-top: 2.2rem; }
@media (min-width: 940px) { .evidence-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li { display: flex; gap: 0.7rem; padding: 0.75rem 0; border-bottom: 1px dotted hsl(var(--border)); align-items: flex-start; }
.spec-list li:last-child { border-bottom: none; }
.spec-check { width: 1.2rem; height: 1.2rem; color: hsl(var(--accent)); flex: none; margin-top: 0.15rem; }
.spec-key { font-family: "JetBrains Mono", monospace; font-size: 0.82rem; font-weight: 600; color: hsl(var(--foreground)); }
.spec-val { color: hsl(var(--muted-foreground)); font-size: 0.9rem; margin-top: 0.15rem; }
.evidence-visual { border: 1px solid hsl(var(--card-border)); border-radius: var(--radius-card); overflow: hidden; background: hsl(var(--card)); }
.evidence-visual img { width: 100%; height: auto; }
.evidence-caption { font-family: "JetBrains Mono", monospace; font-size: 0.72rem; color: hsl(var(--muted-foreground)); padding: 0.7rem 0.9rem; border-top: 1px solid hsl(var(--card-border)); }

/* data handling + boundaries */
.callout {
  border-radius: var(--radius-card); padding: 1.5rem; border: 1px solid;
}
.callout h3 { margin: 0 0 0.6rem; font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.callout h3 svg { width: 1.15rem; height: 1.15rem; flex: none; }
.callout p { margin: 0.4rem 0 0; font-size: 0.92rem; }
.callout ul { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.92rem; }
.callout li { margin: 0.25rem 0; }
.callout-info { background: hsl(var(--secondary)); border-color: hsl(var(--border)); }
.callout-info h3 svg { color: hsl(var(--primary)); }
.callout-info p, .callout-info li { color: hsl(var(--muted-foreground)); }
.callout-warn { background: hsl(var(--chart-4) / 0.1); border-color: hsl(var(--chart-4) / 0.35); }
.callout-warn h3 { color: hsl(var(--warn-text)); }
.callout-warn h3 svg { color: hsl(var(--warn-text)); }
.callout-warn p, .callout-warn li { color: hsl(var(--foreground)); }
.handling-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 2.2rem; }
@media (min-width: 820px) { .handling-grid { grid-template-columns: 1fr 1fr; } }

/* final CTA */
.cta-band { padding: 4.5rem 0; }
.cta-card {
  border: 1px solid hsl(var(--card-border)); border-radius: var(--radius-card);
  background: hsl(var(--sidebar)); color: hsl(var(--sidebar-foreground));
  padding: 2.6rem; text-align: center;
}
.cta-card h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.cta-card p { color: hsl(210 20% 80%); margin: 0.8rem auto 0; max-width: 52ch; }
.cta-card .hero-actions { justify-content: center; }
.cta-card .auth-note { font-family: "JetBrains Mono", monospace; font-size: 0.74rem; color: hsl(210 20% 70%); margin-top: 1.1rem; }

/* ---------- Footer ---------- */
footer { background: hsl(var(--card)); border-top: 1px solid hsl(var(--border)); padding: 2.75rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; justify-content: space-between; font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.footer-inner a { color: hsl(var(--muted-foreground)); transition: color 150ms; }
.footer-inner a:hover { color: hsl(var(--foreground)); text-decoration: none; }
.footer-posture { flex-basis: 100%; max-width: 70ch; line-height: 1.55; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .nav-product, .nav-sep { display: none; }
  section.block { padding: 3.2rem 0; }
  .hero-grid { padding: 3rem 0 3.2rem; }
  .hero-sub { max-width: none; }
  .nav-cta { display: none; }
}
@media (max-width: 480px) {
  /* secondary anchor links drop on small phones (like the nav CTA); the brand,
     theme toggle, and the prominent hero CTA remain, so no nav overflow. */
  .nav-link { display: none; }
}
@media (max-width: 420px) {
  .window-url { font-size: 0.62rem; }
}
