/* Loom & Legends — one-page site styles */

:root {
  --bg: #12101a;
  --bg-raised: #1a1726;
  --bg-card: #201c2e;
  --border: #322c46;
  --text: #ece7dc;
  --text-dim: #a89fb8;
  --gold: #d4a94f;
  --gold-bright: #e8c476;
  --crimson: #a33c3c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: 'Cinzel', serif;
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  color: var(--gold);
  margin-bottom: 1.5rem;
}

h2::after {
  content: '';
  display: block;
  width: 64px;
  height: 2px;
  margin: 0.75rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

section {
  padding: 4.5rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

a {
  color: var(--gold-bright);
}

/* ---------- Hero ---------- */

.hero {
  max-width: none;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem;
  background:
    radial-gradient(ellipse 85% 70% at 50% 55%, rgba(18, 16, 26, 0.42), rgba(18, 16, 26, 0.82)),
    linear-gradient(180deg, rgba(18, 16, 26, 0.35), rgba(18, 16, 26, 0.35) 60%, var(--bg)),
    url('images/hero.jpg') center 32% / cover no-repeat,
    var(--bg);
}

.hero-dice {
  position: relative;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Soft gold glow behind the dice — a gradient rather than a filter,
   which Chrome renders with boxy artifacts around animated layers. */
.hero-dice::before {
  content: '';
  position: absolute;
  inset: -45px -60px;
  background: radial-gradient(
    ellipse 55% 55% at 50% 52%,
    rgba(212, 169, 79, 0.26),
    transparent 72%
  );
  pointer-events: none;
}

/* Dice tumble in from above, hit the table, bounce once, and settle. */
.hero-dice img:first-child {
  animation: die-drop-left 1.1s both;
}

.hero-dice img:last-child {
  animation: die-drop-right 1.2s 0.12s both;
}

@keyframes die-drop-left {
  0% {
    transform: translateY(-75vh) rotate(-260deg);
    animation-timing-function: cubic-bezier(0.5, 0, 0.85, 0.4);
  }
  48% {
    transform: translateY(0) rotate(-32deg);
    animation-timing-function: ease-out;
  }
  54% {
    transform: translateY(0) rotate(-28deg) scale(1.1, 0.88);
  }
  68% {
    transform: translateY(-18px) rotate(-16deg) scale(1, 1);
    animation-timing-function: ease-in;
  }
  80% {
    transform: translateY(0) rotate(-10deg);
    animation-timing-function: ease-out;
  }
  90% {
    transform: translateY(-5px) rotate(-8deg);
    animation-timing-function: ease-in;
  }
  100% {
    transform: translateY(0) rotate(-8deg);
  }
}

@keyframes die-drop-right {
  0% {
    transform: translateY(-75vh) rotate(240deg);
    animation-timing-function: cubic-bezier(0.5, 0, 0.85, 0.4);
  }
  48% {
    transform: translateY(0) rotate(30deg);
    animation-timing-function: ease-out;
  }
  54% {
    transform: translateY(0) rotate(26deg) scale(1.1, 0.88);
  }
  68% {
    transform: translateY(-14px) rotate(15deg) scale(1, 1);
    animation-timing-function: ease-in;
  }
  80% {
    transform: translateY(0) rotate(10deg);
    animation-timing-function: ease-out;
  }
  90% {
    transform: translateY(-4px) rotate(8deg);
    animation-timing-function: ease-in;
  }
  100% {
    transform: translateY(0) rotate(8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dice img {
    animation: none;
  }

  .hero-dice img:first-child {
    transform: rotate(-8deg);
  }

  .hero-dice img:last-child {
    transform: rotate(8deg);
  }
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.hero .eyebrow,
.hero .tagline,
.hero .hero-sub {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.tagline {
  margin: 1rem 0 0;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  color: var(--text);
}

.hero-sub {
  margin: 1rem auto 0;
  max-width: 34rem;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.25rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1c1408;
  box-shadow: 0 4px 18px rgba(212, 169, 79, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 169, 79, 0.45);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-raised);
  border-color: var(--gold);
}

/* ---------- About ---------- */

.lead {
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--text-dim);
}

/* ---------- What we do ---------- */

.what-we-do {
  max-width: 1000px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.card h3 {
  font-size: 1.05rem;
  color: var(--gold-bright);
  margin-bottom: 0.5rem;
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-dim);
}

/* ---------- Episodes ---------- */

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.episodes-more {
  margin-top: 1.5rem;
}

.episodes-more a {
  text-decoration: none;
  font-weight: 600;
}

.episodes-more a:hover {
  text-decoration: underline;
}

/* ---------- Connect ---------- */

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.connect-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.connect-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.connect-label {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--gold-bright);
}

.connect-handle {
  font-size: 0.85rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

/* ---------- Toolkit ---------- */

.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.toolkit-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.toolkit-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.toolkit-kicker {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.toolkit-card h3 {
  font-size: 1.3rem;
  color: var(--gold-bright);
  margin-bottom: 0.6rem;
}

.toolkit-card h3 a {
  color: inherit;
  text-decoration: none;
}

.toolkit-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toolkit-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.store-links {
  margin-top: 0.75rem !important;
}

.store-links a {
  color: var(--gold-bright);
  font-weight: 600;
  text-decoration: none;
}

.store-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

footer {
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
}

footer p {
  margin: 0.25rem 0;
}

.footnote {
  font-size: 0.78rem;
  opacity: 0.7;
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.footnote a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footnote a:hover {
  color: var(--gold-bright);
}
