/*
  Legalbricks.io — design system CSS
  Source of truth: BRIEFLIE_DIGITAL_DESIGN.md v2.3 FINAL, BRIEFLIE_LOGO_IDENTITY.md v1.1 FINAL.
  Tokens below are transcribed 1:1 from §3–8 of the digital design spec. Do not invent new
  colours, spacing, radii or type sizes here — add to the source doc first if one is missing.
*/

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Primitive — neutrals */
  --ink-1000: oklch(0.16 0.006 250);
  --ink-900: oklch(0.22 0.006 250);
  --ink-800: oklch(0.30 0.006 250);
  --ink-700: oklch(0.38 0.006 250);
  --ink-600: oklch(0.46 0.006 250);
  --ink-500: oklch(0.54 0.006 250);
  --ink-400: oklch(0.62 0.006 250);
  --line-300: oklch(0.80 0.005 250);
  --line-200: oklch(0.88 0.004 250);
  --surface-100: oklch(0.94 0.003 250);
  --surface-50: oklch(0.975 0.002 250);
  --paper-0: oklch(0.99 0.002 250);
  --paper-dark-1000: oklch(0.19 0.008 250);
  --paper-dark-900: oklch(0.24 0.008 250);

  /* Primitive — brand accents */
  --brand-rail: oklch(0.52 0.15 235);
  --brand-rail-hover: oklch(0.46 0.15 235);
  --brand-signal: oklch(0.65 0.12 190);

  /* Primitive — semantic state */
  --state-success: oklch(0.58 0.15 145);
  --state-info: oklch(0.58 0.15 235);
  --state-warning: oklch(0.58 0.15 80);
  --state-critical: oklch(0.58 0.15 25);

  /* Semantic tokens */
  --color-bg-page: var(--paper-0);
  --color-bg-surface: var(--surface-50);
  --color-bg-subtle: var(--surface-100);
  --color-bg-dark: var(--paper-dark-1000);
  --color-bg-dark-raised: var(--paper-dark-900);
  --color-text-primary: var(--ink-1000);
  --color-text-secondary: var(--ink-700);
  --color-text-muted: var(--ink-600);
  --color-text-disabled: var(--ink-400);
  --color-text-on-dark: oklch(0.99 0.002 250);
  --color-text-on-dark-muted: oklch(0.80 0.01 250);
  --color-border-default: var(--line-200);
  --color-border-strong: var(--line-300);
  --color-action-primary: var(--brand-rail);
  --color-action-primary-hover: var(--brand-rail-hover);
  --color-focus: var(--brand-rail);

  /* Type */
  --font-display: "Switzer", "Archivo", "Inter", "Segoe UI", sans-serif;
  --font-ui: "General Sans", "Public Sans", "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* Spacing primitives */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Grid */
  --content-max: 1280px;
  --reading-max: 720px;
  --outer-margin: 64px;
}

@media (max-width: 1023px) {
  :root { --outer-margin: 32px; }
}

@media (max-width: 599px) {
  :root { --outer-margin: 20px; }
}

/* ---------------------------------------------------------------- reset */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- type scale */

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-action-primary);
}
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 5.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.2;
}
h4, .h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
}
.lead {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.5;
  color: var(--color-text-secondary);
  max-width: var(--reading-max);
}
.body-text { font-size: 16px; line-height: 1.6; color: var(--color-text-secondary); }
.caption { font-size: 12px; line-height: 1.4; color: var(--color-text-muted); }
.on-dark { color: var(--color-text-on-dark); }
.on-dark .lead, .on-dark .body-text { color: var(--color-text-on-dark-muted); }

/* ---------------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: calc(var(--content-max) + var(--outer-margin) * 2);
  margin-inline: auto;
  padding-inline: var(--outer-margin);
}
.section {
  padding-block: clamp(64px, 9vw, 128px);
}
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.section--surface { background: var(--color-bg-surface); }
.stack { display: flex; flex-direction: column; gap: var(--space-6); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--paper-0) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-default);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 76px;
}
.brand { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }
.brand img { height: 22px; width: auto; display: block; }

.nav-primary { display: flex; align-items: center; gap: var(--space-8); }
.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links > li { position: relative; }
.nav-link {
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--color-text-primary); }
.nav-link .chev { width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform 160ms ease; }
.nav-link[aria-expanded="true"] .chev { transform: rotate(225deg); margin-top: 3px; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(6, 26, 51, 0.12);
  padding: var(--space-2);
  display: none;
}
.nav-dropdown.is-open { display: block; }
.nav-dropdown a {
  display: block;
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.nav-dropdown a small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--color-text-muted);
}
.nav-dropdown a:hover { background: var(--color-bg-subtle); }

.header-actions { display: flex; align-items: center; gap: var(--space-4); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-pill);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink-1000); color: var(--paper-0); }

.nav-toggle {
  display: none;
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-page);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 1.6px;
  background: var(--ink-1000);
  position: relative;
}
.nav-toggle { flex-direction: column; gap: 4px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn--primary { background: var(--color-action-primary); color: var(--paper-0); }
.btn--primary:hover { background: var(--color-action-primary-hover); }
.btn--secondary { background: transparent; border-color: var(--color-border-strong); color: var(--color-text-primary); }
.btn--secondary:hover { border-color: var(--ink-1000); }
.btn--on-dark.btn--secondary { border-color: rgba(255,255,255,0.35); color: var(--color-text-on-dark); }
.btn--on-dark.btn--secondary:hover { border-color: rgba(255,255,255,0.7); }
.btn--text {
  height: auto;
  padding: 0;
  background: none;
  color: var(--color-action-primary);
  font-weight: 600;
}
.btn--text::after { content: "→"; margin-left: 2px; }
.btn--sm { height: 36px; padding: 0 var(--space-4); font-size: 13px; }

/* ---------------------------------------------------------------- hero */

.hero { padding-block: clamp(56px, 9vw, 112px) clamp(48px, 7vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.hero h1 { margin-top: var(--space-4); max-width: 640px; }
.hero .lead { margin-top: var(--space-5); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-8); }
.hero-visual {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  padding: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

/* ---------------------------------------------------------------- diagram */

.diagram { width: 100%; height: auto; }
.diagram-node rect { fill: var(--surface-50); stroke: var(--color-border-strong); stroke-width: 1; }
.diagram-node.brand rect { stroke: var(--brand-rail); stroke-width: 1.5; }
.diagram-node text { font-family: var(--font-ui); font-size: 13px; font-weight: 600; fill: var(--ink-1000); }
.diagram-node .sub { font-size: 11px; font-weight: 400; fill: var(--ink-600); }
.diagram-arrow { stroke: var(--brand-rail); stroke-width: 1.5; fill: none; marker-end: url(#arrowhead); }
.diagram-arrow.dashed { stroke: var(--ink-500); stroke-dasharray: 3 3; }

/* ---------------------------------------------------------------- problem list */

.claim-list { display: grid; gap: var(--space-6); grid-template-columns: repeat(3, 1fr); }
.claim-item { padding-top: var(--space-5); border-top: 2px solid var(--brand-rail); }
.claim-item strong { display: block; font-size: 17px; font-weight: 600; color: var(--color-text-primary); margin-bottom: var(--space-2); }
.claim-item p { font-size: 14.5px; color: var(--color-text-muted); line-height: 1.55; }

/* ---------------------------------------------------------------- three column modules */

.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.module-card {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-bg-page);
}
.module-card h3 { font-size: 19px; }
.module-card p { font-size: 14.5px; color: var(--color-text-muted); flex: 1; }

/* ---------------------------------------------------------------- feature table */

.table-scroll { overflow-x: auto; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); }
.feature-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.feature-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border-default);
}
.feature-table td {
  padding: var(--space-4) var(--space-5);
  font-size: 14.5px;
  line-height: 1.5;
  border-bottom: 1px solid var(--color-border-default);
  vertical-align: top;
}
.feature-table tr:last-child td { border-bottom: none; }
.feature-table td:first-child { color: var(--color-text-primary); font-weight: 500; width: 46%; }
.feature-table td:last-child { color: var(--color-text-muted); }

/* ---------------------------------------------------------------- cards / callouts */

.callout {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  background: var(--color-bg-surface);
}
.callout--rail { border-color: var(--brand-rail); background: color-mix(in oklab, var(--brand-rail) 6%, var(--paper-0)); }

.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-10); align-items: start; }

/* ---------------------------------------------------------------- pricing */

.price-block {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  background: var(--color-bg-page);
}
.price-figure {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price-unit { font-size: 16px; color: var(--color-text-muted); margin-top: var(--space-2); }

/* ---------------------------------------------------------------- faq */

.faq-item { padding-block: var(--space-5); border-bottom: 1px solid var(--color-border-default); }
.faq-item:first-child { border-top: 1px solid var(--color-border-default); }
.faq-item strong { display: block; font-size: 15px; margin-bottom: var(--space-2); }
.faq-item p { font-size: 14.5px; color: var(--color-text-muted); }

/* ---------------------------------------------------------------- legal text */

.legal-body h2 { margin-top: var(--space-10); font-size: 20px; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { font-size: 15px; line-height: 1.7; color: var(--color-text-secondary); margin-top: var(--space-4); }
.legal-body ul { list-style: disc; padding-left: 22px; }
.legal-body a { color: var(--color-action-primary); text-decoration: underline; }

/* ---------------------------------------------------------------- form */

.contact-form { display: grid; gap: var(--space-5); max-width: 560px; }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.field input, .field select, .field textarea {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  padding: 0 var(--space-4);
  font: inherit;
  font-size: 14.5px;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
}
.field textarea { height: auto; min-height: 120px; padding: var(--space-3) var(--space-4); resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.form-note { font-size: 13px; color: var(--color-text-muted); }
.form-note a { color: var(--color-action-primary); }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--color-border-default); background: var(--color-bg-surface); }
.site-footer .container { padding-block: var(--space-16) var(--space-10); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--color-border-default);
}
.footer-brand img { height: 20px; margin-bottom: var(--space-4); }
.footer-brand p { font-size: 13.5px; color: var(--color-text-muted); max-width: 260px; line-height: 1.6; }
.footer-col h5 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a { font-size: 14px; text-decoration: none; color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-text-primary); }
.footer-bottom {
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 13px;
  color: var(--color-text-muted);
}
.footer-legal-links { display: flex; gap: var(--space-5); }
.footer-legal-links a { color: var(--color-text-muted); text-decoration: none; }
.footer-legal-links a:hover { color: var(--color-text-primary); }
.descriptor { letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; font-weight: 700; color: var(--color-text-muted); }

/* ---------------------------------------------------------------- 404 */

.notfound { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
.notfound-links { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin-top: var(--space-6); }
.notfound-links a { color: var(--color-action-primary); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.notfound-links a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- i18n visibility */

/* !important is deliberate: language visibility must always win over any
   component's own `display` rule (e.g. `.claim-item strong { display: block }`),
   regardless of that rule's specificity. Without it, component styles can pin
   an element visible in both languages at once. */
[data-lang] { display: none !important; }
html[data-language="da"] [data-lang="da"],
html[data-language="en"] [data-lang="en"] { display: block !important; }
html[data-language="da"] .inline[data-lang="da"],
html[data-language="en"] .inline[data-lang="en"] { display: inline !important; }
html[data-language="da"] .flex[data-lang="da"],
html[data-language="en"] .flex[data-lang="en"] { display: flex !important; }
html[data-language="da"] .grid[data-lang="da"],
html[data-language="en"] .grid[data-lang="en"] { display: grid !important; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1023px) {
  .nav-links, .header-actions .btn--primary { display: none; }
  .nav-toggle { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .module-grid { grid-template-columns: 1fr; }
  .claim-list { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-10) var(--space-6); }
}

@media (min-width: 1024px) {
  .mobile-nav-panel { display: none !important; }
}

@media (max-width: 599px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  h1, .h1 { font-size: 32px; }
}

/* mobile nav panel */
.mobile-nav-panel {
  position: fixed;
  inset: 76px 0 0 0;
  background: var(--color-bg-page);
  z-index: 39;
  padding: var(--space-6) var(--outer-margin);
  overflow-y: auto;
  display: none;
}
.mobile-nav-panel.is-open { display: block; }
.mobile-nav-panel ul { display: flex; flex-direction: column; gap: var(--space-2); }
.mobile-nav-panel > ul > li > a,
.mobile-nav-panel > ul > li > span {
  display: block;
  padding: var(--space-4) 0;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-default);
}
.mobile-nav-sub { padding-left: var(--space-4); display: flex; flex-direction: column; }
.mobile-nav-sub a { padding: var(--space-3) 0; font-size: 15px; font-weight: 500; color: var(--color-text-secondary); text-decoration: none; }
.mobile-nav-panel .btn { margin-top: var(--space-6); width: 100%; }
