/* Shared styles for all Protoforge pages. Tailwind theme lives inline in each page. */

:root {
  color-scheme: dark;
}

[hidden] { display: none !important; }

/* Long words in headings must not create horizontal scroll on narrow screens */
h1 { overflow-wrap: break-word; hyphens: auto; }
.legal-title { font-size: clamp(1rem, 5.3vw, 2.25rem); line-height: 1.15; }

body {
  background:
    radial-gradient(80rem 40rem at 85% -10%, rgba(124, 92, 255, .16), transparent 60%),
    radial-gradient(60rem 30rem at 10% 10%, rgba(255, 184, 107, .07), transparent 60%),
    #0B0E14;
}

/* Anchor offset under the sticky header */
section[id] { scroll-margin-top: 5rem; }

/* Small phones: keep the hero headline from eating the whole viewport */
@media (max-width: 359px) {
  h1 { font-size: 1.875rem; }
}

/* Primary CTA: hover glow is a plain class, not a Tailwind variant */
.cta-primary {
  transition: background-color .15s ease, box-shadow .15s ease;
}
.cta-primary:hover {
  background-color: #8F73FF;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, .35), 0 8px 32px rgba(124, 92, 255, .28);
}
.cta-primary:active { background-color: #6A4AEB; }

:focus-visible {
  outline: 2px solid #C9BEFF;
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: 0 0 12px 0;
  background: #121722;
  color: #E8ECF4;
  font-size: 14px;
}
.skip-link:focus { left: 0; }

.window-card {
  transition: transform .15s ease-out, background-color .15s ease-out, box-shadow .15s ease-out;
}

.window-card:hover {
  transform: translateY(-4px);
  background-color: #171D2A;
}

.window-card:hover .window-glow { opacity: 1; }
.window-card:hover .window-cta { color: #0B0E14; }

.window-card:hover.wand {
  box-shadow: 0 0 0 1px rgba(255, 201, 74, .28), 0 8px 28px rgba(255, 201, 74, .18);
}

.window-card:hover.pill {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, .28), 0 8px 28px rgba(74, 222, 128, .18);
}

.window-card:hover.genie {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .28), 0 8px 28px rgba(56, 189, 248, .18);
}

/* Card CTA is an <a>, so hover fill needs an explicit rule per artifact */
.window-card.wand .window-cta:hover { background-color: #FFC94A; }
.window-card.pill .window-cta:hover { background-color: #4ADE80; }
.window-card.genie .window-cta:hover { background-color: #38BDF8; }

.ticker-track {
  display: inline-flex;
  gap: 2rem;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Form fields in the lead modal */
.field {
  width: 100%;
  background: #0B0E14;
  border: 1px solid #232A38;
  border-radius: 12px;
  color: #E8ECF4;
  padding: .7rem .85rem;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field:focus {
  outline: none;
  border-color: #7C5CFF;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .18);
}
textarea.field {
  min-height: 104px;
  resize: vertical;
}

/* Matrix table → stacked rows on narrow screens */
@media (max-width: 1023px) {
  .matrix-table,
  .matrix-table tbody,
  .matrix-table tr,
  .matrix-table td { display: block; width: 100%; }

  .matrix-table thead { display: none; }

  .matrix-table tbody tr {
    padding: 1.25rem;
    border-top: 1px solid #232A38;
  }
  .matrix-table tbody tr:first-child { border-top: 0; }

  .matrix-table td { padding: 0; }
  .matrix-table td + td { margin-top: .75rem; }

  .matrix-table td:nth-child(1) { font-size: 12px; }
  .matrix-table td:nth-child(2) { margin-top: .2rem; font-size: 1rem; font-weight: 600; }

  .matrix-table td:nth-child(n+3)::before {
    display: block;
    margin-bottom: .2rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7C879B;
  }
  .matrix-table td:nth-child(3)::before { content: "Что входит"; }
  .matrix-table td:nth-child(4)::before { content: "Результат"; }
  .matrix-table td:nth-child(5)::before { content: "Срок"; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .window-card, .window-glow, .cta-primary, .field { transition: none; }
}

/* Case cards («рецепты») */
.recipe {
  background: #121722;
  border: 1px dashed #2E3748;
  border-radius: 16px;
  padding: 1.25rem;
}
.recipe-row {
  display: flex;
  gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px dashed #232A38;
}
.recipe-row:last-child { border-bottom: 0; }
.recipe-row dt {
  flex: 0 0 104px;
  padding-top: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7C879B;
}
.recipe-row dd {
  font-size: 14px;
  line-height: 1.5;
  color: #E8ECF4;
}

@media (max-width: 640px) {
  .recipe-row dt { flex-basis: 84px; }
}

/* Long-form pages (privacy, consent, artifact pages) */.legal { font-size: 15px; }
.legal section + section { margin-top: 2.5rem; }
.legal h2 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #E8ECF4;
  margin-bottom: .875rem;
}
.legal p,
.legal li { color: #9AA6B8; line-height: 1.75; }
.legal p + p { margin-top: .875rem; }
.legal ul { margin-top: .75rem; padding-left: 1.125rem; list-style: disc; }
.legal li + li { margin-top: .5rem; }
.legal ul + p { margin-top: .875rem; }
.legal strong { color: #E8ECF4; font-weight: 500; }
.legal a {
  color: #E8ECF4;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.legal a:hover { color: #8F73FF; }
.legal .note {
  margin-top: 2rem;
  padding: 1rem 1.125rem;
  border: 1px dashed #2E3748;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #7C879B;
  background: #121722;
}
