/* ===========================
   MerchDigger — design system
   =========================== */

:root {
  /* Tweakable accent (default ember orange — matches MBA brand) */
  --accent-h: 50;
  --accent: oklch(0.78 0.18 var(--accent-h));
  --accent-soft: oklch(0.78 0.18 var(--accent-h) / 0.14);
  --accent-glow: oklch(0.78 0.18 var(--accent-h) / 0.4);
  --accent-deep: oklch(0.62 0.2 var(--accent-h));
  --accent-text: oklch(0.85 0.12 var(--accent-h));

  /* Surfaces — near-black with a faint blue tint */
  --bg: #07080b;
  --bg-2: #0c0e13;
  --bg-3: #11141b;
  --surface: #0f1218;
  --surface-2: #161a23;
  --surface-3: #1d222d;
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.1);
  --hairline-vivid: rgba(255, 255, 255, 0.14);

  /* Text */
  --fg: #eef1f6;
  --fg-soft: #b9c0cc;
  --fg-muted: #7a8290;
  --fg-faint: #4a525e;

  /* Semantic */
  --success: oklch(0.78 0.14 155);
  --warn: oklch(0.82 0.14 75);
  --danger: oklch(0.7 0.18 25);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

/* Subtle full-page atmospheric backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, var(--accent-soft), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

/* ---------- Type ---------- */
.h-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  font-weight: 500;
}
.h-display {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(40px, 6.5vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--fg);
  text-wrap: balance;
}
.h-display .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.h-section {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h-section .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.h-card {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.t-body {
  color: var(--fg-soft);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}
.t-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
}
.t-muted { color: var(--fg-muted); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

section { position: relative; padding: 120px 0; }
@media (max-width: 720px) { section { padding: 80px 0; } }

.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head .h-eyebrow { display: inline-block; margin-bottom: 16px; }
.section-head .t-body { margin-top: 16px; max-width: 580px; font-size: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn-primary {
  background: var(--fg);
  color: #0a0c11;
  border-color: var(--fg);
}
.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -12px var(--accent-glow);
}
.btn-accent {
  background: var(--accent);
  color: #06080d;
  font-weight: 600;
}
.btn-accent:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--hairline-vivid);
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15px; }

/* ---------- Card ---------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  position: relative;
}
.card-hover {
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
  border-color: var(--hairline-vivid);
  transform: translateY(-2px);
}

/* ---------- Pill / chip ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-soft);
}
.chip-accent {
  background: var(--accent-soft);
  border-color: oklch(0.78 0.18 var(--accent-h) / 0.35);
  color: var(--accent-text);
}
.chip-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ---------- Hairline rule ---------- */
.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-strong) 20%, var(--hairline-strong) 80%, transparent);
  border: 0;
}

/* ---------- Brand mark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 17px;
  color: var(--fg);
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 4px 12px -4px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative;
}
.brand-mark svg { width: 16px; height: 16px; color: #06080d; }

/* ---------- Animations ---------- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.pulse { animation: pulse-dot 1.6s ease-in-out infinite; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fade-up 0.6s ease-out backwards; }

@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ---------- Grid backdrop (subtle) ---------- */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
  pointer-events: none;
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.relative { position: relative; }
.mono { font-family: var(--font-mono); }

/* ---------- Sticky shadow nav ---------- */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(7, 8, 11, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.nav-shell.scrolled {
  background: rgba(7, 8, 11, 0.85);
  border-bottom-color: var(--hairline);
}

/* ---------- Inputs ---------- */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--hairline-strong);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  background: var(--surface);
}

/* ---------- Scrollbar in app windows ---------- */
.app-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.app-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
.app-scroll::-webkit-scrollbar-track { background: transparent; }
