/* ============================================================
   AskRami design system
   Ported from the Claude Design Web (CDW) prototype.
   Vanilla CSS layered on top of Tailwind v3 (CDN).
   ============================================================ */

:root {
  --bg: #0A0A0B;
  --surface: #141416;
  --surface-2: #18181B;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(245, 197, 24, 0.45);
  --text: #FAFAFA;
  --muted: #A1A1AA;
  --accent: #F5C518;
  --accent-soft: rgba(245, 197, 24, 0.12);
  --success: #22C55E;
  --danger: #EF4444;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
                 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F5F5F4;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(245, 197, 24, 0.55);
  --text: #0C0A09;
  --muted: #57534E;
  --accent: #F5C518;
  --accent-soft: rgba(245, 197, 24, 0.14);
  --success: #16A34A;
  --danger: #DC2626;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.02) inset,
                 0 10px 30px -16px rgba(0, 0, 0, 0.18);
}

* { border-color: var(--border); }

html, body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.6;
}

/* Gold-tinted text selection */
::selection { background: rgba(245, 197, 24, 0.35); color: var(--text); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(245, 197, 24, 0.4); }
* { scrollbar-color: var(--border) transparent; scrollbar-width: thin; }

/* ----- Typography utilities ----- */
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 500;
}
.mono-sm {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 10px;
  font-weight: 500;
}
.display       { letter-spacing: -0.04em; font-weight: 800; line-height: 1.02; }
.display-tight { letter-spacing: -0.06em; font-weight: 800; line-height: 0.96; }

.gradient-text {
  background: linear-gradient(180deg, var(--text) 0%, color-mix(in oklab, var(--text), transparent 35%) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ----- Logo wordmark ----- */
.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}
.logo-text .q {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.25em;
  line-height: 0.85em;
  display: inline-block;
}

/* ----- Atmospheric body background ----- */
.atmos {
  position: relative;
  background:
    radial-gradient(ellipse 800px 500px at 80% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 1100px 700px at 50% -20%, rgba(245, 197, 24, 0.10), transparent 60%),
    var(--bg);
}
:root[data-theme="light"] .atmos {
  background:
    radial-gradient(ellipse 900px 600px at 80% -10%, rgba(255, 200, 80, 0.10), transparent 60%),
    radial-gradient(ellipse 1200px 700px at 50% -20%, rgba(245, 197, 24, 0.08), transparent 60%),
    var(--bg);
}

/* ----- Grid + noise overlay (use on hero containers) ----- */
.noise {
  position: relative;
  isolation: isolate;
}
.noise::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
  opacity: 0.55;
  z-index: 0;
}
.noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  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 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  z-index: 0;
}
:root[data-theme="light"] .noise::after { opacity: 0.35; mix-blend-mode: multiply; }
.noise > * { position: relative; z-index: 1; }

@media (max-width: 768px) {
  .noise::before { background-size: 36px 36px; }
}

/* ----- Glow-border on hover (use on cards) ----- */
.glow-border {
  position: relative;
  isolation: isolate;
}
.glow-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from 200deg at 50% 50%,
    transparent 0%,
    rgba(245, 197, 24, 0.65) 25%,
    transparent 50%,
    rgba(245, 197, 24, 0.35) 75%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 250ms ease;
  pointer-events: none;
}
.glow-border:hover::after { opacity: 1; }

/* ----- Pulse accent ring on CTAs ----- */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(245, 197, 24, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0); }
}
.pulse-accent { animation: pulse-ring 2.2s ease-out infinite; }

/* ----- Skeleton shimmer ----- */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 500;
  transition: transform 160ms ease, box-shadow 160ms ease,
              background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #0A0A0B; }
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -10px rgba(245, 197, 24, 0.55);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: rgba(245, 197, 24, 0.4);
  background: var(--surface-2);
}
.btn-ghost { color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.08); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 12px; }

/* ----- Inputs ----- */
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(245, 197, 24, 0.55);
  box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.10);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23A1A1AA' stroke-width='2' viewBox='0 0 24 24'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

/* ----- Chips ----- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background-color 150ms;
  white-space: nowrap;
}
.chip:hover { border-color: rgba(245, 197, 24, 0.45); color: var(--text); }
.chip.active {
  background: var(--accent-soft);
  border-color: rgba(245, 197, 24, 0.45);
  color: var(--text);
}

/* ----- Card ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

/* ----- Eyebrow label ----- */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

/* ----- KBD ----- */
.kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ----- Smooth route transition ----- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.route-enter { animation: fade-up 320ms ease-out both; }

/* ----- Category accent left-borders ----- */
.cat-domain-investing  { --cat: #F5C518; }
.cat-ai-tools          { --cat: #22C55E; }
.cat-content-social    { --cat: #F59E0B; }
.cat-building-shipping { --cat: #3B82F6; }
.cat-other             { --cat: #A1A1AA; }
.cat-border { border-left: 3px solid var(--cat, var(--accent)); }

.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }

/* ----- Progress bar (admin SLA bars) ----- */
.bar {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 999px;
}

/* ----- Modal + toast ----- */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}
:root[data-theme="light"] .modal-backdrop {
  background: rgba(20, 20, 20, 0.30);
  backdrop-filter: blur(6px);
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 260px;
}

/* ----- Accordion (FAQ) ----- */
.acc-trigger {
  width: 100%;
  text-align: left;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-weight: 500;
}
.acc-content {
  overflow: hidden;
  transition: grid-template-rows 280ms ease;
  display: grid;
  grid-template-rows: 0fr;
}
.acc-content[data-open="true"] { grid-template-rows: 1fr; }
.acc-content > div { min-height: 0; }

/* ----- Avatar ----- */
.avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F5C518, #f59e0b);
  color: #0A0A0B;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 12px;
}

/* ----- Link hover ----- */
.link {
  color: var(--text);
  border-bottom: 1px dashed var(--border);
  transition: border-color 150ms, color 150ms;
}
.link:hover { color: var(--accent); border-color: var(--accent); }

/* ----- Prose for markdown answers ----- */
.prose-askrami {
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
}
.prose-askrami p { margin: 0 0 1.2em; }
.prose-askrami h1, .prose-askrami h2, .prose-askrami h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.8em 0 0.6em;
  line-height: 1.25;
}
.prose-askrami h2 { font-size: 1.5em; }
.prose-askrami h3 { font-size: 1.2em; }
.prose-askrami a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent), transparent 60%);
}
.prose-askrami a:hover { border-bottom-color: var(--accent); }
.prose-askrami ul, .prose-askrami ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose-askrami ul li { list-style: disc; margin: 0.4em 0; }
.prose-askrami ol li { list-style: decimal; margin: 0.4em 0; }
.prose-askrami code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}
.prose-askrami pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 1.2em;
}
.prose-askrami pre code { background: transparent; border: 0; padding: 0; }
.prose-askrami blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--muted);
  margin: 0 0 1.2em;
}
.prose-askrami hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ----- Animated mono counter ----- */
.counter[data-counting] { font-variant-numeric: tabular-nums; }

/* ----- Body lock when modal/mobile menu open ----- */
body.lock { overflow: hidden; }

/* ----- Bouncy click ----- */
@keyframes bounceY {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-4px); }
  70%      { transform: translateY(1px); }
}
.bounceY { animation: bounceY 320ms ease; }

/* ----- htmx loading states ----- */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease; }
.htmx-request   .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator    { opacity: 1; }

/* ----- Hide on mobile etc ----- */
@media (max-width: 640px) {
  .display       { font-size: clamp(48px, 12vw, 72px); }
  .display-tight { font-size: clamp(48px, 12vw, 72px); }
}
