/* ============================================================
   The Studio — Client Portal
   Design tokens + base styles
   ============================================================ */

:root {
  /* The Rahul Gangurde — deep navy + warm gold + cream */
  --bg-0: #0A1628;
  --bg-1: #0E1B30;
  --bg-2: #122238;
  --bg-3: #182B45;
  --line-1: #1F324E;
  --line-2: #2B405F;

  --ink-1: #F5F1E8;
  --ink-2: #C7C0AF;
  --ink-3: #8A8675;
  --ink-4: #5A5848;

  --accent: #C9A961;
  --accent-deep: #A38540;
  --accent-soft: rgba(201, 169, 97, 0.14);
  --accent-line: rgba(201, 169, 97, 0.30);

  --positive: #8FA888;
  --warning: #D69460;
  --danger: #C4716B;

  /* Typography */
  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px rgba(0,0,0,0.32);
  --shadow-2: 0 24px 80px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05) inset;

  --density-y: 14px;
  --density-x: 16px;
}

[data-density="compact"] {
  --density-y: 8px;
  --density-x: 12px;
}
[data-density="spacious"] {
  --density-y: 20px;
  --density-x: 22px;
}

/* Light mode override — cream paper */
[data-theme="light"] {
  --bg-0: #F5F1E8;
  --bg-1: #FBF8EF;
  --bg-2: #FFFFFF;
  --bg-3: #F0EBDD;
  --line-1: #E2DBC5;
  --line-2: #C9C0A4;
  --ink-1: #0A1628;
  --ink-2: #2D3E55;
  --ink-3: #6B7588;
  --ink-4: #A8AEBA;
  --accent: #A38540;
  --accent-deep: #6E5824;
  --accent-soft: rgba(163, 133, 64, 0.10);
  --accent-line: rgba(163, 133, 64, 0.32);
  --shadow-1: 0 1px 2px rgba(60,40,20,0.04), 0 8px 32px rgba(60,40,20,0.06);
  --shadow-2: 0 20px 60px rgba(60,40,20,0.16);
}

/* Indigo palette */
[data-palette="indigo"] {
  --accent: #B5A8FF;
  --accent-deep: #8775E8;
  --accent-soft: rgba(181, 168, 255, 0.14);
  --accent-line: rgba(181, 168, 255, 0.28);
}
/* Sage palette */
[data-palette="sage"] {
  --accent: #A8C5A0;
  --accent-deep: #7AA070;
  --accent-soft: rgba(168, 197, 160, 0.14);
  --accent-line: rgba(168, 197, 160, 0.28);
}
/* Coral palette */
[data-palette="coral"] {
  --accent: #E89B82;
  --accent-deep: #C4715A;
  --accent-soft: rgba(232, 155, 130, 0.14);
  --accent-line: rgba(232, 155, 130, 0.30);
}

/* ============ Reset + base ============ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg-0);
  color: var(--ink-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }

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

/* ============ Reusable atoms ============ */

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; }
.mono { font-family: var(--mono); font-feature-settings: "ss01"; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hr {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-1) 25%, var(--line-1) 75%, transparent);
  border: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink-1);
  color: var(--bg-0);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.gold {
  background: var(--accent);
  color: #1a130a;
  box-shadow: 0 0 0 1px var(--accent-line), 0 8px 24px rgba(232,184,114,0.12);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-1);
  border-color: var(--line-2);
}
.btn.ghost:hover { background: var(--bg-2); border-color: var(--accent-line); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.lg { padding: 14px 24px; font-size: 14.5px; }
.btn.block { width: 100%; justify-content: center; }

/* Inputs */
.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field label {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: baseline;
}
.field label .req {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.input {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-1);
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.input::placeholder { color: var(--ink-4); }
.input:focus {
  border-color: var(--accent-line);
  background: var(--bg-3);
}
.input.error { border-color: var(--danger); }
.field-hint { font-size: 11.5px; color: var(--ink-3); }
.field-error { font-size: 11.5px; color: var(--danger); }

/* Card */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
}

/* Pill / chip */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  font-size: 11.5px;
  color: var(--ink-2);
}
.pill.gold { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* Logo mark */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #1a130a;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}
.brand .mark.lg { width: 40px; height: 40px; font-size: 22px; border-radius: 11px; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 6px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Subtle texture for the brand canvas */
.grain {
  position: relative;
  isolation: isolate;
}
.grain::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 0;
}

/* Page transition */
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Shimmer accent for hero */
.gold-shimmer {
  background: linear-gradient(110deg,
    var(--accent) 20%,
    #FAE0B4 35%,
    var(--accent) 50%,
    var(--accent-deep) 70%,
    var(--accent) 85%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Focus ring */
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: 4px; }

/* SVG image placeholder */
.placeholder {
  background:
    repeating-linear-gradient(135deg,
      var(--bg-2) 0, var(--bg-2) 11px,
      var(--bg-1) 11px, var(--bg-1) 22px);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* Avatar circle */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  font-family: var(--serif);
  color: var(--ink-1);
  font-size: 14px;
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
