/* ==========================================================================
   Cosmo Design System — tokens
   Colours, fonts and radii come from the app (brand/tokens.json).
   Spacing, type scale, motion and elevation are defined here for the web.
   ========================================================================== */

@font-face { font-family: "Outfit"; src: url("../fonts/Outfit-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/Outfit-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/Outfit-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/Andika-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/Andika-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../fonts/SpaceMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;

  /* ---- Colour: brand (from the app) ---- */
  --color-space-dark: #060818;   /* page background */
  --color-space-card: #0C1228;   /* cards, panels */
  --color-space-raised: #131B38; /* hover / raised surfaces (web addition) */
  --color-amber: #F2A623;        /* the one hero accent */
  --color-amber-hover: #F7BC4F;
  --color-teal: #5DCAA5;         /* secondary accent, success, focus */
  --color-text: #E8EAF2;         /* 16.6:1 on space-dark */
  --color-text-dim: #8A90B0;     /* 6.3:1 on space-dark — secondary text */
  --color-line: #4A5070;         /* 2.5:1 — hairlines and decoration ONLY, never text */
  --color-line-soft: rgba(138, 144, 176, 0.18);
  --color-wrong: #E05A5A;
  --color-on-amber: #060818;     /* text on amber: 9.7:1 (white fails at 2.0:1) */

  /* ---- Colour: planets (feature accents) ---- */
  --planet-mercury: #B4B2A9;
  --planet-venus: #EF9F27;
  --planet-earth: #378ADD;
  --planet-mars: #D85A30;
  --planet-jupiter: #C88B3A;
  --planet-saturn: #E8D5A3;
  --planet-uranus: #73C2D0;
  --planet-neptune: #3E54E8;
  --planet-moon: #95A5A6;

  /* ---- Glow ---- */
  --glow-sun: radial-gradient(circle at 50% 50%, rgba(242, 166, 35, 0.45), rgba(242, 166, 35, 0.12) 40%, transparent 70%);
  --gradient-sun: radial-gradient(circle at 35% 35%, #FFD700, #F2A623);

  /* ---- Type ---- */
  --font-display: "Outfit", "Andika", system-ui, sans-serif;
  --font-body: "Andika", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --text-xs: 0.875rem;                                  /* 14px — legal lines, captions only */
  --text-sm: 1rem;                                      /* 16px — minimum body */
  --text-md: 1.125rem;                                  /* 18px — default body */
  --text-lg: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);/* lead paragraph */
  --text-h4: 1.25rem;
  --text-h3: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-h2: clamp(2rem, 1.55rem + 2vw, 3.25rem);
  --text-h1: clamp(2.5rem, 1.7rem + 4vw, 4.75rem);
  --text-stat: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);

  --leading-body: 1.5;
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --tracking-wordmark: 0.02em;
  --measure: 65ch;

  /* ---- Spacing (4 / 8 rhythm) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --section-pad: clamp(var(--space-8), 6vw + 24px, var(--space-10));
  --gutter: clamp(var(--space-4), 4vw, var(--space-7));
  --container: 1200px;

  /* ---- Radius (from the app) ---- */
  --radius-button: 12px;
  --radius-card: 16px;
  --radius-chip: 20px;
  --radius-phone: 44px;
  --radius-screen: 34px;

  /* ---- Elevation ---- */
  --shadow-card: 0 1px 0 rgba(232, 234, 242, 0.04) inset, 0 16px 40px rgba(0, 0, 0, 0.35);
  --shadow-phone: 0 32px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 234, 242, 0.08);

  /* ---- Focus ---- */
  --focus-ring: 3px solid var(--color-teal);
  --focus-offset: 3px;

  /* ---- Motion ---- */
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --orbit-duration: 60s;
}

/* Macedonian (Cyrillic): Outfit has no Cyrillic, so headings use Andika. */
:root:lang(mk) { --font-display: "Andika", system-ui, sans-serif; }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--color-space-dark);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: var(--leading-snug); margin: 0; text-wrap: balance; overflow-wrap: break-word; }
p { margin: 0; max-width: var(--measure); }
img { max-width: 100%; }
a { color: var(--color-teal); text-underline-offset: 3px; }
a:hover { color: var(--color-text); }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-radius: 4px; }

[hidden] { display: none !important; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
