/* SPDX-License-Identifier: GPL-3.0-only
 * Copyright (c) 2026 AethelisDEV / Aeon Platform. All rights reserved.
 *
 * Base layer — reset, document defaults, typography and small utilities.
 *
 * Two rules govern everything below:
 *   1. **Logical properties only.** `margin-inline-start`, `padding-block`, `inset-inline-end` and
 *      friends. Arabic mirrors the entire layout by setting `dir="rtl"` on <html> and needs no
 *      separate stylesheet as a result.
 *   2. **No raw values.** Colour, size, radius, shadow and easing all come from tokens.css.
 */

/* ---------------------------------------------------------------------------------------------
 * Webfont — Manrope, self-hosted.
 *
 * One variable file per subset rather than one file per weight: the whole 400–800 range arrives in
 * 24 KB for Latin, and a heading at 800 costs nothing extra once the face is cached. Self-hosted
 * because the Content-Security-Policy is a flat `font-src 'self'` (see config/security.php) — a
 * Google Fonts URL would simply be blocked.
 *
 * `unicode-range` keeps a Turkish or Russian visitor from downloading subsets they cannot read.
 * Arabic is deliberately absent: it falls through to the platform's Naskh face, listed in
 * `--font-sans`.
 * ------------------------------------------------------------------------------------------- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* ---------------------------------------------------------------------------------------------
 * Reset
 * ------------------------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections must not hide behind the sticky navigation bar. */
  scroll-padding-block-start: calc(var(--nav-height-lg) + var(--space-4));
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--canvas);
  color: var(--label);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  inline-size: 100%;
}

hr {
  border: 0;
  block-size: 1px;
  background-color: var(--separator);
}

/* Firefox needs the explicit rule; other engines inherit from the `*` reset. */
fieldset {
  border: 0;
}

/* ---------------------------------------------------------------------------------------------
 * Focus — always visible for keyboard users, never a click artefact for pointer users.
 * ------------------------------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ---------------------------------------------------------------------------------------------
 * Selection
 * ------------------------------------------------------------------------------------------- */
::selection {
  background-color: var(--accent-soft);
  color: var(--label);
}

/* ---------------------------------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-title);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display-m);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-display-s);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-display);
}

h3 {
  font-size: var(--text-title-1);
}

h4 {
  font-size: var(--text-title-2);
}

h5 {
  font-size: var(--text-title-3);
}

h6 {
  font-size: var(--text-body);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: var(--weight-semibold);
}

small {
  font-size: var(--text-footnote);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---------------------------------------------------------------------------------------------
 * Text utilities
 * ------------------------------------------------------------------------------------------- */
.lede {
  font-size: clamp(var(--text-body), 0.95rem + 0.5vw, var(--text-title-3));
  line-height: var(--leading-relaxed);
  color: var(--label-secondary);
  text-wrap: pretty;
}

.eyebrow {
  display: block;
  font-size: var(--text-footnote);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  /* The darkened orange, not the brand orange: this is small text on a white band. */
  color: var(--accent-text);
}

/* The same eyebrow set over a navy panel, where the brand orange has plenty of contrast. */
.eyebrow--on-ink {
  color: var(--brand-hover);
}

/* A word inside a headline picked out in brand orange — the hero's "Perfect" treatment. */
.hl {
  color: var(--brand);
}

.muted {
  color: var(--label-secondary);
}

.subtle {
  color: var(--label-tertiary);
}

.numeric {
  /* Tabular figures keep price columns and metric rows from shifting as digits change. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.clamp-3 {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* ---------------------------------------------------------------------------------------------
 * Accessibility helpers
 * ------------------------------------------------------------------------------------------- */

/* Visible only to assistive technology. */
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* First tab stop on every page; slides into view when focused. */
.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background-color: var(--surface);
  color: var(--label);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-m);
  transform: translateY(-200%);
  transition: transform var(--duration-base) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------------------------
 * Reduced motion — honour the system setting rather than merely shortening durations.
 * ------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

/* ---------------------------------------------------------------------------------------------
 * Print — strip chrome, keep content readable.
 * ------------------------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
