/* ============================================================
   Thufir landing — spice-gold "Mentat" identity.
   Palette + hero + spice canvas lifted and refined from the
   original hirethufir.ai slide system (thufir-dev/site).
   Dark is the base; `body.light` swaps the surface + text vars.
   ============================================================ */

:root {
  /* Surfaces (dark / night) */
  --bg-void: #0a0906;
  --bg-primary: #100e08;
  --bg-card: #1a1811;
  --bg-elevated: #221e16;

  /* Text */
  --text-primary: #f4ead6;
  --text-secondary: #c8a878;
  --text-tertiary: #8b7a60;

  /* Spice gold — the through-line across every Thufir surface */
  --gold: #e8a317;
  --gold-bright: #ffd700;
  --gold-warm: #d48020;
  --gold-subtle: rgba(232, 163, 23, 0.08);
  --gold-border: rgba(232, 163, 23, 0.22);

  /* Borders */
  --border: #2a2618;
  --border-strong: #3a3428;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

body.light {
  /* Surfaces (light / day) — warm parchment, not clinical white */
  --bg-void: #f8f0e0;
  --bg-primary: #ede0c8;
  --bg-card: #e8dfce;
  --bg-elevated: #e2d7c2;

  --text-primary: #2a2218;
  --text-secondary: #6b5a42;
  --text-tertiary: #8a7a64;

  --gold-subtle: rgba(160, 104, 24, 0.08);
  --gold-border: rgba(160, 104, 24, 0.24);

  --border: #d4c8b0;
  --border-strong: #c4b898;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Radial spice glow anchored under the hero */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 26%, var(--gold-subtle) 0%, transparent 55%);
  pointer-events: none;
  z-index: 1;
}

/* Fine sand-grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 999;
}

#spice-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */

.page {
  position: relative;
  z-index: 10;
  max-width: 860px;
  margin: 0 auto;
  padding: 34px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero {
  padding: 6px 0 6px;
}

.hero-title {
  font-size: clamp(3rem, 8.5vw, 5.4rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  margin: 0 0 0.75rem;
  /* indent compensation so the tracked caps stay optically centered */
  padding-left: 0.3em;
  background: linear-gradient(90deg, #b8860b 0%, #ffd700 25%, #fff4c4 50%, #ffd700 75%, #b8860b 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}

body.light .hero-title {
  background: linear-gradient(90deg, #8b6914 0%, #b87a10 25%, #c48a18 50%, #b87a10 75%, #8b6914 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  margin: 0 0 0.7rem;
}

.hero-quote {
  margin: 0;
  border: none;
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
}

/* ── Tool cards (the reusable "repo link" component) ────── */

.tools {
  width: 100%;
  margin-top: 22px;
}

.tools-lede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 auto 16px;
  max-width: 560px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}

.tool {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out), background-color 0.5s ease;
}
.tool:hover {
  border-color: var(--gold-border);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-logo { flex: 0 0 40px; width: 40px; height: 40px; color: var(--gold); }
.tool-logo svg { width: 100%; height: 100%; display: block; }

.tool-body { display: block; min-width: 0; }

.tool-tag {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.tool-name {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.tool-arrow {
  display: inline-block;
  margin-left: 8px;
  color: var(--gold);
  transition: transform 200ms var(--ease-out);
}
.tool:hover .tool-arrow { transform: translateX(4px); }

.tool-body p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ── Agentic Mastery banner ─────────────────────────────── */

.banner {
  width: 100%;
  margin-top: 16px;
  padding: 18px 24px;
  text-align: center;
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--gold-subtle) 0%, transparent 70%),
    var(--bg-elevated);
}

.banner-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.banner-lede {
  margin: 0 auto 8px;
  max-width: 640px;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
}

.banner-body {
  margin: 0 auto 16px;
  max-width: 640px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.banner-cta {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-void);
  background: var(--gold);
  padding: 9px 22px;
  border-radius: 4px;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.banner-cta:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(232, 163, 23, 0.22);
}

/* ── Footer ─────────────────────────────────────────────── */

.foot {
  margin-top: 18px;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}
.foot a { color: var(--text-secondary); }

/* ── Mode toggle ────────────────────────────────────────── */

.mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, background-color 0.3s, transform 0.3s;
}
.mode-toggle:hover { border-color: var(--gold-border); transform: rotate(20deg); }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
  .page { padding: 44px 18px 36px; max-width: 460px; }
  .tool-grid { grid-template-columns: 1fr; }
  .banner { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title { animation: none; }
  html { scroll-behavior: auto; }
}
