/*
 * home.css — Glintstone www landing page
 * Standalone: does NOT import app CSS. No framework dependencies.
 * Dark mode default. Georgia serif headings. Amber accent system.
 */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* www accent palette */
  --www-accent:         #f59e0b;
  --www-accent-hover:   #fbbf24;
  --www-accent-glow:    rgba(245, 158, 11, 0.25);
  --www-accent-muted:   rgba(245, 158, 11, 0.12);

  /* Backgrounds */
  --bg-deepest:   #080808;
  --bg-deep:      #0a0a0a;
  --bg-base:      #111111;
  --bg-surface:   #1a1a1a;
  --bg-elevated:  #222222;
  --bg-card:      #1c1c1c;

  /* Text */
  --text-primary:  #f0ede8;
  --text-dim:      rgba(240, 237, 232, 0.65);
  --text-subtle:   rgba(240, 237, 232, 0.40);
  --text-accent:   var(--www-accent);

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-accent:  rgba(245, 158, 11, 0.30);

  /* Elevation shadows */
  --elevation-1: 0 1px 3px rgba(0,0,0,0.30), 0 1px 2px rgba(0,0,0,0.20);
  --elevation-2: 0 4px 12px rgba(0,0,0,0.40), 0 2px 4px rgba(0,0,0,0.25);

  /* Typography */
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans:  system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-w: 960px;
  --section-pad: 96px 24px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.25s ease;
}

/* ============================================================
   Reset + Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ============================================================
   Custom Scrollbar
   ============================================================ */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ============================================================
   Utility
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Scroll-fade animations (IntersectionObserver driven)
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(8, 8, 8, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.site-header-logo svg {
  height: 18px;
  color: var(--www-accent);
}

.site-header-wordmark {
  font-family: var(--font-serif);
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 1rem;
  color: var(--text-primary);
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header-nav a {
  font-size: 0.875rem;
  color: var(--text-dim);
  transition: color var(--t-fast);
}

.site-header-nav a:hover {
  color: var(--text-primary);
}

.btn-nav-cta {
  padding: 6px 16px;
  border: 1px solid var(--border-accent);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--www-accent) !important;
  transition: background var(--t-fast), color var(--t-fast) !important;
}

.btn-nav-cta:hover {
  background: var(--www-accent-muted);
}

/* ============================================================
   HERO
   ============================================================ */

@keyframes hero-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes chevron-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 24px 80px;
  background: linear-gradient(
    160deg,
    #0a0808 0%,
    #0f0b07 30%,
    #140d08 55%,
    #0a0a0a 80%,
    #060606 100%
  );
  background-size: 200% 200%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero {
    animation: hero-gradient-shift 18s ease-in-out infinite;
  }
}

/* Bottom fade to next section */
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--bg-deepest));
  pointer-events: none;
  z-index: 0;
}

/* Decorative background — no image dependency */
.hero-bg-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Large dingir star in background, top-right */
.hero-bg-deco::before {
  content: "𒀭";
  position: absolute;
  top: -60px;
  right: -60px;
  font-size: 500px;
  line-height: 1;
  color: rgba(245, 158, 11, 0.032);
  user-select: none;
}

/* Radial amber bloom, top-left */
.hero-bg-deco::after {
  content: "";
  position: absolute;
  top: -180px;
  left: -180px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.07) 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-variant: small-caps;
  letter-spacing: 0.22em;
  font-size: 0.8125rem;
  color: var(--www-accent);
  margin-bottom: 28px;
  opacity: 0.85;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.18;
  color: #f5f0e8;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.hero-body {
  font-size: 1.125rem;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--www-accent);
  color: #0a0808;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  box-shadow: 0 0 24px var(--www-accent-glow);
}

.btn-primary:hover {
  background: var(--www-accent-hover);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.38);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9375rem;
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
}

.btn-secondary:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-subtle);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-scroll-indicator svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-scroll-indicator svg {
    animation: chevron-bounce 2s ease-in-out infinite;
  }
}

/* ============================================================
   SHARED SECTION STYLES
   ============================================================ */
.section {
  padding: var(--section-pad);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-variant: small-caps;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--www-accent);
  margin-bottom: 12px;
  opacity: 0.75;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.625rem, 3.5vw, 2.25rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 580px;
  line-height: 1.65;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-default), transparent);
}

/* ============================================================
   SECTION 2: DATA CREDIBILITY
   ============================================================ */
.data-section {
  background: var(--bg-deepest);
}

.data-section .section-inner {
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 48px;
}

.stat-cell {
  padding: 36px 24px;
  border-right: 1px solid var(--border-subtle);
  text-align: center;
}

.stat-cell:last-child {
  border-right: none;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: clamp(1.875rem, 3.5vw, 2.625rem);
  font-weight: 400;
  color: var(--www-accent);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sources-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.source-badge {
  padding: 5px 14px;
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  transition: border-color var(--t-fast), color var(--t-fast);
  cursor: default;
}

.source-badge:hover {
  border-color: var(--border-accent);
  color: var(--text-dim);
}

.sources-subtext {
  font-size: 0.875rem;
  color: var(--text-subtle);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ============================================================
   SECTION 3: ATTRIBUTION ARCHITECTURE
   ============================================================ */
.attribution-section {
  background: var(--bg-base);
}

.attribution-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.attribution-prose p {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 20px;
}

.attribution-prose p:last-child {
  margin-bottom: 0;
}

.attribution-prose strong {
  color: var(--text-primary);
  font-weight: 500;
}

.attribution-diagram {
  background: var(--bg-deepest);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 28px 24px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Mono', 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.95;
  color: var(--text-dim);
  overflow-x: auto;
}

.diagram-token   { color: var(--text-primary); font-weight: 500; }
.diagram-line    { color: var(--text-subtle); }
.diagram-rdg-a   { color: var(--www-accent); }
.diagram-rdg-b   { color: #7ba4c4; }
.diagram-meta    { color: var(--text-subtle); font-size: 0.75rem; }

/* ============================================================
   SECTION 4: CAPABILITIES
   ============================================================ */
.capabilities-section {
  background: var(--bg-deep);
}

.capabilities-header {
  text-align: center;
  margin-bottom: 48px;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.capability-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px 28px;
  transition: border-color var(--t-normal), box-shadow var(--t-normal);
}

.capability-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--elevation-2), 0 0 28px var(--www-accent-glow);
}

.capability-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 20px;
  color: var(--www-accent);
  opacity: 0.9;
}

.capability-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.capability-body {
  font-size: 0.9375rem;
  color: var(--text-dim);
  line-height: 1.72;
}

.capability-note {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  font-style: italic;
}

/* ============================================================
   SECTION 5: EARLY ACCESS CTA
   ============================================================ */
.cta-section {
  background: var(--bg-deepest);
  text-align: center;
}

.cta-subhead {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto 48px;
  line-height: 1.75;
}

.access-form {
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  min-height: 44px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--www-accent-muted);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-subtle);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.form-submit {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

.form-note {
  text-align: center;
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-deepest);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px;
}

.site-footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-subtle);
  transition: color var(--t-fast);
}

.footer-links a:hover {
  color: var(--text-dim);
}

.footer-sources {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  line-height: 1.6;
}

.footer-sources a {
  color: var(--text-subtle);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.15);
  text-underline-offset: 2px;
  transition: color var(--t-fast);
}

.footer-sources a:hover {
  color: var(--text-dim);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-subtle);
  opacity: 0.55;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --section-pad: 64px 20px;
  }

  .site-header {
    padding: 0 20px;
  }

  .hero-bg-deco::before {
    font-size: 260px;
    top: -20px;
    right: -20px;
  }

  /* Stats: 2x2 grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-cell:nth-child(2) {
    border-right: none;
  }
  .stat-cell:nth-child(3) {
    border-top: 1px solid var(--border-subtle);
  }
  .stat-cell:nth-child(4) {
    border-top: 1px solid var(--border-subtle);
    border-right: none;
  }

  /* Attribution: single column */
  .attribution-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* Capabilities: single column */
  .capabilities-grid {
    grid-template-columns: 1fr;
  }

  /* Prevent iOS input zoom on focus */
  .form-field input,
  .form-field textarea {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  /* Hide secondary nav CTA on tiny screens; hero CTA stays visible */
  .btn-nav-cta {
    display: none;
  }
}
