/* ============================================================
   CURIO — Design System
   Clean & premium. Schibsted Grotesk + JetBrains Mono.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Neutrals — warm-tinted paper */
  --paper:      #FAFAF8;
  --surface:    #FFFFFF;
  --surface-2:  #F6F5F2;
  --surface-3:  #F0EFEB;
  --ink:        #15141A;
  --ink-2:      #3A3942;
  --muted:      #6E6C78;
  --faint:      #9B99A4;

  /* Hairlines */
  --line:       rgba(21,20,26,0.09);
  --line-2:     rgba(21,20,26,0.06);
  --line-strong:rgba(21,20,26,0.14);

  /* Brand — indigo-violet */
  --brand:      #5B54E6;
  --brand-600:  #4B43DC;
  --brand-700:  #3D35C4;
  --brand-tint: #EEEDFD;
  --brand-tint-2:#E3E1FB;
  --brand-ink:  #2A2480;

  /* Support accents (used sparingly) */
  --amber:      #E9920E;
  --amber-tint: #FBEFD7;
  --green:      #1F9D6B;
  --green-tint: #DEF3EA;
  --rose:       #E04668;
  --rose-tint:  #FBE2E8;
  --sky:        #2E84E6;

  /* AI gradient — only for generative moments */
  --ai-grad: linear-gradient(108deg, #6D5BF0 0%, #5B54E6 42%, #3E7BE8 100%);
  --ai-grad-soft: linear-gradient(108deg, #F0EDFD 0%, #EAF0FD 100%);

  /* Shadows — subtle, layered */
  --sh-xs: 0 1px 2px rgba(21,20,26,.05);
  --sh-sm: 0 1px 2px rgba(21,20,26,.04), 0 2px 6px rgba(21,20,26,.05);
  --sh-md: 0 2px 4px rgba(21,20,26,.04), 0 8px 24px rgba(21,20,26,.07);
  --sh-lg: 0 4px 8px rgba(21,20,26,.05), 0 20px 48px rgba(21,20,26,.12);
  --sh-brand: 0 6px 20px rgba(91,84,230,.28);

  /* Radii */
  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* Type */
  --font: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.2,.7,.3,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01","cv01";
}
#root { min-height: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand-tint-2); }

/* ---------- Scrollbars ---------- */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-thumb:hover { background: rgba(21,20,26,.28); background-clip: padding-box; border: 3px solid transparent; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Typography
   ============================================================ */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}
.eyebrow.muted { color: var(--faint); }

.display {
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: var(--ink);
  text-wrap: balance;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-wrap: pretty; }

.lead { font-size: 19px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }

.mono { font-family: var(--mono); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform .15s var(--ease), background .15s var(--ease), box-shadow .2s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 17px; height: 17px; }

.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: #000; box-shadow: var(--sh-md); }

.btn-brand { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-brand:hover { background: var(--brand-600); }

.btn-ai { background: var(--ai-grad); color: #fff; box-shadow: var(--sh-brand); }
.btn-ai:hover { filter: brightness(1.05); }

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

.btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--sh-xs); }
.btn-outline:hover { border-color: var(--ink-2); background: var(--surface); }

.btn-soft { background: var(--brand-tint); color: var(--brand-ink); }
.btn-soft:hover { background: var(--brand-tint-2); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--r-xs); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: var(--r-md); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }
.btn-icon.btn-sm { width: 34px; height: 34px; }
.btn-block { width: 100%; }

/* ============================================================
   Surfaces
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}
.card-hover { transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--line-strong); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: 99px;
  font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.pill.brand { background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  font-family: var(--mono);
}
.badge-brand { background: var(--brand-tint); color: var(--brand-ink); }
.badge-green { background: var(--green-tint); color: #0e6b47; }
.badge-amber { background: var(--amber-tint); color: #8a560a; }
.badge-rose  { background: var(--rose-tint); color: #9c1f3c; }
.badge-gray  { background: var(--surface-3); color: var(--muted); }

/* Tag chip used in filters */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: 99px;
  font-size: 13.5px; font-weight: 500;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line);
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============================================================
   Inputs
   ============================================================ */
.field {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 15px; color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  outline: none;
}
.field::placeholder { color: var(--faint); }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-tint); }
textarea.field { height: auto; padding: 12px 14px; line-height: 1.5; resize: none; }

.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; letter-spacing: -0.01em; }

/* ============================================================
   Avatars
   ============================================================ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 600; color: #fff;
  background: var(--brand);
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

/* ============================================================
   App chrome / layout
   ============================================================ */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: var(--paper); }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 14px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: background .13s var(--ease), color .13s var(--ease);
  cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; color: var(--faint); transition: color .13s; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.nav-item.active svg { color: var(--brand); }

.topbar {
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,250,248,.82);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.topbar-sub { max-width: 300px; }
@media (max-width: 1180px) { .topbar-sub { display: none; } }

/* ============================================================
   Logo
   ============================================================ */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.03em; color: var(--ink); }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ai-grad);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-sm);
  flex-shrink: 0;
}
.logo-mark svg { width: 17px; height: 17px; color: #fff; }

/* ============================================================
   Utilities
   ============================================================ */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hairline { height: 1px; background: var(--line); border: none; width: 100%; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }

.kbd {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  padding: 2px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  box-shadow: 0 1px 0 var(--line);
}

.noise::before {
  content:''; position: absolute; inset: 0; pointer-events: none; opacity: .4; mix-blend-mode: multiply;
  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)' opacity='0.06'/%3E%3C/svg%3E");
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes creatorInputPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-tint), 0 1px 2px rgba(0,0,0,0.04); }
  50%      { box-shadow: 0 0 0 8px var(--brand-tint), 0 2px 6px rgba(91,84,230,0.18); }
}

.fade-up { animation: fadeUp .6s var(--ease-out) both; }
.fade-in { animation: fadeIn .5s var(--ease-out) both; }
.scale-in { animation: scaleIn .4s var(--ease-out) both; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.dark { border-color: var(--line-strong); border-top-color: var(--ink); }

.cursor-blink::after { content:''; display:inline-block; width:2px; height:1em; background: var(--brand); margin-left:2px; vertical-align:-2px; animation: blink 1s steps(1) infinite; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(31,157,107,.4); animation: pulse-dot 1.6s infinite; }

/* Reveal on load helper with stagger via inline --d */
.reveal { animation: fadeUp .7s var(--ease-out) both; animation-delay: var(--d, 0s); }

/* Grid background texture for hero */
.grid-bg {
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 56px 56px;
}
.dot-bg {
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
}
