/* =============================================
   OFUQ AI — Premium Design System v3 (Redesigned)
   Inspired by: OpenAI, Linear, Vercel, Stripe
   ============================================= */

/* 0. Custom Fonts (Thmanyah Font Family) */

/* Thmanyah Serif Display */
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Thmanyah Serif Text */
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahseriftext/woff2/thmanyahseriftext-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahseriftext/woff2/thmanyahseriftext-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahseriftext/woff2/thmanyahseriftext-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahseriftext/woff2/thmanyahseriftext-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahseriftext/woff2/thmanyahseriftext-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Thmanyah Sans */
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url('Thmanyah-Font-Family/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* 1. CSS Custom Properties */
:root {
  --gold: #d5b272;
  --gold-light: #e6cfab;
  --gold-dark: #b59050;
  --gold-glow: rgba(213, 178, 114, 0.25);
  --white: #ffffff;
  --black: #030712;
  --gray: #6b7280;

  /* Dark theme (default) */
  --bg-primary: #030712;
  --bg-secondary: #080d1a;
  --bg-tertiary: #0f1626;
  --bg-elevated: #161e31;
  --bg-card: rgba(255, 255, 255, 0.015);
  --bg-glass: rgba(3, 7, 18, 0.85);
  --bg-glass-light: rgba(255, 255, 255, 0.03);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(213, 178, 114, 0.35);
  --glow-color: rgba(213, 178, 114, 0.08);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(213, 178, 114, 0.06);
  
  /* Next-Gen Glassmorphism & Liquid Glass System (Dark) */
  --glass-blur: 24px;
  --bg-glass: rgba(8, 13, 26, 0.68);
  --bg-glass-solid: #080d1a;
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-border-hover: rgba(213, 178, 114, 0.25);
  --glass-bevel: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  --glass-shadow-hover: 0 16px 48px 0 rgba(0, 0, 0, 0.5), 0 0 30px rgba(213, 178, 114, 0.06);
  --flame-opacity: 0.12;

  --font-display-ar: 'Thmanyah Serif Display', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-text-ar: 'Thmanyah Serif Text', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-sans-ar: 'Thmanyah Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-en: 'Sora', 'Space Grotesk', system-ui, -apple-system, sans-serif;
  
  --font-heading: var(--font-display-ar);
  --font-body: var(--font-text-ar);
  --font-sans: var(--font-sans-ar);

  --nav-height: 72px;
  --section-py: clamp(90px, 12vw, 150px);
  --container: 1200px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 0.2s;
  --duration-md: 0.35s;
  --duration-lg: 0.5s;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-card: rgba(15, 23, 42, 0.01);
  --bg-glass-light: rgba(15, 23, 42, 0.03);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(213, 178, 114, 0.5);
  --glow-color: rgba(213, 178, 114, 0.12);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 30px rgba(213, 178, 114, 0.06);

  /* Next-Gen Glassmorphism & Liquid Glass System (Light) */
  --glass-blur: 24px;
  --bg-glass: rgba(255, 255, 255, 0.68);
  --bg-glass-solid: #ffffff;
  --glass-border: rgba(15, 23, 42, 0.06);
  --glass-border-hover: rgba(213, 178, 114, 0.35);
  --glass-bevel: inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.04);
  --glass-shadow-hover: 0 16px 40px 0 rgba(15, 23, 42, 0.08), 0 0 30px rgba(213, 178, 114, 0.06);
  --flame-opacity: 0.05;
}

[lang="en"],
[dir="ltr"] {
  --font-heading: var(--font-en);
  --font-body: var(--font-en);
  --font-sans: var(--font-en);
}

/* 2. Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  position: relative;
  font-size: 16px;
  overscroll-behavior-x: none;
  transition: background var(--duration-lg) var(--ease), color var(--duration-lg) var(--ease);
}

img, svg, video, canvas, iframe {
  max-width: 100%;
  height: auto;
}

/* Master overflow containment wrapper — prevents horizontal scroll on ALL mobile browsers */
.page-wrapper {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-x: clip;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--duration) var(--ease);
}

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

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
  outline: none;
}

input,
textarea,
select {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
}

/* UI/UX Interface Elements & Numerical Typography */
.btn,
.button,
button,
input,
textarea,
select,
label,
.number,
.num,
.count,
.stats-number,
.badge,
.hero-badge,
.project-tag,
.course-level,
.label-text,
.achievement .txt {
  font-family: var(--font-sans);
}

/* 3. Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  font-feature-settings: "ss01" 1, "swsh" 1, "salt" 1;
}

h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

h4 {
  font-size: 1.15rem;
}

p {
  color: var(--text-secondary);
}

.text-gold {
  color: var(--gold);
}

.text-gradient {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 4. Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

.section {
  padding: var(--section-py) 0;
  position: relative;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: 48px;
}

/* 5. Section Heading */
.section-heading {
  text-align: center;
  margin-bottom: 64px;
}

.section-heading .label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 20px;
  font-weight: 700;
}

.section-heading .label::before,
.section-heading .label::after {
  content: '';
  width: 24px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.section-heading .label::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-heading h2 {
  margin-bottom: 16px;
}

.section-heading p {
  max-width: 580px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--duration-md) var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #030712;
  box-shadow: 0 4px 14px rgba(213, 178, 114, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(213, 178, 114, 0.4);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  box-shadow: var(--glass-bevel), var(--glass-shadow);
}

.btn-secondary:hover {
  border-color: var(--glass-border-hover);
  background: rgba(213, 178, 114, 0.06);
  box-shadow: var(--glass-bevel), var(--glass-shadow-hover);
  transform: translateY(-2px);
}

/* 7. Cards — Ultra-Premium Glassmorphism & Liquid Glass */
.card {
  background-color: var(--bg-card);
  background-image: 
    radial-gradient(at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.015) 0%, transparent 80%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.018'/%3E%3C/svg%3E");
  backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--glass-bevel), var(--glass-shadow);
  transition: 
    transform var(--duration-md) var(--ease),
    border-color var(--duration-md) var(--ease),
    box-shadow var(--duration-md) var(--ease),
    background var(--duration-md) var(--ease);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

[data-theme="light"] .card {
  background-image: 
    radial-gradient(at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(15, 23, 42, 0.005) 0%, transparent 80%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.012'/%3E%3C/svg%3E");
}

/* Glass Refractive Mouse Glow Highlight */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(213, 178, 114, 0.08), 
      rgba(213, 178, 114, 0.02) 40%,
      transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-md) var(--ease);
  pointer-events: none;
  z-index: -1;
}

/* Liquid Glass Under-Glow shifting color blobs inside the glass */
.card::after {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(213, 178, 114, 0.04) 0%,
      rgba(30, 58, 138, 0.03) 45%,
      transparent 70%);
  opacity: 0;
  filter: blur(40px);
  transition: opacity var(--duration-lg) var(--ease);
  pointer-events: none;
  z-index: -2;
}

.card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-5px) scale(1.01);
  box-shadow: 
    var(--glass-bevel), 
    inset 0 0 12px rgba(213, 178, 114, 0.04),
    var(--glass-shadow-hover);
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(213, 178, 114, 0.1), rgba(213, 178, 114, 0.02));
  border: 1px solid rgba(213, 178, 114, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: all var(--duration-md) var(--ease);
}

.card:hover .card-icon {
  background: linear-gradient(135deg, rgba(213, 178, 114, 0.25), rgba(213, 178, 114, 0.05));
  border-color: rgba(213, 178, 114, 0.3);
  box-shadow: 0 0 20px rgba(213, 178, 114, 0.15);
}

/* SVG Icon System */
.icon-svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold);
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--duration-md) var(--ease);
}

.card:hover .icon-svg {
  transform: scale(1.1);
}