/* TELAK — Design System */

:root {
  /* Brand */
  --accent: #06B6D4;
  --accent-hover: #0891B2;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --accent-glow: rgba(6, 182, 212, 0.35);

  /* Type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Spacing rhythm */
  --section-y: clamp(80px, 9vw, 140px);
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light theme (default) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-elev: #F7F8FA;
  --bg-elev-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F5F7;
  --border: rgba(10, 12, 16, 0.08);
  --border-strong: rgba(10, 12, 16, 0.14);
  --text: #0A0C10;
  --text-2: #44464F;
  --text-3: #6B6E78;
  --text-inv: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(10, 12, 16, 0.04), 0 1px 1px rgba(10, 12, 16, 0.03);
  --shadow-md: 0 4px 14px rgba(10, 12, 16, 0.06), 0 2px 4px rgba(10, 12, 16, 0.04);
  --shadow-lg: 0 24px 60px rgba(10, 12, 16, 0.10), 0 8px 24px rgba(10, 12, 16, 0.06);
  --grid-color: rgba(10, 12, 16, 0.05);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(10, 12, 16, 0.06);
  --code-bg: #0A0C10;
  --code-text: #E6E8EC;
  --noise-opacity: 0.025;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0C10;
  --bg-elev: #0F1218;
  --bg-elev-2: #14181F;
  --surface: #14181F;
  --surface-2: #1A1F28;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #F4F5F7;
  --text-2: #B8BCC4;
  --text-3: #8A8E97;
  --text-inv: #0A0C10;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.3);
  --grid-color: rgba(255, 255, 255, 0.06);
  --nav-bg: rgba(10, 12, 16, 0.7);
  --nav-border: rgba(255, 255, 255, 0.06);
  --code-bg: #0F1218;
  --code-text: #E6E8EC;
  --noise-opacity: 0.04;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

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

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #001014; }

/* Type ramp */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.h-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin: 0;
}

.h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}

.lead {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}

.muted { color: var(--text-2); }
.muted-2 { color: var(--text-3); }

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #001014;
  box-shadow: 0 6px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 30px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--text);
}

.btn-sm { padding: 10px 16px; font-size: 14px; }

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.card.is-hoverable:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

/* Badges / Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.tag.is-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* Grid backdrop helper */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Glass nav */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(calc(100% - 32px), 1140px);
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--nav-border);
  border-radius: var(--r-full);
  padding: 10px 14px 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-md);
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50% { box-shadow: 0 0 0 7px transparent; }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* Responsive nav */
@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  background: var(--bg-elev);
}

/* Cookie banner */
.cookie {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.cookie.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Utility */
.row { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-sm { gap: 12px; }
.gap-md { gap: 20px; }
.gap-lg { gap: 32px; }
.flex-col { flex-direction: column; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Hide scrollbar for marquee */
.marquee {
  display: flex;
  gap: 48px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 48px;
  animation: marquee 30s linear infinite;
  flex-shrink: 0;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}
.marquee-item {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--text-3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.marquee-item .sep { color: var(--accent); }
