@import "tailwindcss";

/* ============================================================
   Vira.sa Technology — design system, digital-loom edition
   Deep navy ink, azure + cyan + ice thread accents,
   woven geometry, tactile thread textures.
   ============================================================ */

@theme {
  /* grounds */
  --color-ink: #030D1F;
  --color-ink-2: #061530;
  --color-navy: #0A234A;
  --color-navy-2: #0E2C5C;
  --color-bone: #F2F5F9;
  --color-bone-2: #ffffff;

  /* accents */
  --color-azure: #2E8BF7;
  --color-azure-bright: #4FC3FF;
  --color-azure-deep: #1450B8;
  --color-ice: #7FB8F0;
  --color-ice-soft: #C8E0FA;
  --color-ice-deep: #35659E;

  /* text on dark */
  --color-thi: #EAF1F8;
  --color-tmid: #A7BCD6;
  --color-tlo: #6D82A0;

  /* text on light (contrast-checked ≥ 4.5:1 on bone) */
  --color-lhi: #0B1B33;
  --color-lmid: #3E5169;
  --color-llo: #5B6E88;

  /* semantic */
  --color-ok: #2fbf85;
  --color-warn: #d8a34a;
  --color-danger: #d96b4a;

  /* type */
  --font-display: var(--font-bricolage), "Archivo", system-ui, sans-serif;
  --font-body: var(--font-archivo), system-ui, -apple-system, sans-serif;
  --font-mono: var(--font-spline), ui-monospace, "SF Mono", monospace;
  --font-arabic: var(--font-kufi), "Geeza Pro", "Segoe UI", sans-serif;

  /* motion */
  --ease-swift: cubic-bezier(0.55, 0, 0.1, 1);
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- base ---------- */
* {
  min-width: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--color-ink);
  color: var(--color-thi);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-azure);
  color: #04122B;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* per-ground focus ring: sections override --ring */
:root { --ring: var(--color-azure-bright); }
.on-light { --ring: var(--color-azure-deep); }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- woven textures ---------- */
/* crosshatch weave — two diagonal thread directions + grain */
.weave-dark {
  background-color: var(--color-ink);
  background-image:
    repeating-linear-gradient(45deg, rgba(234, 241, 248, 0.016) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(127, 184, 240, 0.02) 0 1px, transparent 1px 7px);
}
.weave-panel {
  background-color: var(--color-ink-2);
  background-image:
    repeating-linear-gradient(45deg, rgba(234, 241, 248, 0.016) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(127, 184, 240, 0.022) 0 1px, transparent 1px 7px);
}
.weave-light {
  background-color: var(--color-bone);
  background-image:
    repeating-linear-gradient(45deg, rgba(11, 27, 51, 0.02) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(53, 101, 158, 0.025) 0 1px, transparent 1px 7px);
}

/* Sadu triangle strip */
.sadu-rule {
  height: 12px;
  background-image:
    linear-gradient(135deg, var(--color-ice) 25%, transparent 25%),
    linear-gradient(225deg, var(--color-ice) 25%, transparent 25%);
  background-size: 24px 12px;
  background-repeat: repeat-x;
  opacity: 0.35;
  border: 0;
}

/* thick woven band (CTA edges, page-hero base) */
.sadu-band {
  background-image:
    linear-gradient(135deg, rgba(127, 184, 240, 0.14) 25%, transparent 25%),
    linear-gradient(225deg, rgba(127, 184, 240, 0.14) 25%, transparent 25%);
  background-size: 56px 28px;
  background-repeat: repeat-x;
  background-position: bottom;
}

/* ---------- typography helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ice);
}
.on-light .eyebrow { color: var(--color-azure-deep); }
.eyebrow::before {
  content: "";
  width: 22px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 100%, 25% 0, 50% 100%, 75% 0, 100% 100%);
  opacity: 0.9;
}

.ar {
  font-family: var(--font-arabic);
  direction: rtl;
  unicode-bidi: isolate;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border-radius: 8px;
  transition:
    transform 220ms var(--ease-out-soft),
    box-shadow 220ms var(--ease-out-soft),
    background-color 220ms var(--ease-out-soft),
    color 220ms var(--ease-out-soft),
    border-color 220ms var(--ease-out-soft);
}
.btn .arrow { transition: transform 220ms var(--ease-out-soft); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary { background: var(--color-azure); color: #04122B; }
.btn-primary:hover {
  background: var(--color-azure-bright);
  box-shadow: 0 12px 32px -10px rgba(79, 195, 255, 0.45);
}
.btn-ice { background: var(--color-ice); color: #0A1B33; }
.btn-ice:hover {
  background: var(--color-ice-soft);
  box-shadow: 0 12px 32px -10px rgba(127, 184, 240, 0.4);
}
.btn-ghost-dark {
  border: 1px solid rgba(167, 188, 214, 0.2);
  color: var(--color-thi);
  background: rgba(234, 241, 248, 0.02);
}
.btn-ghost-dark:hover { border-color: var(--color-ice); color: var(--color-ice-soft); }
.btn-ghost-light {
  border: 1px solid rgba(11, 27, 51, 0.18);
  color: var(--color-lhi);
}
.btn-ghost-light:hover { border-color: var(--color-azure-deep); color: var(--color-azure-deep); }
.btn-sm { padding: 0.6rem 1.15rem; font-size: 0.9rem; }

/* ---------- hairlines ---------- */
.hairline-dark { border-color: rgba(167, 188, 214, 0.14); }
.hairline-light { border-color: rgba(11, 27, 51, 0.12); }

/* ---------- cards ---------- */
.notch-card {
  position: relative;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.notch-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--color-ice) 50%, transparent 50%);
  opacity: 0;
  transition: opacity 300ms var(--ease-out-soft);
}
.notch-card:hover::before { opacity: 1; }
.notch-card::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-azure), var(--color-ice));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease-swift);
}
.notch-card:hover::after { transform: scaleX(1); }

/* ---------- marquee ---------- */
@keyframes marquee-x {
  to { transform: translateX(calc(-50% - 1.6rem)); }
}
.marquee-track {
  display: flex;
  gap: 3.2rem;
  width: max-content;
  animation: marquee-x var(--marquee-speed, 38s) linear infinite;
}
.marquee-paused .marquee-track,
.marquee-track:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee-copy-2 { display: none; }
  .marquee-track { flex-wrap: wrap; width: auto; }
}

/* ---------- forms (16px+ to avoid iOS zoom) ---------- */
.field-input {
  width: 100%;
  border: 1px solid rgba(11, 27, 51, 0.14);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  background: var(--color-bone);
  color: var(--color-lhi);
  font-size: 1rem;
  transition: border-color 180ms, box-shadow 180ms, background-color 180ms;
}
.field-input:focus {
  outline: none;
  border-color: var(--color-azure);
  background: var(--color-bone-2);
  box-shadow: 0 0 0 3px rgba(46, 139, 247, 0.15);
}
.field-input[aria-invalid="true"] { border-color: var(--color-danger); }
.field-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-lmid);
}

/* dark variant (panels) */
.field-input-dark {
  width: 100%;
  border: 1px solid rgba(167, 188, 214, 0.16);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  background: rgba(234, 241, 248, 0.03);
  color: var(--color-thi);
  font-size: 1rem;
  transition: border-color 180ms, box-shadow 180ms;
}
.field-input-dark:focus {
  outline: none;
  border-color: var(--color-azure);
  box-shadow: 0 0 0 3px rgba(46, 139, 247, 0.18);
}
.field-input-dark[aria-invalid="true"] { border-color: var(--color-danger); }
.field-label-dark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-tmid);
}

/* ---------- scrollbars (panels) ---------- */
.thin-scroll { scrollbar-width: thin; scrollbar-color: var(--color-navy-2) transparent; }

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

/* ---------- print ---------- */
@media print {
  body { background: #fff !important; color: #111 !important; }
  nav, footer, .no-print { display: none !important; }
  * { color: #111 !important; background: transparent !important; box-shadow: none !important; }
  a::after { content: ""; }
}
