/* PromptForge Design System — Minimal Token Set (PRODUCT-SPEC §3) */
:root {
  --background: 0 0% 100%;
  --foreground: 240 20% 10%;
  --primary: 250 80% 60%;
  --primary-foreground: 0 0% 100%;
  --muted-foreground: 240 10% 45%;
  --border: 240 15% 90%;
  --card: 0 0% 100%;
  --card-foreground: 240 20% 10%;
  --muted: 240 15% 96%;
  --radius-card: 1rem;
  --radius-btn: 9999px;
  --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: 240 20% 7%;
    --foreground: 0 0% 98%;
    --primary: 250 80% 66%;
    --primary-foreground: 0 0% 100%;
    --muted-foreground: 240 10% 62%;
    --border: 240 15% 18%;
    --card: 240 20% 10%;
    --card-foreground: 0 0% 98%;
    --muted: 240 15% 15%;
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.4s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Container */
.container {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Header */
header {
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background) / 0.88);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

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

nav.main-nav a {
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav.main-nav a:hover, nav.main-nav a.active {
  color: hsl(var(--foreground));
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  line-height: 1.25;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.btn-ghost:hover {
  background-color: hsl(var(--muted));
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: hsl(var(--primary) / 0.35);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-primary {
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.3);
}

/* Inputs & Selects */
.input {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}

/* Command Snippet Box */
.command-box {
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  overflow-x: auto;
}

.command-box code {
  white-space: nowrap;
}

/* Tabs */
.tabs-header {
  display: inline-flex;
  padding: 0.25rem;
  background-color: hsl(var(--muted));
  border-radius: 9999px;
  gap: 0.25rem;
  border: 1px solid hsl(var(--border));
}

.tab-btn {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.tab-btn.active {
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Accordion */
.accordion {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: hsl(var(--card));
}

.accordion-item {
  border-bottom: 1px solid hsl(var(--border));
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  width: 100%;
  padding: 1.125rem 1.25rem;
  text-align: left;
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  cursor: pointer;
}

.accordion-content {
  padding: 0 1.25rem 1.125rem 1.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  display: none;
  line-height: 1.6;
}

.accordion-item.open .accordion-content {
  display: block;
}

.accordion-icon {
  transition: transform 0.2s ease;
  font-size: 0.875rem;
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

/* Swatch block */
.swatch-block {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid hsl(var(--border) / 0.5);
}

.swatch-badge {
  position: absolute;
  bottom: 0.625rem;
  left: 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: hsl(var(--background) / 0.85);
  backdrop-filter: blur(4px);
  color: hsl(var(--foreground));
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border) / 0.5);
}

.swatch-sm {
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
}

.swatch-lg {
  aspect-ratio: 21 / 9;
  max-height: 18rem;
  border-radius: var(--radius-card);
}

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3.5rem 0;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 48rem;
  margin: 0 auto;
}

.hero-subhead {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin: 1.25rem auto 2.25rem auto;
  max-width: 36rem;
}

.install-action-block {
  max-width: 40rem;
  margin: 0 auto;
}

.action-caption {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.75rem;
}

.action-caption a {
  color: hsl(var(--foreground));
  text-decoration: underline;
}

/* Grids */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.section-link {
  font-size: 0.875rem;
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 600;
}

.preview-section, .faq-section, .pricing-banner {
  padding: 3rem 0;
}

.preview-grid, .library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.5rem;
}

.preview-card, .library-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  padding: 0.875rem;
}

.preview-card-body, .library-card-body {
  padding: 1rem 0.25rem 0.25rem 0.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.meta-dot {
  opacity: 0.5;
}

.preview-card-title, .library-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: hsl(var(--foreground));
}

.preview-card-desc, .library-card-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pricing Banner */
.pricing-banner-card {
  padding: 2.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  background-color: hsl(var(--muted) / 0.5);
  flex-wrap: wrap;
}

.pricing-banner-copy h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.pricing-banner-copy p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

/* Library Page */
.library-header-section {
  padding: 3rem 0 1.5rem 0;
}

.search-bar-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1 1 20rem;
}

.filter-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select {
  width: auto;
  min-width: 8rem;
  cursor: pointer;
}

.search-status-row {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.library-grid-section {
  padding-bottom: 4rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: hsl(var(--muted-foreground));
}

.empty-state p {
  margin-bottom: 1rem;
}

/* Item Detail Page */
.item-page {
  padding: 2.5rem 0 4rem 0;
  max-width: 56rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.breadcrumb a:hover {
  color: hsl(var(--foreground));
}

.item-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.item-desc {
  font-size: 1.0625rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  margin-bottom: 1rem;
}

.item-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.meta-verified {
  color: hsl(var(--primary));
  font-weight: 500;
}

.item-preview-banner {
  margin: 1.75rem 0;
}

.code-notice-box {
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.code-notice-hint {
  color: hsl(var(--muted-foreground));
}

.prompt-action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.prompt-action-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.anatomy-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.anatomy-block {
  border: 1px solid hsl(var(--border));
  border-radius: 0.875rem;
  background-color: hsl(var(--card));
  overflow: hidden;
}

.anatomy-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background-color: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
}

.anatomy-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.anatomy-code {
  padding: 1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.raw-prompt-block {
  padding: 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.875rem;
  background-color: hsl(var(--card));
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pro-gate-card {
  padding: 3rem 2rem;
  text-align: center;
  background-color: hsl(var(--muted) / 0.5);
}

.pro-gate-content {
  max-width: 28rem;
  margin: 0 auto;
}

.pro-gate-content h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem 0;
}

.pro-gate-content p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.related-section {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}

.related-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.related-card {
  text-decoration: none;
  color: inherit;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.related-body {
  padding: 0.75rem 0.25rem 0.25rem 0.25rem;
}

.related-body h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 0.375rem;
}

/* Pricing Page */
.pricing-page {
  padding: 4rem 0;
  text-align: center;
}

.pricing-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pricing-subhead {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin: 0.75rem auto 2rem auto;
  max-width: 34rem;
}

.billing-toggle-row {
  margin-bottom: 3rem;
}

.save-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  margin-left: 0.25rem;
}

.pricing-grid {
  max-width: 26rem;
  margin: 0 auto;
}

.pricing-card {
  padding: 2.25rem 2rem;
  text-align: left;
}

.price-display {
  margin: 1.25rem 0 0.25rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.price-val {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.price-period {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
}

.price-caption {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.75rem;
}

.pricing-features {
  list-style: none;
  padding: 1.5rem 0;
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  font-size: 0.875rem;
}

.pricing-features li {
  position: relative;
  padding-left: 1.5rem;
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: hsl(var(--primary));
  font-weight: 700;
}

.free-tier-notice {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Docs Page */
.docs-page {
  padding: 3.5rem 0 4rem 0;
  max-width: 52rem;
}

.docs-title {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-subhead {
  font-size: 1.0625rem;
  color: hsl(var(--muted-foreground));
  margin: 0.75rem 0 2rem 0;
}

.docs-tabs-container {
  margin-bottom: 3.5rem;
}

.docs-tabs-container .tabs-header {
  margin-bottom: 1.25rem;
}

.docs-card {
  padding: 1.75rem;
}

.docs-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.docs-card p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.docs-note {
  margin-top: 1.25rem !important;
}

.docs-json-pre {
  background-color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 0.8125rem;
  overflow-x: auto;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.tools-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tools-list code {
  font-weight: 600;
  color: hsl(var(--foreground));
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid hsl(var(--border));
  padding: 3rem 0;
  background-color: hsl(var(--background));
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: hsl(var(--foreground));
}

.footer-meta {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}
