/* shop.css — AI Rook production shop */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg1: #080c14; --bg2: #0b1120; --bg3: #0f172a;
  --blue: #3385ff; --blue2: #60a5fa; --blue-deep: #0066ff;
  --text-h: #e2e8f0; --text-b: #64748b;
  --green: #22c55e;
  --font: 'Inter', system-ui, sans-serif;
  --r: 1px; --bl: rgba(96,165,250,0.15); --bw: 1px;
}

html { scroll-behavior: smooth; }

body {
  font: 400 1rem/1.6 var(--font);
  background: var(--bg1);
  color: var(--text-b);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Gradient mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(51,133,255,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(96,165,250,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 100% 100% at 50% 0%, rgba(0,102,255,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 70% 70% at 10% 90%, rgba(51,133,255,0.07) 0%, transparent 50%);
  animation: mesh 25s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

@keyframes mesh {
  0% { opacity: 1; transform: scale(1) translate(0,0); }
  50% { opacity: 0.85; transform: scale(1.03) translate(-1%, 1%); }
  100% { opacity: 1; transform: scale(1) translate(1%, -1%); }
}

/* Canvas fallback when JS unavailable or no canvas support */
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

/* Navigation */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(8,12,20,0.7);
  backdrop-filter: blur(12px);
  border-bottom: var(--bw) solid var(--bl);
}

.logo {
  font: 800 1.125rem var(--font);
  color: var(--text-h);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font: 400 0.875rem var(--font);
  color: var(--text-b);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-h); }

.nav-links a:focus-visible,
.logo:focus-visible,
.cta-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}

.nav-ext {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ext-link {
  font: 600 0.875rem var(--font);
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}
.ext-link:hover { color: var(--blue2); }

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

/* Hero */
#hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 8rem 2rem 4rem;
  overflow: hidden;
}

.hero-content {
  max-width: 640px;
}

.eyebrow {
  font: 600 0.75rem/1 var(--font);
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.hero-content h1 {
  font: 800 clamp(2rem, 5vw, 3.25rem)/1.1 var(--font);
  color: var(--text-h);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font: 400 1.0625rem/1.7 var(--font);
  color: var(--text-b);
  margin-bottom: 2rem;
  max-width: 520px;
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font: 600 0.9375rem var(--font);
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.cta-primary {
  background: var(--blue);
  color: #fff;
}
.cta-primary:hover {
  background: var(--blue-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(51,133,255,0.4);
}

.cta-secondary {
  background: transparent;
  color: var(--text-h);
  border: var(--bw) solid var(--bl);
}
.cta-secondary:hover {
  border-color: rgba(96,165,250,0.35);
  transform: translateY(-2px);
}

/* Rook image with gradient mask */
.rook-img {
  position: absolute;
  right: -5%;
  bottom: -5%;
  width: min(480px, 55%);
  max-height: 90svh;
  object-fit: contain;
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transition: opacity 0.6s;
}
.rook-img.loaded { opacity: 1; }

@media (min-width: 1100px) {
  #hero {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    padding: 0 4rem;
  }
  .hero-content { padding: 6rem 0 4rem; }
  .ctas { justify-content: flex-start; }
}

/* Proof strip */
#proof {
  background: rgba(11,17,32,0.8);
  border-top: var(--bw) solid var(--bl);
  border-bottom: var(--bw) solid var(--bl);
  padding: 2.5rem 2rem;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 800 1.375rem var(--font);
  color: var(--text-h);
}

.live-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.stat-label {
  font: 400 0.875rem var(--font);
  color: var(--text-b);
}

@media (min-width: 768px) {
  .proof-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Categories */
#categories {
  padding: 5rem 2rem;
}

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-head h2 {
  font: 800 1.75rem var(--font);
  color: var(--text-h);
  margin-bottom: 0.5rem;
}

.section-head p {
  font: 400 1rem var(--font);
  color: var(--text-b);
}

.cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Glassmorphic card */
.cat-card {
  position: relative;
  padding: 2rem;
  background: rgba(11,17,32,0.6);
  backdrop-filter: blur(16px);
  border: var(--bw) solid var(--bl);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: default;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96,165,250,0.3);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3), 0 0 24px rgba(51,133,255,0.08);
}

.cat-card .icon {
  width: 40px; height: 40px;
  color: var(--blue);
  flex-shrink: 0;
}

.cat-card h3 {
  font: 600 1.125rem var(--font);
  color: var(--text-h);
}

.cat-card p {
  font: 400 0.9375rem/1.65 var(--font);
  color: var(--text-b);
}

.cat-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font: 600 0.875rem var(--font);
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}
.cat-card .card-link:hover { color: var(--blue2); }

.card-note {
  font: 400 0.8125rem var(--font);
  color: var(--text-b);
  opacity: 0.7;
}

/* Rook cursive intro */
.rook-intro {
  margin-top: 2.5rem;
  font: 700 clamp(1.75rem, 3vw, 2.5rem)/1.3 'Caveat', cursive;
  color: rgba(255,255,255,0.92);
  transform: rotate(-1.5deg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.rook-intro-sub {
  font: 600 clamp(0.95rem, 1.5vw, 1.15rem)/1.4 'Caveat', cursive;
  color: var(--blue2);
  opacity: 0.85;
}

/* Escrow accreditation */
#accreditation {
  padding: 2.5rem 2rem 0;
}
.accred-card {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  background: rgba(11,17,32,0.6);
  backdrop-filter: blur(16px);
  border: var(--bw) solid rgba(34,197,94,0.25);
  border-radius: 16px;
  flex-wrap: wrap;
}
.accred-icon {
  width: 44px; height: 44px;
  color: var(--green);
  flex-shrink: 0;
}
.accred-body { flex: 1; min-width: 240px; }
.accred-title {
  font: 800 1.0625rem var(--font);
  color: var(--text-h);
  margin-bottom: 0.25rem;
}
.accred-text {
  font: 400 0.875rem/1.6 var(--font);
  color: var(--text-b);
}
.accred-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font: 600 0.8125rem var(--font);
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.accred-link:hover { opacity: 0.8; }

/* Live status snapshot */
#status-snapshot {
  padding: 2.5rem 2rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}
.status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.status-head h2 {
  font: 800 1.25rem var(--font);
  color: var(--text-h);
}
.status-full {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font: 600 0.8125rem var(--font);
  color: var(--blue);
  text-decoration: none;
}
.status-full:hover { color: var(--blue2); }
.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .status-grid { grid-template-columns: repeat(2, 1fr); }
}
.status-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  background: rgba(11,17,32,0.6);
  backdrop-filter: blur(16px);
  border: var(--bw) solid var(--bl);
  border-radius: 10px;
}
.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.pending { background: var(--text-b); animation: pulse 1.2s ease-in-out infinite; }
.status-dot.up { background: var(--green); }
.status-dot.slow { background: #eab308; }
.status-dot.down { background: #ef4444; }
.status-name {
  font: 600 0.875rem var(--font);
  color: var(--text-h);
  flex: 1;
}
.status-ms {
  font: 400 0.8125rem var(--font);
  color: var(--text-b);
  font-variant-numeric: tabular-nums;
}

/* Ask Rook chat widget */
#chatBubble {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: var(--bw) solid rgba(96,165,250,0.35);
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(51,133,255,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
#chatBubble:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 36px rgba(51,133,255,0.6);
}

#chatPanel[hidden] { display: none; }

#chatPanel {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  z-index: 200;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, 70svh);
  display: flex;
  flex-direction: column;
  background: rgba(11,17,32,0.92);
  backdrop-filter: blur(20px);
  border: var(--bw) solid rgba(96,165,250,0.25);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: var(--bw) solid var(--bl);
  background: rgba(8,12,20,0.6);
}
.chat-title {
  font: 800 0.9375rem var(--font);
  color: var(--text-h);
}
.chat-sub {
  font: 400 0.75rem var(--font);
  color: var(--text-b);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#chatClose {
  background: none;
  border: none;
  color: var(--text-b);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.5rem -0.5rem 0;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}
#chatClose:hover { color: var(--text-h); }

#chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 88%;
}
.chat-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-msg.rook, .chat-msg.rook.thinking {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-body {
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  font: 400 0.875rem/1.55 var(--font);
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.user .chat-body {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.rook .chat-body, .chat-msg.rook.thinking .chat-body {
  background: rgba(51,133,255,0.1);
  border: var(--bw) solid rgba(96,165,250,0.2);
  color: var(--text-h);
  border-bottom-left-radius: 4px;
}
.chat-msg.thinking .chat-body {
  opacity: 0.6;
  font-style: italic;
}
.chat-meta {
  font: 400 0.6875rem var(--font);
  color: var(--text-b);
  opacity: 0.7;
  padding: 0 0.25rem;
}

#chatForm {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: var(--bw) solid var(--bl);
  background: rgba(8,12,20,0.6);
}
#chatInput {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font: 400 0.875rem var(--font);
  color: var(--text-h);
  background: rgba(8,12,20,0.8);
  border: var(--bw) solid var(--bl);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}
#chatInput:focus { border-color: rgba(96,165,250,0.45); }
#chatInput::placeholder { color: var(--text-b); opacity: 0.6; }
#chatSend {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
#chatSend:hover { background: var(--blue-deep); }
#chatSend:disabled, #chatInput:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
  #chatPanel {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 5rem;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #chatBubble { transition: none; }
}

/* Footer */
footer {
  padding: 3rem 2rem;
  border-top: var(--bw) solid var(--bl);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

footer > p {
  font: 400 0.875rem var(--font);
  color: var(--text-b);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-links a {
  font: 400 0.875rem var(--font);
  color: var(--text-b);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-h); }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .live-dot { animation: none; }
  .cat-card { transition: none; }
}