/* ============================================
   Iron Tower Press - Style Sheet
   Dark cosmic theme: purple + electric blue
   ============================================ */

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

:root {
  /* Colors */
  --bg-dark: #0a0a1a;
  --bg-darker: #060612;
  --bg-card: #12122a;
  --bg-card-hover: #1a1a3a;
  --purple: #8b5cf6;
  --purple-dark: #6d28d9;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --glow: #a78bfa;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-bright: #f8fafc;
  --border: rgba(139, 92, 246, 0.2);
  --border-hover: rgba(139, 92, 246, 0.4);

  /* Typography */
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --nav-height: 70px;
  --section-padding: 100px 0;
  --container-width: 1200px;
  --gap: 24px;

  /* Effects */
  --glow-shadow: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--glow);
}

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

/* --- Utility --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding);
}

.text-center { text-align: center; }
.text-glow { text-shadow: var(--glow-shadow); }

/* Scroll-triggered animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

.section-title {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  margin: 16px auto 0;
  border-radius: 2px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Nav logo image */
.nav-logo-img {
  height: 42px;
  width: auto;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-bright);
  background: rgba(139, 92, 246, 0.1);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--purple);
  border-radius: 1px;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-darker);
}

.hero-parallax {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-layer {
  position: absolute;
  inset: -50px;
  transition: transform 0.1s ease-out;
}

/* Layer 1: Starfield canvas */
.hero-layer--bg {
  z-index: 1;
}

.hero-layer--bg canvas {
  width: 100%;
  height: 100%;
}

/* Layer 2: Character / midground */
.hero-layer--mid {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* <!-- REPLACE: runway-ml-art --> */
.hero-character-placeholder {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background:
    radial-gradient(ellipse 40% 55% at 50% 35%,
      rgba(139, 92, 246, 0.35) 0%,
      rgba(99, 60, 220, 0.2) 30%,
      transparent 70%
    ),
    radial-gradient(ellipse 25% 40% at 50% 70%,
      rgba(59, 130, 246, 0.2) 0%,
      rgba(139, 92, 246, 0.08) 40%,
      transparent 70%
    ),
    radial-gradient(ellipse 50% 30% at 45% 50%,
      rgba(139, 92, 246, 0.12) 0%,
      transparent 70%
    );
}

/* Layer 3: Foreground particles */
.hero-layer--fg {
  z-index: 3;
  pointer-events: none;
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 24px;
}

/* Arcane logo wrapper */
.arcane-logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(300px, 35vw, 450px);
  height: clamp(300px, 35vw, 450px);
  margin: 0 auto 16px;
  isolation: isolate;
}

/* Arcane circle SVG */
.arcane-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: arcaneRotate 60s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes arcaneRotate {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ember particle canvas */
.ember-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Hero logo image */
.hero-logo {
  position: relative;
  z-index: 1;
  width: clamp(180px, 22vw, 300px);
  height: auto;
  border-radius: 12px;
  filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.4));
  animation: heroLogoGlow 3s ease-in-out infinite alternate;
}

@keyframes heroLogoGlow {
  0% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3)); }
  100% { filter: drop-shadow(0 0 50px rgba(59, 130, 246, 0.5)); }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--text-bright) 0%, var(--glow) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 3s ease-in-out infinite alternate;
  margin-bottom: 16px;
}

@keyframes titleGlow {
  0% { filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.4)); }
  100% { filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.6)); }
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 40px;
  font-weight: 300;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: var(--text-bright);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
  color: var(--text-bright);
}

.btn-outline {
  background: transparent;
  color: var(--text-bright);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--purple);
  transform: translateY(-2px);
  color: var(--text-bright);
}

/* --- Page Hero (non-home pages) --- */
.page-hero {
  padding: calc(var(--nav-height) + 60px) 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero h1 {
  margin-bottom: 12px;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--purple-dark), var(--blue));
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-image.landscape {
  aspect-ratio: 16 / 9;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.2);
}

.card-body {
  padding: 24px;
  text-align: center;
}

.card-body h3 {
  margin-bottom: 8px;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Book Links */
.book-link {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-dark), var(--blue));
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.book-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--glow);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.tag-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.tag-green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tag-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-released {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.status-released::before {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dev {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.status-dev::before {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-soon {
  background: rgba(139, 92, 246, 0.1);
  color: var(--glow);
}

.status-soon::before {
  background: var(--glow);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* --- Filter Buttons (Books page) --- */
.filter-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-bright);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: var(--text-bright);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

/* --- Featured Card (Software page) --- */
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 60px;
  transition: all var(--transition);
}

.featured-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 40px rgba(139, 92, 246, 0.15);
}

.featured-card .card-image {
  aspect-ratio: auto;
  min-height: 400px;
}

.featured-card .card-body {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card .card-body h3 {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.featured-card .card-body p {
  font-size: 1rem;
  margin-bottom: 24px;
}

/* --- Team Cards (About page) --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--gap);
  max-width: 800px;
  margin: 0 auto;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  transition: all var(--transition);
}

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

.team-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--text-bright);
  border: 3px solid var(--border-hover);
}

.team-card h3 {
  margin-bottom: 4px;
}

.team-role {
  color: var(--purple);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.team-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.team-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Mission / Story Block --- */
.content-block {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.content-block p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.mission-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-bright);
  padding: 32px;
  border-left: 3px solid var(--purple);
  background: rgba(139, 92, 246, 0.05);
  border-radius: 0 12px 12px 0;
  margin: 40px 0;
  text-align: left;
  line-height: 1.6;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--bg-darker);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

/* Footer logo image */
.footer-logo {
  width: 80px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 16px;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.footer-logo:hover {
  opacity: 1;
}

.footer-brand h4 {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-links h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
    --gap: 16px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-character-placeholder {
    width: 100%;
    height: 100%;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card .card-body {
    padding: 32px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    letter-spacing: 0.06em;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 280px;
  }
}
