/* =========================================================
   Sporlo · Design System tokens & components
   ========================================================= */

:root {
  /* Brand */
  --spo-green:        #0F6B47;
  --spo-green-deep:   #0A4E33;
  --spo-green-soft:   #E7F2EC;
  --spo-mint:         #34D399;

  --spo-pink:         #E85A8C;
  --spo-blue:         #2C7BE5;
  --spo-amber:        #F5A623;

  --spo-ink:          #0F1A23;
  --spo-ink-2:        #4A5563;
  --spo-muted:        #8993A1;
  --spo-line:         #E5E8EC;
  --spo-bg:           #F4F6F4;
  --spo-bg-2:         #ECEFEC;
  --spo-paper:        #FFFFFF;

  /* Radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(15,26,35,.06), 0 1px 1px rgba(15,26,35,.04);
  --shadow-2: 0 6px 14px rgba(15,26,35,.06), 0 2px 4px rgba(15,26,35,.04);
  --shadow-3: 0 22px 36px -18px rgba(15,26,35,.18), 0 6px 10px -4px rgba(15,26,35,.06);
  --shadow-glow: 0 30px 60px -28px rgba(15,107,71,.45);

  /* Type */
  --font-display: "Baumans", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --font-ar: "Rubik", "Tajawal", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--spo-ink);
  background: var(--spo-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
}
::selection { background: var(--spo-mint); color: var(--spo-green-deep); }

/* =========================================================
   Layout
   ========================================================= */
.container { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.section { padding: 120px 0; position: relative; }
.section--tight { padding: 80px 0; }
.section--dark { background: var(--spo-ink); color: #fff; }
.section--paper { background: var(--spo-paper); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--spo-green);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}
.section--dark .eyebrow { color: var(--spo-mint); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; }
.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 8vw, 120px);
  line-height: .94;
  letter-spacing: -.02em;
}
.h-1 { font-size: clamp(40px, 4.4vw, 64px); line-height: 1.04; letter-spacing: -.02em; }
.h-2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.15; }
.h-3 { font-size: 22px; line-height: 1.3; }
.lede { font-size: 19px; color: var(--spo-ink-2); max-width: 56ch; line-height: 1.55; }

.row { display: flex; align-items: center; gap: 16px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* =========================================================
   Top nav
   ========================================================= */
.topnav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  background: rgba(244,246,244,.72);
  border-bottom: 1px solid rgba(15,26,35,.05);
}
.topnav .inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.topnav .links { display: flex; gap: 28px; }
.topnav a {
  font-size: 13px; color: var(--spo-ink-2); text-decoration: none;
  font-weight: 500; transition: color .15s;
}
.topnav a:hover { color: var(--spo-green); }
.topnav .badge {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--spo-ink-2); background: rgba(15,26,35,.05);
  padding: 6px 10px; border-radius: 6px;
}

/* =========================================================
   Brand logo (mark + wordmark)
   ========================================================= */
.brand {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--font-display);
  font-size: 24px; color: var(--spo-ink);
  letter-spacing: -.01em;
}
.brand .mark {
  width: 28px; height: 28px;
  display: inline-block;
  position: relative; top: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff, rgba(255,255,255,.35) 30%, transparent 55%),
    radial-gradient(circle at 70% 75%, rgba(52,211,153,.5), transparent 55%),
    radial-gradient(circle at 50% 50%, #f8fbfa 0%, #c8dcd1 100%);
  box-shadow: inset 4px 4px 8px rgba(255,255,255,.7), inset -4px -4px 10px rgba(15,107,71,.18), 0 6px 12px -4px rgba(15,107,71,.3);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  letter-spacing: -.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--spo-ink);
  color: #fff;
  box-shadow: var(--shadow-2);
}
.btn--primary:hover { background: var(--spo-green-deep); box-shadow: var(--shadow-3); }

.btn--green {
  background: var(--spo-green);
  color: #fff;
}
.btn--green:hover { background: var(--spo-green-deep); }

.btn--glass {
  background: rgba(255,255,255,.6);
  color: var(--spo-ink);
  border: 1px solid rgba(15,26,35,.08);
  backdrop-filter: blur(10px);
}
.btn--glass:hover { background: rgba(255,255,255,.85); }

.btn--ghost {
  background: transparent;
  color: var(--spo-ink);
  border: 1px solid rgba(15,26,35,.15);
}
.btn--ghost:hover { border-color: var(--spo-ink); }

.btn--sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn--lg { height: 52px; padding: 0 28px; font-size: 15px; }

.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* =========================================================
   Pills / tags / chips
   ========================================================= */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(15,26,35,.06);
  color: var(--spo-ink-2);
  font-size: 12px; font-weight: 600;
  letter-spacing: .01em;
}
.tag.green { background: var(--spo-green-soft); color: var(--spo-green-deep); }
.tag.mint  { background: rgba(52,211,153,.18); color: #0A6F4A; }
.tag.blue  { background: rgba(44,123,229,.14); color: #1B4A8F; }
.tag.pink  { background: rgba(232,90,140,.14); color: #A8285D; }
.tag.amber { background: rgba(245,166,35,.16); color: #8C5410; }
.tag.dark  { background: var(--spo-ink); color: #fff; }
.tag.line  { background: transparent; border: 1px solid var(--spo-line); }

.pill-dot {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--spo-ink-2); font-weight: 500;
}
.pill-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.pill-dot.live { color: var(--spo-green); }
.pill-dot.live::before {
  background: var(--spo-mint);
  box-shadow: 0 0 0 4px rgba(52,211,153,.22);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--spo-paper);
  border: 1px solid var(--spo-line);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card--lift { box-shadow: var(--shadow-2); border-color: transparent; }
.card--soft { background: var(--spo-green-soft); border-color: transparent; }
.card--ink { background: var(--spo-ink); color: #fff; border-color: transparent; }
.card--green { background: var(--spo-green); color: #fff; border-color: transparent; }

/* =========================================================
   Inputs
   ========================================================= */
.input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--spo-line);
  border-radius: var(--r-sm);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--spo-ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--spo-green);
  box-shadow: 0 0 0 3px rgba(15,107,71,.15);
}
.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--spo-ink-2); margin-bottom: 6px;
  letter-spacing: .02em; text-transform: uppercase;
}

/* Toggle */
.toggle {
  width: 42px; height: 24px; border-radius: 999px;
  background: var(--spo-line);
  position: relative; cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute; inset: 2px auto 2px 2px;
  width: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: transform .2s;
}
.toggle.on { background: var(--spo-green); }
.toggle.on::after { transform: translateX(18px); }

/* Checkbox */
.checkbox {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--spo-line); background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.checkbox.on { background: var(--spo-green); border-color: var(--spo-green); }
.checkbox.on::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}

/* =========================================================
   Swatch grid
   ========================================================= */
.swatch {
  border-radius: var(--r-md);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--spo-line);
  cursor: pointer;
}
.swatch .meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: flex-end;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.5));
  color: #fff;
  font-size: 12px; font-weight: 500;
}
.swatch .meta .hex { font-family: var(--font-mono); font-size: 11px; opacity: .85; }
.swatch.light .meta { background: transparent; color: var(--spo-ink); }
.swatch.light .meta .hex { color: var(--spo-ink-2); }

/* =========================================================
   Type spec rows
   ========================================================= */
.type-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--spo-line);
  align-items: baseline;
}
.type-row:last-child { border-bottom: 0; }
.type-row .meta { font-family: var(--font-mono); font-size: 12px; color: var(--spo-ink-2); }
.type-row .meta strong { display: block; color: var(--spo-ink); font-family: var(--font-body); font-size: 13px; margin-bottom: 4px; }

/* =========================================================
   KPI card (from product)
   ========================================================= */
.kpi {
  background: #fff;
  border: 1px solid var(--spo-line);
  border-radius: var(--r-lg);
  padding: 28px;
}
.kpi .label {
  font-size: 12px; font-weight: 600; color: var(--spo-ink-2);
  letter-spacing: .04em; text-transform: uppercase;
}
.kpi .n {
  font-family: var(--font-display);
  font-size: 56px; line-height: 1; margin-top: 14px;
  color: var(--spo-ink);
}
.kpi .delta { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; }

/* =========================================================
   Section header
   ========================================================= */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 56px; gap: 32px;
}
.section-head .meta {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--spo-muted);
  text-align: right;
  flex-shrink: 0;
}

/* Grid helpers */
.grid { display: grid; gap: 24px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
  .g-3, .g-4, .g-6 { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 24px; }
  .section { padding: 80px 0; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 92vh;
  padding: 80px 0 120px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 80% 30%, rgba(52,211,153,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(44,123,229,.10) 0%, transparent 55%),
    var(--spo-bg);
}
.hero .container { position: relative; z-index: 2; }
.hero .stage-wrap {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 58%;
  z-index: 1;
  pointer-events: none;
}
.hero h1 { max-width: 14ch; }
.hero .meta-grid {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid rgba(15,26,35,.08);
  padding-top: 28px;
}
.hero .meta-cell {
  padding-right: 16px;
}
.hero .meta-cell .k { font-family: var(--font-mono); font-size: 11px; color: var(--spo-muted); letter-spacing: .06em; text-transform: uppercase; }
.hero .meta-cell .v { font-size: 16px; color: var(--spo-ink); margin-top: 6px; font-weight: 500; }

/* =========================================================
   Module grid (for app icons section)
   ========================================================= */
.module-tile {
  position: relative;
  border-radius: var(--r-xl);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--spo-line);
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.module-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.module-tile .num { font-family: var(--font-mono); font-size: 12px; color: var(--spo-muted); }
.module-tile .name { font-size: 22px; font-weight: 600; color: var(--spo-ink); letter-spacing: -.01em; }
.module-tile .desc { font-size: 13px; color: var(--spo-ink-2); margin-top: 6px; }
.module-tile .glass-slot {
  position: absolute;
  top: -20px; right: -20px;
  width: 120px; height: 120px;
  opacity: .85;
}

/* Spec ruler */
.ruler {
  height: 56px;
  background:
    linear-gradient(90deg, rgba(15,26,35,.12) 1px, transparent 1px) 0 0/8px 100%,
    linear-gradient(90deg, rgba(15,26,35,.22) 1px, transparent 1px) 0 0/32px 100%;
  border-radius: var(--r-sm);
  position: relative;
}
.ruler::before {
  content: attr(data-label);
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 11px; color: var(--spo-ink-2);
  background: var(--spo-bg); padding: 0 8px;
}

/* Code-ish blocks */
.code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #0F1A23;
  color: #DBE6E0;
  border-radius: var(--r-md);
  padding: 18px 20px;
  line-height: 1.7;
  overflow: auto;
}
.code .key { color: #8EE0B6; }
.code .str { color: #F0C674; }
.code .com { color: #5A6A78; }

/* =========================================================
   Footer
   ========================================================= */
.foot {
  background: var(--spo-ink);
  color: #fff;
  padding: 80px 0 48px;
  position: relative;
  overflow: hidden;
}
.foot::before {
  content: ""; position: absolute; inset: -200px -200px auto auto;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(52,211,153,.18), transparent 60%);
  pointer-events: none;
}
.foot .container { position: relative; z-index: 2; }
