/* =========================================================================
   XONWARE — DESIGN SYSTEM
   ========================================================================= */

/* ---- 1. Tokens --------------------------------------------------------- */
:root {
  /* Brand */
  --ink-900: #0A1224;
  --ink-800: #0F1A33;
  --ink-700: #1A237E;       /* logo navy — primary brand */
  --ink-600: #2A35A0;
  --ink-500: #3F4BC2;

  --leaf-700: #5C8A26;
  --leaf-600: #6FA82E;
  --leaf-500: #8BC53F;     /* logo green */
  --leaf-400: #A3D957;
  --leaf-100: #E8F5D4;

  --cyan-500: #06B6D4;
  --cyan-400: #22D3EE;     /* glow accent */
  --cyan-300: #67E8F9;

  /* Neutrals */
  --paper:    #FAFAF8;     /* page background (warm off-white) */
  --paper-2:  #F4F4F0;
  --white:    #FFFFFF;
  --ink-100:  #0F172A;     /* body text */
  --ink-80:   #1F2937;
  --ink-60:   #475569;
  --ink-40:   #94A3B8;
  --ink-20:   #CBD5E1;
  --line:     #E5E7EB;
  --line-2:   #EEF0F2;

  /* Semantic */
  --bg:        var(--paper);
  --bg-card:   var(--white);
  --bg-dark:   var(--ink-900);
  --fg:        var(--ink-100);
  --fg-muted:  var(--ink-60);
  --border:    var(--line);

  /* Spacing (8px base) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-32: 128px;
  --s-40: 160px;

  /* Type scale (fluid) */
  --t-eyebrow: 0.75rem;
  --t-caption: 0.8125rem;
  --t-small:   0.9375rem;
  --t-body:    1.0625rem;
  --t-lead:    1.1875rem;
  --t-h4:      1.25rem;
  --t-h3:      clamp(1.5rem,  1.1rem + 1.5vw, 2rem);
  --t-h2:      clamp(2rem,    1.4rem + 2.6vw, 3rem);
  --t-h1:      clamp(2.75rem, 1.8rem + 3.8vw, 4.5rem);
  --t-display: clamp(3.5rem,  2.2rem + 5.4vw, 6.5rem);

  /* Line heights */
  --lh-tight:  1.05;
  --lh-snug:   1.2;
  --lh-base:   1.55;
  --lh-loose:  1.75;

  /* Tracking */
  --track-tight:  -0.025em;
  --track-snug:   -0.015em;
  --track-wide:    0.08em;
  --track-wider:   0.16em;

  /* Radii */
  --r-xs:  6px;
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-2xl: 40px;
  --r-pill: 9999px;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(10, 20, 40, 0.04);
  --sh-sm: 0 2px 8px -2px rgba(10, 20, 40, 0.06), 0 1px 3px rgba(10, 20, 40, 0.04);
  --sh-md: 0 8px 24px -8px rgba(10, 20, 40, 0.10), 0 2px 6px -1px rgba(10, 20, 40, 0.05);
  --sh-lg: 0 24px 48px -12px rgba(10, 20, 40, 0.14), 0 8px 16px -8px rgba(10, 20, 40, 0.06);
  --sh-xl: 0 40px 80px -20px rgba(10, 20, 40, 0.20), 0 16px 32px -12px rgba(10, 20, 40, 0.10);
  --sh-glow-blue:  0 0 0 1px rgba(37, 99, 235, 0.10), 0 12px 40px -8px rgba(37, 99, 235, 0.30);
  --sh-glow-green: 0 0 0 1px rgba(139, 197, 63, 0.18), 0 12px 40px -8px rgba(139, 197, 63, 0.40);
  --sh-glow-cyan:  0 0 0 1px rgba(34, 211, 238, 0.15), 0 12px 40px -8px rgba(34, 211, 238, 0.35);

  /* Easing */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Durations */
  --d-fast: 180ms;
  --d-base: 280ms;
  --d-slow: 480ms;

  /* Container */
  --container-max: 1520px;
  --container-pad: clamp(20px, 4vw, 56px);

  /* Z-index */
  --z-header:    100;
  --z-overlay:   200;
  --z-modal:     300;
  --z-toast:     400;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--t-body);
  line-height: var(--lh-base);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'cv11';
}

img, svg, video, picture { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--leaf-100); color: var(--ink-900); }

/* ---- 3. Typography ----------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--ink-60);
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: currentColor;
  opacity: 0.4;
}
.eyebrow--leaf { color: var(--leaf-700); }
.eyebrow--cyan { color: var(--cyan-500); }
.eyebrow--light { color: rgba(255,255,255,0.7); }

.h-display, .h1, .h2, .h3, .h4 {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  letter-spacing: var(--track-tight);
  line-height: var(--lh-tight);
  color: var(--ink-100);
}
.h-display { font-size: var(--t-display); font-weight: 500; }
.h1        { font-size: var(--t-h1); }
.h2        { font-size: var(--t-h2); }
.h3        { font-size: var(--t-h3); line-height: var(--lh-snug); }
.h4        { font-size: var(--t-h4); line-height: var(--lh-snug); font-weight: 600; }

.serif {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.lead {
  font-size: var(--t-lead);
  line-height: var(--lh-base);
  color: var(--ink-60);
  max-width: 64ch;
}

.muted { color: var(--fg-muted); }
.balance { text-wrap: balance; }
.pretty  { text-wrap: pretty; }

/* Gradient text accent */
.grad-text {
  background: linear-gradient(115deg, var(--ink-900) 0%, var(--ink-700) 35%, var(--cyan-500) 65%, var(--leaf-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-text--light {
  background: linear-gradient(115deg, #fff 0%, #fff 50%, var(--cyan-300) 80%, var(--leaf-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- 4. Layout primitives --------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  position: relative;
  padding-block: clamp(64px, 8vw, 128px);
}
.section--tight { padding-block: clamp(48px, 5vw, 80px); }
.section--hero  { padding-block: clamp(112px, 12vw, 180px) clamp(64px, 8vw, 112px); }

.section--dark {
  background: var(--ink-900);
  color: rgba(255,255,255,0.92);
}
.section--dark .h1,
.section--dark .h2,
.section--dark .h3,
.section--dark .h4,
.section--dark .h-display { color: #fff; }
.section--dark .lead { color: rgba(255,255,255,0.7); }
.section--dark .muted { color: rgba(255,255,255,0.55); }

.section--paper-2 { background: var(--paper-2); }

.grid { display: grid; gap: var(--s-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); gap: var(--s-6); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6          { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
}

.stack > * + * { margin-top: var(--stack, var(--s-6)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* ---- 5. Buttons ------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: all var(--d-base) var(--ease-out);
  isolation: isolate;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,0.18), transparent 60%);
  opacity: 0;
  transition: opacity var(--d-base);
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }

.btn--primary {
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
  color: #fff;
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255,255,255,0.10);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255,255,255,0.14), 0 0 0 4px rgba(37,99,235,0.12);
}

.btn--secondary {
  background: var(--white);
  color: var(--ink-100);
  border: 1px solid var(--ink-20);
  box-shadow: var(--sh-xs);
}
.btn--secondary:hover {
  border-color: var(--ink-100);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}

.btn--leaf {
  background: linear-gradient(180deg, var(--leaf-500), var(--leaf-600));
  color: var(--ink-900);
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255,255,255,0.30);
  font-weight: 600;
}
.btn--leaf:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-glow-green);
}

.btn--ghost { color: var(--ink-100); padding-inline: 10px; }
.btn--ghost:hover { color: var(--ink-700); }

.btn--ghost-light { color: rgba(255,255,255,0.85); padding-inline: 10px; }
.btn--ghost-light:hover { color: #fff; }

.btn--sm { padding: 10px 16px; font-size: 13px; }
.btn--lg { padding: 18px 28px; font-size: var(--t-body); }

.btn--icon-right svg { transition: transform var(--d-base) var(--ease-out); }
.btn:hover .btn--icon-right svg,
.btn.btn--icon-right:hover svg { transform: translateX(3px); }

/* Magnetic CTA wrapper (JS attaches behaviour) */
.magnetic { display: inline-block; transition: transform var(--d-base) var(--ease-spring); }

/* Pulse ring on important CTAs */
.btn--pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0;
  animation: pulse 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%   { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* ---- 6. Cards --------------------------------------------------------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-8);
  transition: transform var(--d-base) var(--ease-out), box-shadow var(--d-base), border-color var(--d-base);
  overflow: hidden;
  isolation: isolate;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, rgba(37,99,235,0.25), rgba(139,197,63,0.25), transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--d-base);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: transparent;
}
.card:hover::before { opacity: 1; }

.card--glass {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.7);
}

.card--dark {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
}
.card--dark::before {
  background: linear-gradient(135deg, transparent 40%, rgba(34,211,238,0.4), rgba(139,197,63,0.4), transparent 80%);
}

.card--feature {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  height: 100%;
}
.card__icon {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--ink-700), var(--ink-600));
  color: #fff;
  margin-bottom: var(--s-2);
  box-shadow: var(--sh-glow-blue);
}
.card__icon--leaf {
  background: linear-gradient(135deg, var(--leaf-500), var(--leaf-600));
  color: var(--ink-900);
  box-shadow: var(--sh-glow-green);
}
.card__icon--cyan {
  background: linear-gradient(135deg, var(--cyan-400), var(--cyan-500));
  color: var(--ink-900);
  box-shadow: var(--sh-glow-cyan);
}

/* ---- 7. Tag / chip ---------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: rgba(15,30,60,0.04);
  color: var(--ink-80);
  border: 1px solid var(--line);
}
.tag--leaf { background: var(--leaf-100); color: var(--leaf-700); border-color: rgba(139,197,63,0.3); }
.tag--cyan { background: rgba(34,211,238,0.10); color: var(--cyan-500); border-color: rgba(34,211,238,0.25); }
.tag--dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(139,197,63,0.18);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(139,197,63,0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(139,197,63,0.05); }
}

/* ---- 8. Decorative backgrounds --------------------------------------- */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15,30,60,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,30,60,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: 0 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.bg-grid--dark {
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
}

.bg-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 40% at 20% 20%, rgba(37,99,235,0.18), transparent 70%),
    radial-gradient(40% 50% at 80% 30%, rgba(34,211,238,0.16), transparent 70%),
    radial-gradient(60% 60% at 50% 100%, rgba(139,197,63,0.20), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.bg-noise::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Animated gradient blob behind hero */
.bg-orb {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 20s ease-in-out infinite alternate;
}
.bg-orb--blue  { background: radial-gradient(circle, var(--ink-600), transparent 70%); }
.bg-orb--green { background: radial-gradient(circle, var(--leaf-500), transparent 70%); }
.bg-orb--cyan  { background: radial-gradient(circle, var(--cyan-400), transparent 70%); }
@keyframes orb-drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px,-40px) scale(1.15); }
}

/* ---- 9. Animated underline link --------------------------------------- */
.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-100);
  font-weight: 500;
}
.link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--d-base) var(--ease-out);
}
.link:hover::after { transform: scaleX(1); }
.link svg { transition: transform var(--d-base) var(--ease-out); }
.link:hover svg { transform: translateX(3px); }
.link--light { color: rgba(255,255,255,0.9); }

/* ---- 10. Scroll reveal helper ---------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
[data-reveal][data-delay="100"] { transition-delay: 100ms; }
[data-reveal][data-delay="200"] { transition-delay: 200ms; }
[data-reveal][data-delay="300"] { transition-delay: 300ms; }
[data-reveal][data-delay="400"] { transition-delay: 400ms; }
[data-reveal][data-delay="500"] { transition-delay: 500ms; }
[data-reveal][data-delay="600"] { transition-delay: 600ms; }

/* ---- 11. Section divider --------------------------------------------- */
.divider {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.divider--dark { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10) 20%, rgba(255,255,255,0.10) 80%, transparent); }

/* ---- 12. Counter chip ------------------------------------------------ */
.counter {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Geist', sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.counter__value { font-size: clamp(2rem, 4vw, 3rem); color: var(--ink-100); }
.counter__suffix { font-size: clamp(1.25rem, 2vw, 1.75rem); color: var(--leaf-600); }
.counter__label { display: block; margin-top: 4px; font-size: var(--t-small); color: var(--ink-60); letter-spacing: 0; }

.section--dark .counter__value { color: #fff; }
.section--dark .counter__label { color: rgba(255,255,255,0.6); }

/* ---- 13. Utility ----------------------------------------------------- */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-6 { gap: var(--s-6); }
.gap-8 { gap: var(--s-8); }
.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.mt-12 { margin-top: var(--s-12); }
.mt-16 { margin-top: var(--s-16); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }
.mb-8 { margin-bottom: var(--s-8); }
.mb-12 { margin-bottom: var(--s-12); }
.max-w-2xl { max-width: 720px; }
.max-w-3xl { max-width: 920px; }
.mx-auto { margin-inline: auto; }
.relative { position: relative; }
.z-1 { position: relative; z-index: 1; }
