/* ============================================================
   Clear Vision — base styles
   Themes: light (default) / dark   ·   Languages: en (default) / ar
   ============================================================ */

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-ar: "IBM Plex Sans Arabic", var(--font-sans);
  --radius: 14px;

  /* light (default) */
  --ground: oklch(98.4% 0.006 300);
  --ground-2: oklch(95.5% 0.012 300);
  --fore: oklch(19% 0.025 295);
  --dim: oklch(45% 0.03 295);
  --violet: oklch(55% 0.23 298);
  --coral: oklch(66% 0.17 42);
  --grad: linear-gradient(100deg, var(--violet), var(--coral));
  --pupil: rgb(26, 14, 40);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: oklch(11% 0.018 295);
  --ground-2: oklch(15% 0.022 295);
  --fore: oklch(96.5% 0.008 300);
  --dim: oklch(72% 0.025 295);
  --violet: oklch(66% 0.21 298);
  --coral: oklch(75% 0.15 42);
  --pupil: rgb(10, 6, 16);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--fore);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .4s, color .4s;
}
html[lang="ar"] body { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; border-radius: 999px; background: var(--fore); color: var(--ground); }
.skip:focus { top: 1rem; }

/* ---------- type ---------- */
.shell { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: max(1rem, 4vw); }
.t-label { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin: 0; }
html[lang="ar"] .t-label { font-family: var(--font-ar); font-size: .8125rem; letter-spacing: 0; }
.t-hero { font-size: clamp(2.75rem, 7.2vw, 6.5rem); font-weight: 300; line-height: .98; letter-spacing: -.045em; margin: 1.5rem 0 0; }
.t-h2 { font-size: clamp(2.25rem, 5vw, 4.25rem); font-weight: 300; line-height: 1.05; letter-spacing: -.03em; margin: 1.25rem 0 0; max-width: 48rem; }
html[lang="ar"] .t-hero, html[lang="ar"] .t-h2 { letter-spacing: 0; line-height: 1.2; font-weight: 400; }
.t-lead { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.55; color: color-mix(in oklab, var(--fore) 75%, transparent); margin: 1.5rem 0 0; max-width: 62ch; }
.accent { color: var(--coral); }
.grad-text {
  background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: breathe 5s ease-in-out infinite;
}

/* ---------- surfaces & buttons ---------- */
.glass {
  background: linear-gradient(160deg, color-mix(in oklab, var(--fore) 6%, transparent), color-mix(in oklab, var(--fore) 2%, transparent));
  border: 1px solid color-mix(in oklab, var(--violet) 24%, transparent);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--fore) 3%, transparent) inset, 0 20px 60px -30px color-mix(in oklab, var(--violet) 55%, transparent);
}
:root:not([data-theme="dark"]) .glass { background: color-mix(in oklab, var(--ground) 72%, transparent); }

.btn-grad, .btn-ghost {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.4rem; border-radius: 999px; font-size: .95rem; font-weight: 500;
  transition: box-shadow .3s, transform .3s, border-color .3s, background .3s;
}
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 40px -10px color-mix(in oklab, var(--violet) 80%, transparent); }
.btn-grad:hover { box-shadow: 0 14px 50px -8px color-mix(in oklab, var(--coral) 80%, transparent); transform: translateY(-1px); }
.btn-ghost { border: 1px solid color-mix(in oklab, var(--fore) 22%, transparent); }
.btn-ghost:hover { border-color: var(--violet); background: color-mix(in oklab, var(--violet) 12%, transparent); }
.btn-sm { padding: .55rem 1.1rem; font-size: .875rem; }
.icon { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- header / nav ---------- */
.site-header { position: fixed; inset-inline: 0; top: 0; z-index: 50; padding-top: .75rem; }
.nav { display: flex; align-items: center; gap: 1rem; padding: .5rem .5rem .5rem 1.25rem; border-radius: 999px; }
html[dir="rtl"] .nav { padding: .5rem 1.25rem .5rem .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; font-size: 1.05rem; white-space: nowrap; }
.brand-mark { width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--grad); -webkit-mask: radial-gradient(circle, transparent 42%, #000 46%); mask: radial-gradient(circle, transparent 42%, #000 46%); }
.nav-links { display: none; margin-inline: auto; gap: 1.6rem; list-style: none; padding: 0; margin-block: 0; font-size: .925rem; }
.nav-links a { color: color-mix(in oklab, var(--fore) 72%, transparent); transition: color .2s; }
.nav-links a:hover { color: var(--fore); }
.nav-tools { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; }
.tool { display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding-inline: .6rem; border-radius: 999px; font-size: .9rem; color: color-mix(in oklab, var(--fore) 78%, transparent); transition: background .2s, color .2s; }
.tool:hover { background: color-mix(in oklab, var(--fore) 8%, transparent); color: var(--fore); }
.lang-btn { font-family: var(--font-ar); }
html[lang="ar"] .lang-btn { font-family: var(--font-sans); }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
.menu-btn .close { display: none; }
.site-header.open .menu-btn .open-i { display: none; }
.site-header.open .menu-btn .close { display: block; }
.mobile-nav { display: none; margin-top: .5rem; padding: .75rem; }
.site-header.open .mobile-nav { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav a { display: block; padding: .8rem 1rem; border-radius: 10px; }
.mobile-nav a:hover { background: color-mix(in oklab, var(--fore) 6%, transparent); }
.nav .cta-desktop { display: none; }
@media (min-width: 1200px) {
  .nav-links { display: flex; }
  .nav-tools { margin-inline-start: 0; }
  .nav .cta-desktop { display: inline-flex; }
  .menu-btn, .mobile-nav, .site-header.open .mobile-nav { display: none; }
}

/* ---------- hero: eye dive ---------- */
.dive { position: relative; }
.dive-stage { position: relative; }
.dive-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dive-eye {
  position: absolute; top: 10%; left: 30%; width: 70%; height: auto; max-width: none; pointer-events: none;
  mix-blend-mode: screen; will-change: width, left, top;
  -webkit-mask-image: radial-gradient(50% 50% at 50% 47%, #000 55%, transparent 100%);
          mask-image: radial-gradient(50% 50% at 50% 47%, #000 55%, transparent 100%);
}
/* light theme: invert the night-sky eye into ink-on-paper */
:root:not([data-theme="dark"]) .dive-eye { filter: invert(1) hue-rotate(180deg) saturate(1.25); mix-blend-mode: multiply; }
.dive-layer { position: relative; padding-block: 8rem 4rem; }
html.dive-on .dive { height: 360vh; }
html.dive-on .dive-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
html.dive-on .dive-layer { position: absolute; inset: 0; display: flex; align-items: center; padding: 0; will-change: opacity, transform; }
.hero-copy { max-width: 42rem; position: relative; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }

.activity { position: absolute; inset-inline-end: max(1rem, 4vw); top: 7rem; z-index: 1; width: 19rem; list-style: none; margin: 0; padding: 0; display: none; pointer-events: none; }
.activity li { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem; margin-bottom: .75rem; animation: float 6s ease-in-out infinite; }
.activity li:nth-child(2) { margin-inline-start: 3rem; animation-delay: .8s; }
.activity li:nth-child(3) { margin-inline-start: 1rem; animation-delay: 1.6s; }
.activity .icon { color: var(--violet); margin-top: .15rem; }
.activity .ok { color: var(--coral); margin-inline-start: auto; width: 1rem; height: 1rem; }
.activity p { margin: 0; }
.activity .a-t { font-size: .875rem; font-weight: 500; }
.activity .a-s { font-size: .75rem; color: var(--dim); }
.blink { animation: blink 1.6s steps(2, end) infinite; }
.scroll-hint { position: absolute; bottom: -30vh; inset-inline-start: 0; display: none; }
@media (min-width: 768px) { .scroll-hint { display: block; } }
@media (min-width: 1024px) { .activity { display: block; } }

.products { display: grid; gap: 1rem; margin-top: 2.5rem; transform: scale(calc(.85 + var(--k, 1) * .2)); transform-origin: left center; }
html[dir="rtl"] .products { transform-origin: right center; }
.product { padding: 1.25rem 1.4rem; }
.product h3 { margin: .5rem 0 0; font-size: 1.25rem; font-weight: 500; }
.product p { margin: .35rem 0 0; font-size: .925rem; color: color-mix(in oklab, var(--fore) 70%, transparent); }
.product .bar { margin-top: 1rem; height: 4px; border-radius: 999px; overflow: hidden; background: color-mix(in oklab, var(--fore) 10%, transparent); }
.product .bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
@media (min-width: 640px) { .products { grid-template-columns: repeat(3, 1fr); } }

.loop { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; list-style: none; padding: 0; margin: 6rem 0 0; }
.loop li { display: flex; flex-direction: column; align-items: center; text-align: center; }
.loop .dot { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; font-family: var(--font-mono); font-size: .875rem; }
.loop .name { margin-top: .75rem; font-size: .75rem; font-weight: 500; }
@media (min-width: 768px) {
  .loop { margin-top: 10rem; }
  .loop .dot { width: 4rem; height: 4rem; }
  .loop .name { font-size: 1rem; }
}

/* placeholder for the sections still to come */
.next { position: relative; z-index: 1; padding-block: 7rem; border-top: 1px solid color-mix(in oklab, var(--fore) 10%, transparent); background: var(--ground); }

/* ---------- keyframes ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 18px color-mix(in oklab, var(--violet) 60%, transparent)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
