/* Icon Tech — Design System */

@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyah/thmanyah-sans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyah/thmanyah-sans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("../fonts/thmanyah/thmanyah-sans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("../fonts/thmanyah/thmanyah-serif-display-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("../fonts/thmanyah/thmanyah-serif-display-Black.woff2") format("woff2");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Text";
  src: url("../fonts/thmanyah/thmanyah-serif-text-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand — orange (dark default) */
  --color-primary: #FF8F5B;
  --color-primary-hover: #FF7A3D;
  --color-primary-light: #FF8F5B;
  --color-primary-dark: #E9682E;
  --color-on-primary: #171717;
  --color-navy: #181B21;
  --color-navy-deep: #0F1115;
  --color-surface: #181B21;
  --color-surface-2: #20242B;
  --color-purple: #E9682E;
  --color-purple-soft: #FF8F5B;
  --color-white: #F5F5F5;
  --color-muted: #AEB4BE;
  --color-border: #30353D;
  --color-glass: rgba(255, 255, 255, 0.04);
  --color-glass-border: rgba(255, 255, 255, 0.10);
  --color-success: #4ADE80;
  --color-warning: #FBBF24;
  --color-error: #F87171;
  --color-info: #60A5FA;

  /* Gradients */
  --gradient-hero: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(255, 143, 91, 0.32), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(233, 104, 46, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(255, 122, 61, 0.12), transparent 50%);
  --gradient-card: linear-gradient(135deg, rgba(255, 143, 91, 0.10) 0%, rgba(233, 104, 46, 0.06) 100%);
  --gradient-btn: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  --gradient-text: linear-gradient(135deg, var(--color-primary) 0%, var(--color-white) 55%, var(--color-primary-hover) 100%);

  /* Typography — Thmanyah (light + dark) */
  --font-en: "Thmanyah Sans", system-ui, sans-serif;
  --font-ar: "Thmanyah Sans", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Thmanyah Serif Display", "Thmanyah Sans", serif;
  --font-text: "Thmanyah Serif Text", "Thmanyah Sans", serif;

  /* Spacing */
  --section-py: clamp(4rem, 10vw, 7rem);
  --container-max: 1280px;
  --header-h: clamp(68px, 10vw, 84px);

  /* Effects */
  --shadow-glow: 0 0 40px rgba(255, 143, 91, 0.28);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --color-primary: #E9682E;
  --color-primary-hover: #D4551F;
  --color-primary-light: #C2410C;
  --color-primary-dark: #9A3412;
  --color-on-primary: #FFFFFF;
  --color-navy: #F3EEE8;
  --color-navy-deep: #FAF8F5;
  --color-surface: #FFFFFF;
  --color-surface-2: #F3EEE8;
  --color-purple: #C2410C;
  --color-purple-soft: #E9682E;
  --color-white: #1C1917;
  --color-muted: #57534E;
  --color-border: #E7E0D8;
  --color-glass: #FFFFFF;
  --color-glass-border: #E7E0D8;
  --color-success: #16A34A;
  --color-warning: #D97706;
  --color-error: #DC2626;
  --color-info: #2563EB;
  --gradient-hero: radial-gradient(ellipse 90% 60% at 50% -15%, rgba(233, 104, 46, 0.14), transparent 58%);
  --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FAF8F5 100%);
  --gradient-btn: linear-gradient(135deg, #E9682E 0%, #C2410C 100%);
  --gradient-text: linear-gradient(135deg, #E9682E 0%, #9A3412 100%);
  --shadow-glow: 0 8px 28px rgba(196, 65, 12, 0.18);
  --shadow-card: 0 10px 30px rgba(28, 25, 23, 0.07);
}

/* Light mode — mobile-only tokens (readability over bright earth bg) */
@media (max-width: 768px) {
  [data-theme="light"] {
    --color-navy-deep: #FAF8F5;
    --color-white: #1C1917;
    --color-muted: #57534E;
    --color-border: #E7E0D8;
    --color-glass: #FFFFFF;
    --color-glass-border: #E7E0D8;
    --shadow-card: 0 8px 22px rgba(28, 25, 23, 0.07);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
}

html[lang="en"] body {
  font-family: var(--font-en);
}

body {
  background: transparent;
  color: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

input, button, textarea, select {
  font-family: inherit;
}

/* Fallback if cosmic script has not run yet */
body:not(.has-cosmic-header) {
  background: var(--color-navy-deep);
}

html[data-theme="light"] body,
html[data-theme="light"] body.has-cosmic-header {
  background: var(--color-navy-deep);
}

/* Cosmic background replaces body::before — see cosmic-bg.css */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul {
  list-style: none;
}

.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.section {
  padding-block: var(--section-py);
  position: relative;
  z-index: 1;
}

main {
  position: relative;
  z-index: 1;
}

/* Inner pages: header over subtle cosmic */
body.has-cosmic-header .page-hero {
  padding-top: calc(var(--header-h) + 2rem);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--gradient-btn);
  border-radius: 2px;
}

.section-title,
.hero-title,
.page-hero h1,
h1, h2 {
  font-family: var(--font-display);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--color-muted);
  font-size: 1.05rem;
  max-width: 600px;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Critical: keep hero/header text visible during i18n (LCP) */
html.wd-i18n-pending [data-i18n] {
  visibility: hidden;
}
html.wd-i18n-pending .hero [data-i18n],
html.wd-i18n-pending .site-header [data-i18n],
html.wd-i18n-pending .logo-text {
  visibility: visible;
}
html.i18n-ready [data-i18n] {
  visibility: visible;
}
