/* InHive VPN — shared design tokens.
   Sourced 1:1 from app/lib/core/theme/app_tokens.dart (AppColors / AppRadius / AppSpacing).
   Dark theme is default; light theme overrides applied via html[data-theme="light"]. */

/* ── Manrope variable font (self-hosted, no third-party request) ──────────
   Variable font: weights 400-800 from single file per subset.
   unicode-range lets the browser fetch only the subsets actually needed. */
@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;
}
@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-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-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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ── Brand (AppColors.gold / .goldDim) ─────────────────────────────── */
  --gold: #F2B454;               /* primary brand gold — same as AppColors.gold */
  --gold-dim: rgba(242, 180, 84, 0.20);
  --gold-glow: rgba(242, 180, 84, 0.40);   /* dual-tunnel glow ref */
  --accent-gold: #F2B454;        /* always-bright accent — for dots, borders, badges, regardless of theme */
  --selected-border: #FF8F00;    /* AppColors.selectedBorder */

  /* ── Dark surfaces (default) ──────────────────────────────────────── */
  --bg: #121212;                 /* AppColors.darkBg */
  --surface: #1E1E1E;            /* AppColors.darkSurface */
  --surface-high: #2A2A2A;       /* AppColors.darkSurfaceHigh */
  --border: #333333;             /* AppColors.darkSurfaceBorder */
  --hover: rgba(255, 255, 255, 0.04);   /* app hoverColor on dark */

  /* ── Text (dark theme) ─────────────────────────────────────────────── */
  --text: rgba(255, 255, 255, 0.87);    /* AppColors.textPrimary */
  --muted: rgba(255, 255, 255, 0.60);   /* AppColors.textSecondary */
  --disabled: rgba(255, 255, 255, 0.38);

  /* ── Status (AppColors.*) ──────────────────────────────────────────── */
  --connected: #4CAF50;
  --warning: #FF9800;
  --error: #E53935;

  /* ── Network badges (AppColors.tcp / .udp) ─────────────────────────── */
  --tcp: #42A5F5;
  --udp: #66BB6A;

  /* ── Spacing (AppSpacing) ──────────────────────────────────────────── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;

  /* ── Border radius (AppRadius) ─────────────────────────────────────── */
  --radius-xs: 4px;
  --radius-sm: 8px;       /* default — buttons, list tiles */
  --radius-md: 12px;      /* cards */
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ── Sidebar (AppSpacing.sidebar*) ─────────────────────────────────── */
  --sidebar-collapsed: 58px;
  --sidebar-expanded: 240px;

  /* ── Motion (AppDurations) ─────────────────────────────────────────── */
  --motion-micro: 150ms;
  --motion-sidebar: 200ms;
  --motion-panel: 300ms;
  --motion-logo: 480ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);   /* easeInOut */

  /* ── Shadow (sidebar expanded — single shadow def in app) ──────────── */
  --shadow-panel: 2px 0 8px rgba(0, 0, 0, 0.30);
}

/* ── Light theme overrides (AppColors.light*) ────────────────────────── */

html[data-theme="light"] {
  --bg: #F7F4EF;                 /* AppColors.lightBg — warm cream */
  --surface: #FFFCF7;            /* AppColors.lightSurface — warm white */
  --surface-high: #F0EDE6;       /* AppColors.lightSurfaceHigh */
  --border: #E3DDD3;             /* AppColors.lightSurfaceBorder */
  --hover: rgba(0, 0, 0, 0.03);  /* app hoverColor on light */

  /* Warm-dark text (matches ColorScheme onSurface on light) */
  --text: #18140F;
  --muted: #44403A;
  --disabled: rgba(24, 20, 15, 0.35);

  /* Gold for light: darker shade for text/h2/link contrast (WCAG-safe on cream).
     But --accent-gold stays bright #F2B454 for dots/borders/badges. */
  --gold: #B98220;
  --gold-dim: rgba(185, 130, 32, 0.16);

  --shadow-panel: 2px 0 8px rgba(0, 0, 0, 0.08);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
}

body {
  min-height: 100vh;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1;        /* tabular figures — global, как в app */
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Typography ────────────────────────────────────────────────────────── */

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-sm);
  color: var(--text);
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: var(--space-xxl) 0 var(--space-md);
  color: var(--gold);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-xs);
  color: var(--text);
}

p {
  margin: var(--space-md) 0;
  color: var(--text);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-xxl);
}

.tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* Hero label / timer numerics — match app's tabular weight */
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Hero connect-style text (no tabular — app's _ConnectStateLabel exception) */
.hero-label {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  font-feature-settings: normal;
  font-variant-numeric: normal;
}

/* ── Links ─────────────────────────────────────────────────────────────── */

a {
  color: var(--gold);
  text-decoration: none;
  transition: opacity var(--motion-micro) var(--easing);
}

a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ── Lists ─────────────────────────────────────────────────────────────── */

ul, ol {
  padding-left: var(--space-xl);
  margin: var(--space-md) 0;
}

li {
  margin: var(--space-xs) 0;
}

/* ── Code ──────────────────────────────────────────────────────────────── */

code {
  background: var(--surface-high);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
  color: var(--text);
}

pre {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* ── Tables ────────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 0.5px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface);
}

/* ── Selection ─────────────────────────────────────────────────────────── */

::selection {
  background: var(--gold-dim);
  color: var(--text);
}

/* ── Disable system-level ripple-like outline on click for buttons ─── */

button {
  font-family: inherit;
}

button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Строка «описание соответствует версии X» над индексами FAQ/Dev */
.idx-note { opacity: .7; font-size: .92em; margin: -.25rem 0 1.25rem; }
