/*
 * 13 — anonymous end-to-end encrypted messenger.
 * Copyright (C) 2026 Free Minds
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
/* 13 v3 — designtokens. Midlertidige: intet er låst før M7.
 * Farver står som #rrggbb, så kontrasten kan regnes efter.
 * Grøn bruges kun til sikkerhed (--v3-safe*). */

:root {
  /* Flader */
  --v3-bg: #0b0b0c;
  --v3-surface: #141416;
  --v3-raised: #1c1c1f;
  --v3-line: #2a2a2e;
  --v3-line-strong: #3a3a40;

  /* Tekst */
  --v3-text: #ede6d6;
  --v3-text-dim: #a8a196;
  --v3-text-faint: #8a847a;

  /* Metaller */
  --v3-gold: #c9a96a;
  --v3-gold-bright: #e2c78f;
  --v3-gold-deep: #8c6f3a;
  --v3-platinum: #c8ccd2;
  --v3-platinum-deep: #7d828a;

  /* Kun til sikkerhed og fejl */
  --v3-safe: #5fbf8f;
  --v3-safe-deep: #173a2a;
  --v3-danger: #e0907e;
  /* Rolig gul: det ene, der mangler. Aldrig en alarm. */
  --v3-notice: #e6c86e;

  /* Accent (skiftes af temaet) */
  --v3-accent: #c9a96a;
  --v3-accent-ink: #0b0b0c;
  --v3-accent-line: #8c6f3a;
  --v3-qr-bg: #cfc8b9;

  /* Typografi */
  --v3-font-display: 'Cormorant Garamond', 'Palatino Linotype', Palatino, Georgia, serif;
  --v3-font-text: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --v3-font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace;
  --v3-size-xs: 12px;
  --v3-size-s: 14px;
  --v3-size-m: 16px;
  --v3-size-l: 20px;
  --v3-size-xl: 28px;
  --v3-size-display: 44px;
  --v3-leading: 1.5;
  --v3-tracking-caps: 0.14em;

  /* Afstand (4-trin) */
  --v3-s1: 4px;
  --v3-s2: 8px;
  --v3-s3: 12px;
  --v3-s4: 16px;
  --v3-s5: 24px;
  --v3-s6: 32px;
  --v3-s7: 48px;
  --v3-s8: 72px;

  /* Radius */
  --v3-r-s: 8px;
  --v3-r-m: 14px;
  --v3-r-l: 22px;
  --v3-r-pill: 999px;

  /* Bevægelse. --v3-motion er 1 eller 0 og ganges på alle flytninger. */
  --v3-motion: 1;
  --v3-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --v3-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --v3-dur-fast: 120ms;
  --v3-dur: 240ms;
  --v3-dur-glow: 300ms;
  --v3-dur-seal: 1800ms;
  --v3-rise: 8px;

  /* Fokus skal altid kunne ses */
  --v3-focus: 0 0 0 2px #0b0b0c, 0 0 0 4px #e2c78f;
}

/* Temaer: guld (standard), sort og platin. Kun accenten skifter. */
/* --v3-qr-bg er baggrunden bag QR-moduler (--v3-bg): varm i guld, neutral i sort og kølig i platin. */
[data-theme='guld'] {
  --v3-accent: #c9a96a;
  --v3-accent-ink: #0b0b0c;
  --v3-accent-line: #8c6f3a;
  --v3-qr-bg: #cfc8b9;
}

[data-theme='sort'] {
  --v3-accent: #ede6d6;
  --v3-accent-ink: #0b0b0c;
  --v3-accent-line: #6a6a72;
  --v3-qr-bg: #c6c6c8;
}

[data-theme='platin'] {
  --v3-accent: #c8ccd2;
  --v3-accent-ink: #0b0b0c;
  --v3-accent-line: #7d828a;
  --v3-qr-bg: #abafb4;
}

/* Reduceret bevægelse: ingen flytning, kun en kort fade. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --v3-motion: 0;
    --v3-rise: 0px;
    --v3-dur-seal: 200ms;
    --v3-dur-glow: 0ms;
  }

  *,
  *::before,
  *::after {
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Basis til de statiske skærme */
.v3 {
  background: var(--v3-bg);
  color: var(--v3-text);
  font-family: var(--v3-font-text);
  font-size: var(--v3-size-m);
  line-height: var(--v3-leading);
  -webkit-font-smoothing: antialiased;
}

.v3 :focus-visible {
  outline: none;
  box-shadow: var(--v3-focus);
}

/* Overskrifter får fokus i koden for skærmlæsere, men kan ikke betjenes, så de får ingen ring. */
.v3 [tabindex="-1"]:focus,
.v3 [tabindex="-1"]:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Kun demo-tilstande (adresse med #): alt står straks i sluttilstanden, så skærmbilleder bliver ens. */
.v3-still *,
.v3-still *::before,
.v3-still *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition: none !important;
}

.v3-fade {
  animation: v3-fade var(--v3-dur) var(--v3-ease) both;
}

@keyframes v3-fade {
  from {
    opacity: 0;
    transform: translateY(calc(var(--v3-rise) * var(--v3-motion)));
  }
  to {
    opacity: 1;
    transform: none;
  }
}
