/* ==========================================================================
   Korvixalix — design tokens
   Motif: a cut ruby. Facet count encodes depth: more facets, deeper guide.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500;1,9..144,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* color */
  --void:    #140a0c;
  --panel:   #1e1114;
  --panel-2: #271519;
  --ruby:    #e0263f;
  --ruby-2:  #ff4f63;
  --garnet:  #5c1220;
  --ivory:   #f4e9e4;
  --dust:    #a98a8d;

  /* type */
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* layout */
  --max: 1120px;
  --edge: 1px solid var(--garnet);
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ruby-2);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

em, .accent-word { font-style: italic; color: var(--ruby-2); font-weight: 500; }

p { margin: 0 0 1em; color: var(--dust); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ruby-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--ruby);
  transform: rotate(45deg);
  display: inline-block;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 10, 12, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: var(--edge);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand .gem-mark { width: 22px; height: 22px; flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 32px;
  font-size: 0.92rem;
}

.main-nav a {
  color: var(--dust);
  transition: color 0.15s ease;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--ivory); }

.nav-toggle {
  display: none;
  background: none;
  border: var(--edge);
  color: var(--ivory);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    inset: 72px 0 0 0;
    background: var(--void);
    flex-direction: column;
    padding: 32px 24px;
    gap: 22px;
    font-size: 1.1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .main-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-toggle { display: flex; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.94rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ruby-2), var(--ruby) 60%, var(--garnet));
  color: var(--ivory);
  box-shadow: 0 0 0 rgba(224, 38, 63, 0);
}
.btn-primary:hover { box-shadow: 0 6px 24px -6px rgba(224, 38, 63, 0.55); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border-color: var(--garnet);
  color: var(--ivory);
}
.btn-ghost:hover { border-color: var(--ruby); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Hero — the gem, cut open
   ========================================================================== */

.hero {
  position: relative;
  padding: 96px 0 84px;
  overflow: hidden;
  border-bottom: var(--edge);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--ivory);
  margin-top: 18px;
}

.hero .lede {
  font-size: 1.1rem;
  max-width: 46ch;
  margin-top: 18px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-gem {
  justify-self: center;
  width: min(360px, 80vw);
}

.hero-gem svg { width: 100%; height: auto; }

.gem-facet {
  transform-origin: center;
}

@keyframes facet-in {
  from { opacity: 0; transform: scale(0.72); }
}

.hero-gem-svg { width: 100%; height: auto; overflow: visible; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-gem { order: -1; width: 220px; margin-bottom: 8px; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 84px 0; }
.section-tight { padding: 56px 0; }
.section-alt { background: var(--panel); border-top: var(--edge); border-bottom: var(--edge); }

.section-head { max-width: 60ch; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-top: 14px; }

/* ==========================================================================
   Product catalogue
   ========================================================================== */

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--garnet);
  border: var(--edge);
}

.product-card {
  background: var(--panel);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s ease;
}
.product-card:hover { background: var(--panel-2); }

.product-card .gem-icon { width: 34px; height: 34px; }

.product-card .kind {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
}

.product-card h3 { font-size: 1.2rem; margin: 0; color: var(--ivory); }
.product-card .tagline { font-size: 0.9rem; margin: 0; flex-grow: 1; }

.product-card .price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: var(--edge);
  padding-top: 14px;
  margin-top: 4px;
}

.price {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ruby-2);
}
.price.is-free { color: var(--ivory); }

.card-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dust);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.product-card:hover .card-link { color: var(--ruby-2); }

/* ==========================================================================
   Feature / advantages grid
   ========================================================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}

.feature .gem-icon { width: 30px; height: 30px; margin-bottom: 14px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--ivory); }
.feature p { font-size: 0.94rem; margin: 0; }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-list { border-top: var(--edge); max-width: 76ch; }

.faq-item { border-bottom: var(--edge); }

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ivory);
}
.faq-item summary::-webkit-details-marker { display: none; }

.faq-item .plus {
  font-family: var(--mono);
  color: var(--ruby-2);
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] .plus { transform: rotate(45deg); }

.faq-item .faq-a { padding: 0 4px 22px; max-width: 64ch; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: var(--edge);
  padding: 56px 0 32px;
  background: var(--panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dust);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ivory); font-size: 0.92rem; }
.footer-col a:hover { color: var(--ruby-2); }

.footer-brand p { max-width: 34ch; font-size: 0.9rem; }

.footer-bottom {
  border-top: var(--edge);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--dust);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Generic content pages (about / legal)
   ========================================================================== */

.page-hero {
  padding: 64px 0 48px;
  border-bottom: var(--edge);
}
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 14px; }
.page-hero .lede { max-width: 60ch; font-size: 1.05rem; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.4rem; margin-top: 2.2em; color: var(--ivory); }
.prose h2:first-child { margin-top: 0; }
.prose ul { color: var(--dust); padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--ivory); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  background: var(--panel);
  border: var(--edge);
  padding: 28px;
}
.contact-card h3 { color: var(--ivory); font-size: 1rem; margin-bottom: 6px; }
.contact-card a.mono-link {
  font-family: var(--mono);
  color: var(--ruby-2);
  font-size: 0.95rem;
}

/* ==========================================================================
   Product detail (product.html)
   ========================================================================== */

.product-hero {
  padding: 56px 0 48px;
  border-bottom: var(--edge);
}

.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  align-items: start;
}

.product-hero .kind-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dust);
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin-top: 14px; }
.product-hero .tagline-lg { font-size: 1.1rem; max-width: 52ch; margin-top: 14px; }

.buy-panel {
  background: var(--panel);
  border: var(--edge);
  padding: 28px;
  position: sticky;
  top: 96px;
}

.buy-panel .price-lg {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--ruby-2);
  margin-bottom: 4px;
}
.buy-panel .price-lg.is-free { color: var(--ivory); }

.buy-panel .format-line {
  font-size: 0.88rem;
  color: var(--dust);
  margin-bottom: 20px;
}

.buy-panel .gem-icon-lg { width: 64px; height: 64px; margin-bottom: 18px; }

@media (max-width: 860px) {
  .product-hero-grid { grid-template-columns: 1fr; }
  .buy-panel { position: static; }
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; gap: 40px; } }

.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--edge);
}
.module-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: var(--edge);
  font-size: 0.96rem;
  color: var(--ivory);
}
.module-list .facet-tick { width: 18px; height: 18px; margin-top: 2px; }

.audience-box {
  background: var(--panel);
  border: var(--edge);
  padding: 24px;
}
.audience-box h3 { font-size: 0.95rem; color: var(--ivory); margin-bottom: 10px; }
.audience-box p { margin: 0; font-size: 0.95rem; }

.related-strip { margin-top: 8px; }

/* ==========================================================================
   Loading page
   ========================================================================== */

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  text-align: center;
  padding: 24px;
}

.loading-gem { width: 84px; height: 84px; animation: spin-facets 1.6s linear infinite; }

@keyframes spin-facets {
  to { transform: rotate(360deg); }
}

.loading-screen h1 { font-size: 1.3rem; }
.loading-screen p { max-width: 40ch; }

.loading-fallback { display: none; margin-top: 12px; }
.loading-fallback.is-visible { display: block; }

/* ==========================================================================
   404 / empty state
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 120px 24px;
}
.empty-state .gem-icon-lg { margin: 0 auto 24px; width: 56px; height: 56px; }

/* ==========================================================================
   Utility
   ========================================================================== */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
