/* ═══════════════════════════════════════════════════════════════
   مستر هشام صدقي — منصة فيزياء وعلوم متكاملة
   نظام التصميم: Dark Navy + Beige — خطوط Cairo + Syne
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Dark Navy brand ramp ── */
  --brand-950: #071422;
  --brand-900: #0B1D36;
  --brand-800: #12263F;
  --brand-700: #1A3354;
  --brand-600: #25466B;
  --brand-500: #3A5F8A;
  --brand-400: #5A7FA8;
  --brand-300: #8AA4C4;
  --brand-100: rgba(18, 38, 63, 0.10);
  --brand-50:  rgba(18, 38, 63, 0.05);

  /* ── Beige accent ── */
  --gold-700: #8A7358;
  --gold-600: #A89174;
  --gold-500: #C4B09A;
  --gold-400: #D8C4A8;
  --gold-300: #E8DFD0;
  --gold-soft: rgba(196, 176, 154, 0.20);

  /* ── Accents ── */
  --brand: #12263F;
  --accent: #1A3354;
  --accent-soft: rgba(18, 38, 63, 0.10);
  --accent-violet: #12263F;
  --accent-cyan: #3A5F8A;
  --accent-amber: #C4B09A;
  --accent-green: #3D6B4F;
  --accent-gold: #C4B09A;

  /* ── Surfaces (Beige) ── */
  --page-bg: #F3EDE3;
  --page-bg-alt: #EBE3D4;
  --card-bg: #FAF6EF;
  --card: #FAF6EF;
  --card-bg-strong: #FFFDF9;
  --card-soft: #EFE6D8;

  --surface-soft: rgba(18, 38, 63, 0.05);
  --surface-strong: rgba(18, 38, 63, 0.09);
  --surface-highlight: rgba(196, 176, 154, 0.18);
  --surface-highlight-strong: rgba(196, 176, 154, 0.28);

  /* ── Text ── */
  --text: #1A2433;
  --text-strong: #0B1D36;
  --muted: #6B7A8A;
  --muted-strong: #4A5A6A;

  /* ── Borders & shadows ── */
  --border: rgba(18, 38, 63, 0.12);
  --border-strong: rgba(18, 38, 63, 0.28);
  --brand-border: var(--border);
  --gold-border: rgba(196, 176, 154, 0.55);
  --shadow: 0 12px 34px rgba(11, 29, 54, 0.12);
  --shadow-soft: 0 4px 16px rgba(11, 29, 54, 0.08);
  --shadow-strong: 0 24px 56px rgba(11, 29, 54, 0.18);
  --shadow-gold: 0 8px 26px rgba(196, 176, 154, 0.28);

  /* ── Primary ── */
  --primary: #12263F;
  --primary-strong: #0B1D36;
  --primary-weak: rgba(18, 38, 63, 0.10);

  /* ── Fields ── */
  --field-bg: #FFFDF9;
  --field-text: var(--text);
  --field-border: rgba(18, 38, 63, 0.18);

  /* ── Buttons ── */
  --btn-solid-bg: linear-gradient(135deg, #0B1D36 0%, #12263F 50%, #1A3354 100%);
  --btn-solid-text: #F3EDE3;
  --btn-gold-bg: linear-gradient(135deg, #C4B09A 0%, #D8C4A8 55%, #E8DFD0 100%);
  --btn-gold-text: #0B1D36;

  /* ── Status ── */
  --success: #3D6B4F;
  --danger: #C0392B;
  --warning: #B8860B;
  --success-soft-bg: rgba(61, 107, 79, 0.12);
  --success-soft-border: rgba(61, 107, 79, 0.38);
  --danger-soft-bg: rgba(192, 57, 43, 0.12);
  --danger-soft-border: rgba(192, 57, 43, 0.38);
  --warning-soft-bg: rgba(184, 134, 11, 0.14);
  --warning-soft-border: rgba(184, 134, 11, 0.40);

  /* ── Radii ── */
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* ── Theme switch ── */
  --sw-bg: #D8C4A8;
  --sw-knob: #FAF6EF;

  /* ── Header ── */
  --hdr-bg: linear-gradient(120deg, #071422 0%, #0B1D36 40%, #12263F 100%);
  --hdr-text: #F3EDE3;
  --hdr-border: rgba(196, 176, 154, 0.38);
  --hdr-fade: transparent;

  /* ── Decorative ── */
  --grid-line: rgba(18, 38, 63, 0.06);
  --page-glow-1: rgba(18, 38, 63, 0.08);
  --page-glow-2: rgba(196, 176, 154, 0.20);

  --grad-brand: linear-gradient(135deg, #0B1D36, #1A3354);
  --grad-gold: linear-gradient(135deg, #C4B09A, #E8DFD0);
  --grad-hero: linear-gradient(150deg, #F3EDE3 0%, #EBE3D4 45%, #0B1D36 100%);

  /* ── Fonts ── */
  --font-display: 'Syne', 'Cairo', system-ui, sans-serif;
  --font-body: 'Cairo', system-ui, sans-serif;
  --font-calli: 'Syne', 'Cairo', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;

  /* شبكة مدارات خفيفة */
  --ornament-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='20' fill='none' stroke='%2312263F' stroke-opacity='0.04' stroke-width='1'/%3E%3Ccircle cx='24' cy='24' r='1.5' fill='%2312263F' fill-opacity='0.06'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
  --brand-950: #050D18;
  --brand-900: #071422;
  --brand-800: #0B1D36;
  --brand-700: #3A5F8A;
  --brand-600: #5A7FA8;
  --brand-500: #8AA4C4;
  --brand-400: #B0C4D8;
  --brand-300: #D4E0EC;
  --brand-100: rgba(90, 127, 168, 0.18);
  --brand-50:  rgba(90, 127, 168, 0.10);

  --gold-700: #D4BC9A;
  --gold-600: #E2C9A8;
  --gold-500: #EDD9BC;
  --gold-400: #F5E8D4;
  --gold-300: #FFF4E6;
  --gold-soft: rgba(226, 201, 168, 0.18);

  --brand: #D4E0EC;
  --accent: #8AA4C4;
  --accent-soft: rgba(138, 164, 196, 0.18);
  --accent-amber: #F5E8D4;
  --accent-gold: #F5E8D4;

  --page-bg: #071422;
  --page-bg-alt: #0B1D36;
  --card-bg: #12263F;
  --card: #12263F;
  --card-bg-strong: #1A3354;
  --card-soft: #0B1D36;

  --surface-soft: rgba(212, 224, 236, 0.08);
  --surface-strong: rgba(212, 224, 236, 0.14);
  --surface-highlight: rgba(245, 232, 212, 0.12);
  --surface-highlight-strong: rgba(245, 232, 212, 0.20);

  --text: #F3EDE3;
  --text-strong: #FFFDF9;
  --muted: #A8B8C8;
  --muted-strong: #D4E0EC;

  --border: rgba(243, 237, 227, 0.12);
  --border-strong: rgba(196, 176, 154, 0.40);
  --brand-border: var(--border);
  --gold-border: rgba(245, 232, 212, 0.42);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.55);
  --shadow-gold: 0 8px 26px rgba(0, 0, 0, 0.35);

  --primary: #D4E0EC;
  --primary-strong: #FFFDF9;
  --primary-weak: rgba(138, 164, 196, 0.18);

  --success-soft-bg: rgba(90, 150, 110, 0.18);
  --success-soft-border: rgba(120, 180, 140, 0.42);
  --danger-soft-bg: rgba(220, 90, 80, 0.18);
  --danger-soft-border: rgba(220, 90, 80, 0.44);
  --warning-soft-bg: rgba(226, 201, 168, 0.16);
  --warning-soft-border: rgba(226, 201, 168, 0.42);

  --field-bg: #0B1D36;
  --field-text: #F3EDE3;
  --field-border: rgba(243, 237, 227, 0.18);

  --btn-solid-bg: linear-gradient(135deg, #1A3354 0%, #25466B 55%, #3A5F8A 100%);
  --btn-solid-text: #F3EDE3;
  --btn-gold-bg: linear-gradient(135deg, #C4B09A 0%, #E2C9A8 55%, #F5E8D4 100%);
  --btn-gold-text: #071422;

  --hdr-bg: linear-gradient(120deg, #050D18 0%, #0B1D36 45%, #12263F 100%);
  --hdr-text: #F3EDE3;
  --hdr-border: rgba(245, 232, 212, 0.28);

  --grid-line: rgba(212, 224, 236, 0.08);
  --page-glow-1: rgba(58, 95, 138, 0.28);
  --page-glow-2: rgba(245, 232, 212, 0.10);
  --grad-brand: linear-gradient(135deg, #1A3354, #5A7FA8);
  --grad-gold: linear-gradient(135deg, #C4B09A, #F5E8D4);
  --grad-hero: linear-gradient(160deg, #0B1D36 0%, #071422 100%);

  --sw-bg: #1A3354;
  --sw-knob: #F5E8D4;

  --ornament-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='20' fill='none' stroke='%23D4E0EC' stroke-opacity='0.08' stroke-width='1'/%3E%3Ccircle cx='24' cy='24' r='1.5' fill='%23D4E0EC' fill-opacity='0.10'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* ═══ Base ═══ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
}

body.legend-platform,
body.arabic-platform {
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, var(--page-glow-1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 95% 15%, var(--page-glow-2), transparent 50%),
    var(--page-bg);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
}

body.legend-platform p,
body.legend-platform li,
body.legend-platform label,
body.legend-platform span,
body.legend-platform td,
body.legend-platform th,
body.legend-platform input,
body.legend-platform select,
body.legend-platform textarea,
body.legend-platform button,
body.legend-platform a {
  font-weight: inherit;
}

body.legend-platform h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
body.legend-platform h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
body.legend-platform h3 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; }
body.legend-platform h4,
body.legend-platform h5,
body.legend-platform h6 { font-weight: 700; }

body.legend-platform::before,
body.legend-platform::after,
body.arabic-platform::before,
body.arabic-platform::after {
  content: none;
  display: none;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  color: var(--text-strong);
  font-weight: 800;
}

a { color: var(--primary); text-decoration: none; }

::selection { background: var(--brand-600); color: #F3EDE3; }

.platform-logo__img--light { display: block; }
.platform-logo__img--dark { display: none; }
html[data-theme="dark"] .platform-logo__img--light { display: none; }
html[data-theme="dark"] .platform-logo__img--dark { display: block; }

.lg-ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--brand-600);
  margin: 6px 0 22px;
}
.lg-ornament-divider::before,
.lg-ornament-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 120px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.lg-ornament-divider__mark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--brand-600);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

html[data-theme="dark"] body.legend-platform,
html[data-theme="dark"] body.student-no-header {
  color: #F3EDE3;
  font-weight: 600;
}
html[data-theme="dark"] body.legend-platform p,
html[data-theme="dark"] body.legend-platform li,
html[data-theme="dark"] body.legend-platform label,
html[data-theme="dark"] body.legend-platform td,
html[data-theme="dark"] body.legend-platform th,
html[data-theme="dark"] body.legend-platform small,
html[data-theme="dark"] body.legend-platform .muted,
html[data-theme="dark"] body.student-no-header p,
html[data-theme="dark"] body.student-no-header li,
html[data-theme="dark"] body.student-no-header label {
  color: #D4E0EC;
  font-weight: 600;
}
html[data-theme="dark"] body.legend-platform h1,
html[data-theme="dark"] body.legend-platform h2,
html[data-theme="dark"] body.legend-platform h3,
html[data-theme="dark"] body.legend-platform h4,
html[data-theme="dark"] body.student-no-header h1,
html[data-theme="dark"] body.student-no-header h2,
html[data-theme="dark"] body.student-no-header h3 {
  color: #FFFDF9;
  font-weight: 800;
}
html[data-theme="dark"] body.legend-platform a:not(.lg-btn):not(.acc-btn):not(.acc-btnx):not(.btn) {
  color: #C4B09A;
  font-weight: 700;
}
html[data-theme="dark"] body.legend-platform input,
html[data-theme="dark"] body.legend-platform select,
html[data-theme="dark"] body.legend-platform textarea,
html[data-theme="dark"] body.student-no-header input,
html[data-theme="dark"] body.student-no-header select,
html[data-theme="dark"] body.student-no-header textarea {
  color: #F3EDE3;
  font-weight: 600;
}
