/**
 * Tokens canonicos unificados do Penny AIOS · Design System Audagis ("Orbita C1 V2").
 * Compartilhado entre o Cockpit local (cockpit-web/) e o site oficial (penny.ia.br).
 * Fontes auto-hospedadas em ../fonts/ (SIL OFL 1.1) para operacao 100% offline em macOS e Windows.
 * Nao alterar valores sem atualizar DESIGN.md primeiro.
 */

/* Instrument Sans Variable (wdth 75..100, wght 400..700) - OFL */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url('../fonts/instrument-sans-variable.ttf') format('truetype');
}

/* DM Mono 400 - latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-mono-400-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* DM Mono 400 - latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-mono-400-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;
}

/* DM Mono 500 - latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/dm-mono-500-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* DM Mono 500 - latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/dm-mono-500-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;
}

:root,
:root[data-theme='dark'] {
  /* ---- Tokens Institucionais Audagis Orbita C1 V2 (Modo Escuro Padrao) ---- */
  --brand-ruby: #C21C35;
  --brand-ruby-hover: #A8152B;
  --brand-ruby-active: #8F1224;
  --brand-paper: #F5F5F2;
  --brand-ink: #171A1E;

  --bg: #171A1E;
  --surface: #22272D;
  --surface-alt: #1C2025;
  --fg: #F5F5F2;
  --muted: #B7BEC5;
  --line: #3B4249;
  --control-border: #747D86;
  --focus: #F5F5F2;
  --accent: #C21C35;
  --accent-text: #FF899C;
  --on-accent: #F5F5F2;
  --accent-soft: #381D25;
  --disabled-bg: #30363C;
  --disabled-fg: #B7BEC5;
  --success: #8ED3B1;
  --success-bg: #183328;
  --warning: #F0C66F;
  --warning-bg: #342D1F;
  --info: #94C6E7;
  --info-bg: #1C2F3D;
  --error: #FF899C;
  --error-bg: #381D25;

  /* ---- Aliases Semanticos do Cockpit (Audagis Escuro) ---- */
  --noite-0: #171A1E;
  --noite-1: #1C2025;
  --noite-2: #22272D;

  --fio: #3B4249;
  --fio-forte: #747D86;

  --texto-1: #F5F5F2;
  --texto-2: #B7BEC5;
  --texto-3: #969FA8;
  --texto-sobre-luz: #E6E8EA;

  --acento: #C21C35;
  --acento-hover: #A8152B;
  --acento-texto: #FF899C;
  --acento-suave: #381D25;
  --sobre-acento: #F5F5F2;
  --medidor: #9E3042;
  --alarme: #FF899C;
  --dado: #8ED3B1;

  /* ---- Tipografia e Escala ---- */
  --font-brand: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --disp: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fonte-titulo: var(--disp);
  --fonte-corpo: var(--ui);
  --fonte-mono: var(--mono);

  --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;

  --radius-small: 4px;
  --radius-control: 8px;
  --radius-panel: 8px;
  --radius-pill: 999px;
  --motion-fast: 120ms;
  --motion-standard: 180ms;
  --motion-gesture: 520ms;
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --content-width: 1280px;

  /* ---- Elevacao ---- */
  --e1: inset 0 1px 0 rgba(245, 245, 242, 0.04);
  --e2: 0 2px 6px rgba(0, 0, 0, 0.36), 0 12px 28px -12px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(245, 245, 242, 0.04);
  --e3: 0 3px 8px rgba(0, 0, 0, 0.42), 0 32px 64px -24px rgba(194, 28, 53, 0.28), inset 0 1px 0 rgba(245, 245, 242, 0.05);

  /* ---- Raios do Cockpit (alinhados a geometria Audagis) ---- */
  --r-heroi: 16px;
  --r-cartao: 12px;
  --r-interno: 8px;
  --r-botao: 8px;
  --r-icone: 8px;
  --r-campo: 8px;
  --r-pilula: 999px;

  /* ---- Grade e Ritmo ---- */
  --rail: 84px;
  --rail-largura: 84px;
  --conteudo: 1240px;
  --largura-max: 1240px;
  --calha: 24px;
  --base: 8px;
  --pad-cartao: 24px;
  --gap-cartao: 20px;
  --gap-faixa: 32px;
  --linha-lista: 56px;

  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface-alt: #ECEEEB;
  --fg: #171A1E;
  --muted: #555D65;
  --line: #D0D3D4;
  --control-border: #858B90;
  --focus: #C21C35;
  --accent: #C21C35;
  --accent-text: #A8152B;
  --on-accent: #F5F5F2;
  --accent-soft: #FBEAEC;
  --disabled-bg: #E2E4E2;
  --disabled-fg: #5F666C;
  --success: #156345;
  --success-bg: #E7F1EB;
  --warning: #765000;
  --warning-bg: #F8F0D9;
  --info: #285B80;
  --info-bg: #E7EFF4;
  --error: #A8152B;
  --error-bg: #FBEAEC;

  --noite-0: #F5F5F2;
  --noite-1: #FFFFFF;
  --noite-2: #ECEEEB;
  --fio: #D0D3D4;
  --fio-forte: #858B90;
  --texto-1: #171A1E;
  --texto-2: #4A525A;
  --texto-3: #5C646D;
  --texto-sobre-luz: #2A3036;
  --acento: #C21C35;
  --acento-hover: #A8152B;
  --acento-texto: #A8152B;
  --acento-suave: #FBEAEC;
  --sobre-acento: #F5F5F2;
  --medidor: #A8152B;
  --alarme: #A8152B;
  --dado: #156345;

  --e1: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --e2: 0 2px 6px rgba(23, 26, 30, 0.06), 0 10px 24px -12px rgba(23, 26, 30, 0.12);
  --e3: 0 4px 12px rgba(23, 26, 30, 0.08), 0 24px 48px -20px rgba(194, 28, 53, 0.14);

  color-scheme: light;
}
