/* Blurabit — AI studio */

:root {
  /* Palette tokens — editable via Tweaks */
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-soft: #161616;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --fg: #f5f3ee;
  --fg-dim: rgba(245, 243, 238, 0.6);
  --fg-mute: rgba(245, 243, 238, 0.38);

  /* Accent — hue variable drives everything */
  --accent-h: 24;
  --accent: oklch(0.72 0.18 var(--accent-h));
  --accent-soft: oklch(0.72 0.18 var(--accent-h) / 0.15);
  --accent-fg: #0a0a0a;

  --radius: 6px;
  --radius-lg: 12px;

  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 30%, oklch(0.72 0.18 var(--accent-h) / 0.06), transparent 70%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

/* Typography */
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.015em; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1; }

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 10, 0.6);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.02em;
}
.nav-logo-mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.nav-logo-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-links a { color: var(--fg-dim); transition: color 0.2s; }
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.nav-cta-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-cta:hover .nav-cta-dot { background: var(--accent-fg); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.02);
}
.lang-opt {
  color: var(--fg-mute);
  background: none;
  border: 0;
  padding: 2px 6px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  transition: color 0.15s, background 0.15s;
}
.lang-opt:hover { color: var(--fg-dim); }
.lang-opt.active {
  color: var(--accent-fg);
  background: var(--accent);
}
.lang-div { color: var(--fg-mute); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* Sections */
section { padding: 120px 0; position: relative; }
/* Pull each section up to create tighter vertical rhythm */
#systems, #process, #services, #clients, #contact { margin-bottom: -150px; }
@media (max-width: 768px) {
  section { padding: 80px 0; }
  #systems, #process, #services, #clients, #contact { margin-bottom: -80px; }
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 24px;
}
.section-label::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(40px, 6vw, 80px);
  line-height: 0.95;
  max-width: 900px;
  margin-bottom: 24px;
}

.section-sub {
  font-size: 18px;
  color: var(--fg-dim);
  max-width: 560px;
  margin-bottom: 64px;
  line-height: 1.5;
}

/* Centered section header pattern — used on most top-level sections */
.section-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 72px;
}
.section-head-center .section-label { margin-bottom: 20px; }
.section-head-center .section-title { margin-left: auto; margin-right: auto; text-wrap: balance; }
.section-head-center .section-sub { margin-left: auto; margin-right: auto; margin-bottom: 0; }

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px var(--accent-soft);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn-ghost:hover {
  border-color: var(--fg);
}
.btn-arrow {
  width: 8px; height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.btn:hover .btn-arrow { transform: rotate(45deg) translate(2px, -2px); }

/* Utility */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: overlay;
  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.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ticker */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  background: var(--bg-elev);
}
.ticker-track {
  display: flex;
  gap: 80px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--fg-dim);
}
.ticker-track span::before {
  content: "✦";
  color: var(--accent);
  margin-right: 80px;
  font-size: 16px;
  vertical-align: middle;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: none;
  font-family: var(--font-sans);
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 14px;
  font-weight: 500;
}
.tweaks-section + .tweaks-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.palette-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.palette-swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.15s;
}
.palette-swatch.active { border-color: var(--fg); }
.hue-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    oklch(0.72 0.18 0), oklch(0.72 0.18 60), oklch(0.72 0.18 120),
    oklch(0.72 0.18 180), oklch(0.72 0.18 240), oklch(0.72 0.18 300), oklch(0.72 0.18 360));
  outline: none;
}
.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--fg);
  border: 3px solid var(--bg);
  cursor: pointer;
}
.hue-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--fg);
  border: 3px solid var(--bg);
  cursor: pointer;
}
.tweaks-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tweaks-row:last-child { margin-bottom: 0; }
.tweaks-row label { font-size: 12px; color: var(--fg-dim); }
.tweaks-row .value { font-family: var(--font-mono); font-size: 11px; color: var(--fg); }
.hero-variant-pills { display: flex; gap: 6px; }
.hero-variant-pill {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: all 0.15s;
}
.hero-variant-pill.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
