/* ============================================================
   Intentdriven design system — tokens, material, motion, content
   ============================================================ */

:root {
  --void: #0a0a0c;
  --surface: #121217;
  --surface-border: #23232f;
  --orange: #ff4500;
  --cyan: #00f0ff;
  --violet: #8a2be2;
  --text: #e2e8f0;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--void);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---------- Ambient background ---------- */
.ambient-glow {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}
.ambient-glow-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 69, 0, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  top: -120px;
  left: 18%;
  animation: pulseGlow 5s infinite ease-in-out;
}
.ambient-glow-2 {
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
  top: 420px;
  right: -140px;
  animation: pulseGlow 6s infinite ease-in-out;
  animation-delay: 1.5s;
}
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}

/* ---------- Glass material ---------- */
.glass-card {
  background: rgba(18, 18, 23, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s var(--ease-out-expo), border-color 0.3s var(--ease-out-expo),
    box-shadow 0.3s var(--ease-out-expo);
}
.glass-card:hover {
  border-color: rgba(255, 69, 0, 0.4);
  box-shadow: 0 16px 40px -16px rgba(255, 69, 0, 0.35);
  transform: translateY(-3px);
}
.glass-modal {
  background: rgba(14, 14, 18, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: modalIn 0.28s var(--ease-out-expo);
}

/* ---------- Motion ---------- */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.06); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-in { animation: fadeUp 0.4s var(--ease-out-expo) both; }

/* ---------- Cards / pills / buttons ---------- */
.pill {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--surface-border);
  background: rgba(18, 18, 23, 0.6);
  color: #94a3b8;
  transition: all 0.2s var(--ease-out-expo);
}
.pill:hover { color: #fff; border-color: #475569; }
.pill.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(255, 69, 0, 0.5);
}

.launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(255, 69, 0, 0.1);
  border: 1px solid rgba(255, 69, 0, 0.3);
  color: var(--orange);
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  transition: all 0.2s var(--ease-out-expo);
}
.launch-btn:hover { background: var(--orange); color: #fff; }

.market-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  transition: all 0.2s var(--ease-out-expo);
}
.market-link:hover { color: #fff; border-color: #64748b; transform: translateY(-1px); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  background: rgba(255, 69, 0, 0.18);
  border: 1px solid rgba(255, 69, 0, 0.4);
  color: var(--orange);
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  transition: all 0.2s var(--ease-out-expo);
}
.copy-btn:hover { background: var(--orange); color: #fff; }
.copy-btn.copied { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.5); color: #4ade80; }

/* Determinism badges */
.det {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.det-high { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35); color: #4ade80; }
.det-medium { background: rgba(0, 240, 255, 0.1); border: 1px solid rgba(0, 240, 255, 0.3); color: var(--cyan); }
.det-low { background: rgba(255, 69, 0, 0.12); border: 1px solid rgba(255, 69, 0, 0.35); color: #fb923c; }

.trust-box {
  background: rgba(18, 18, 23, 0.8);
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.trust-box h4 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
}
.trust-box li { font-size: 0.78rem; color: #94a3b8; margin-bottom: 0.35rem; padding-left: 0.2rem; }

/* Parameter inputs & spec builder */
.param-input,
.spec-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  background: var(--void);
  border: 1px solid var(--surface-border);
  color: var(--cyan);
  font-size: 0.78rem;
  font-family: "JetBrains Mono", monospace;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.spec-input { color: #e2e8f0; font-family: "Inter", sans-serif; }
.spec-input.font-mono,
textarea.spec-input { font-family: "JetBrains Mono", monospace; }
.param-input:focus,
.spec-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}

/* Modal open state */
.modal.open { display: flex; }

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ---------- Article (markdown) rendering ---------- */
.prose-intentdriven h1 { font-size: 1.7rem; font-weight: 800; color: #fff; margin: 0.4rem 0 1rem; line-height: 1.2; }
.prose-intentdriven h2 { font-size: 1.15rem; font-weight: 700; color: var(--orange); margin: 1.4rem 0 0.5rem; }
.prose-intentdriven h3 { font-size: 1rem; font-weight: 700; color: var(--cyan); margin: 1.1rem 0 0.4rem; }
.prose-intentdriven p { font-size: 0.88rem; color: #cbd5e1; line-height: 1.7; margin-bottom: 0.8rem; }
.prose-intentdriven ul, .prose-intentdriven ol { margin: 0 0 0.9rem 1.2rem; font-size: 0.85rem; color: #cbd5e1; line-height: 1.7; }
.prose-intentdriven ul { list-style: disc; }
.prose-intentdriven ol { list-style: decimal; }
.prose-intentdriven li { margin-bottom: 0.3rem; }
.prose-intentdriven strong { color: #f1f5f9; font-weight: 700; }
.prose-intentdriven code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}
.prose-intentdriven pre {
  background: var(--void);
  border: 1px solid var(--surface-border);
  border-radius: 0.8rem;
  padding: 0.9rem;
  overflow-x: auto;
  margin-bottom: 0.9rem;
}
.prose-intentdriven pre code { background: none; padding: 0; color: #e2e8f0; }
.prose-intentdriven table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.78rem; }
.prose-intentdriven th, .prose-intentdriven td {
  border: 1px solid var(--surface-border);
  padding: 0.45rem 0.6rem;
  text-align: left;
  color: #cbd5e1;
  vertical-align: top;
}
.prose-intentdriven th { background: rgba(255, 255, 255, 0.04); color: #f1f5f9; }
.prose-intentdriven a { color: var(--orange); text-decoration: underline; text-underline-offset: 2px; }
.prose-intentdriven a:hover { color: #ff7a45; }

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ambient-glow { display: none; }
}

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ============================================================
   v2 — dramatic, freemium, motion, seasonal
   ============================================================ */

/* Particle canvas */
#fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}
header#top { position: relative; }
header#top > * { position: relative; z-index: 1; }

/* Seasonal layer */
#seasonal-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out-expo);
}
.seasonal-motif {
  position: absolute;
  top: -40px;
  display: block;
  opacity: 0.85;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: motifFall linear infinite;
  will-change: transform;
}
.seasonal-motif svg { width: 100%; height: 100%; }
.seasonal-motif.static { position: absolute; animation: none; top: auto; bottom: 12px; opacity: 0.5; }
@keyframes motifFall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.8; }
  100% { transform: translate3d(6vw, 108vh, 0) rotate(360deg); opacity: 0.2; }
}
.season-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 9999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: #e2e8f0;
  background: rgba(18, 18, 23, 0.82);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(10px);
  transition: all 0.2s var(--ease-out-expo);
}
.season-toggle:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }
.season-toggle.halloween { border-color: rgba(249, 115, 22, 0.6); color: #fdba74; box-shadow: 0 0 18px -4px rgba(249, 115, 22, 0.6); }

/* Seasonal ambient accent shifts */
body.season-autumn { --accent-glow: rgba(249, 115, 22, 0.16); }
body.season-winter { --accent-glow: rgba(125, 211, 252, 0.14); }
body.season-spring { --accent-glow: rgba(244, 114, 182, 0.13); }
body.season-summer { --accent-glow: rgba(253, 224, 71, 0.12); }
body[class*="season-"] .ambient-glow-1 { background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0,0,0,0) 70%); }

/* Card media */
.skill-card, .article-card { overflow: hidden; padding: 0 !important; }
.card-media {
  position: relative;
  height: 132px;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #0a0a0c), #0a0a0c 75%);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  transition: transform 0.5s var(--ease-out-expo), opacity 0.4s;
}
.glass-card:hover .card-media img { transform: scale(1.08); opacity: 0.95; }
.card-media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.55;
}
.card-media-fallback svg { width: 38px; height: 38px; }

/* Tier badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.64rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  white-space: nowrap;
}
.tier-badge.sm { padding: 0.18rem 0.5rem; font-size: 0.6rem; }
.tier-free { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35); color: #4ade80; }
.tier-premium { background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.45); color: #fbbf24; }
.tier-owned { background: rgba(0, 240, 255, 0.1); border: 1px solid rgba(0, 240, 255, 0.35); color: var(--cyan); }

.tier-pill {
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid var(--surface-border);
  background: rgba(18, 18, 23, 0.6);
  color: #94a3b8;
  transition: all 0.2s var(--ease-out-expo);
}
.tier-pill:hover { color: #fff; border-color: #64748b; }
.tier-pill.active { background: #f59e0b; border-color: #f59e0b; color: #1a1205; font-weight: 700; box-shadow: 0 6px 18px -8px rgba(245, 158, 11, 0.7); }

.dramatic-line { line-height: 1.35; }

/* Premium lock treatment */
.skill-card.is-locked { border-color: rgba(245, 158, 11, 0.28); }
.locked-blur {
  position: relative;
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.55;
}
.lock-overlay-box {
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.1), rgba(18, 18, 23, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 1rem;
  padding: 1.25rem;
}
.unlock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: 0.8rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a1205;
  background: linear-gradient(120deg, #fbbf24, #f97316);
  box-shadow: 0 10px 26px -10px rgba(249, 115, 22, 0.8);
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s;
}
.unlock-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -10px rgba(249, 115, 22, 0.9); }
.unlock-btn:disabled { cursor: not-allowed; }
.demo-unlock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: #94a3b8;
  border: 1px dashed var(--surface-border);
  transition: all 0.2s;
}
.demo-unlock:hover { color: var(--cyan); border-color: rgba(0, 240, 255, 0.4); }

/* Hero CTA + ripple */
.hero-cta { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(2.4); opacity: 0; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo); }
.reveal.is-visible { opacity: 1; transform: none; }
.skill-card.reveal, .article-card.reveal { animation: none; }

/* Checkout success */
.success-ring {
  width: 84px;
  height: 84px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid rgba(34, 197, 94, 0.5);
  animation: ringPop 0.5s var(--ease-out-expo), ringPulse 2.2s ease-in-out infinite 0.5s;
}
@keyframes ringPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ringPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35); } 50% { box-shadow: 0 0 0 16px rgba(34, 197, 94, 0); } }

@media (prefers-reduced-motion: reduce) {
  #fx-canvas, .seasonal-motif { display: none !important; }
  .reveal { opacity: 1; transform: none; }
  .success-ring { animation: none; }
}
