:root {
  --bg-main: #070710;
  --bg-elevated: #111122;
  --accent: #7f5dff;
  --accent-soft: #4f9dff;
  --text-main: #f5f5ff;
  --text-muted: #9a9ac0;
  --border-soft: #26263d;
  --max-width: 960px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.65);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* BODY LAYOUT */
body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #15152a 0, #05050b 50%, #020208 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
}

/* PAGE WRAPPER */
.page {
  width: 100%;
  max-width: var(--max-width);
  flex: 1;
}

/* HEADER */
header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  border: 2px solid rgba(255, 255, 255, 0.25);
}

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

/* THEORY GRID CARDS */
.grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  cursor: pointer;
}

.grid-card img {
  width: 100%;
  height: auto;
  border: 2px solid #7F5DFF;
  border-radius: var(--radius-lg);
}

.grid-card-title {
  margin-top: 8px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* FRAMED STORY REVEAL SECTION */
.pre-header-hero {
  background-color: #0e0e0e;
  border-top: 2px solid #6a00ff;
  border-bottom: 2px solid #6a00ff;
  padding: 40px 20px;
}

.pre-header-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.infinity-icon {
  font-size: 48px;
  color: #ffffff;
  margin-bottom: 30px;
  transition: 
  color 0.3s ease,
  text-shadow 0.3s ease,
  transform 0.3s ease;
}

.infinity-icon:hover {
  color: #b47bff;
  text-shadow:
    0 0 12px rgba(180, 123, 255, 0.9),
    0 0 24px rgba(140, 0, 255, 0.7),
    0 0 40px rgba(106, 0, 255, 0.6);
  transform: scale(1.12);
}

.infinity-icon,
.infinity-icon:visited,
.infinity-icon:hover,
.infinity-icon:active {
  text-decoration: none;
}


.theory-pair {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

/* STORY CARDS */
.theory-card {
  background-color: #1a1a1a;
  border: 2px solid #6a00ff;
  border-radius: 12px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 0 12px rgba(106, 0, 255, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.theory-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.theory-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.theory-text {
  margin-top: 12px;
  font-size: 16px;
  color: #ccc;
  line-height: 1.4;
}

/* LOGO */
.logo-img {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 20%, #4f9dff, #7f5dff 45%, #1b102f 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brand-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* MAIN LAYOUT */
main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* HERO — UNIVERSAL, SCALABLE VERSION */
.hero {
  background-image: url('https://theoryloop.org/assets/images/HeroMain2.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border-radius: var(--radius-lg);
  padding: 24px 20px 22px;
  border: 2px solid #7F5DFF;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero-title {
  font-size: 1.8rem;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 16px;
}

/* FRAMED THEORY REVEAL SECTION */
.pre-header-hero {
  background-image: url('https://theoryloop.org/assets/images/HeroMain2.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border: 2px solid #6a00ff;
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  margin-top: 6px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.pre-header-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

.pre-header-content {
  position: relative;
  z-index: 1;
}

/* GRID */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

/* FOOTER */
footer {
  margin-top: 40px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid rgba(38, 38, 61, 0.8);
  padding-top: 10px;
  width: 100%;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  opacity: 0.85;
}


/* MOBILE */
@media (max-width: 720px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 20px 16px 18px;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .sections-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body {
    padding-inline: 12px;
  }
}