/* =====================================================
   ATOMATRIX — Getting Started
   Dark mode, mobile-first, branded
   ===================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand blues (from the logo gradient) */
  --brand-deep:   #001844;
  --brand-mid:    #004383;
  --brand-bright: #2f74e6;
  --brand-glow:   #4d8bff;

  /* Dark-mode surfaces */
  --bg-base:    #020a1f;
  --bg-base-2:  #04122e;
  --surface:    rgba(16, 33, 71, 0.55);
  --surface-2:  rgba(22, 44, 92, 0.65);
  --border:     rgba(120, 162, 255, 0.14);
  --border-hi:  rgba(120, 162, 255, 0.40);

  /* Text */
  --text:       #eaf0ff;
  --text-muted: #a6b6dc;

  /* Accent button colors (brand kept) */
  --c-docs:    #119240;
  --c-discord: #5865f2;
  --c-terms:   #c07f2c;
  --c-tebex:   #1f9b9b;

  --radius:     20px;
  --radius-sm:  14px;
  --shadow:     0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --bounce:     cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(47, 116, 230, 0.22), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(0, 67, 131, 0.30), transparent 55%),
    linear-gradient(180deg, var(--bg-base-2) 0%, var(--bg-base) 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

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

/* ---------- Ambient brand orbs ---------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 16s ease-in-out infinite;
}

.orb--1 { top: -8%;  left: -6%;  width: 360px; height: 360px; background: #1b4dad; }
.orb--2 { bottom: -12%; right: -8%; width: 420px; height: 420px; background: #0a3a78; animation-delay: -5s; }
.orb--3 { top: 40%; left: 55%; width: 300px; height: 300px; background: #123e8c; animation-delay: -9s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(20px, -30px) scale(1.08); }
}

/* ---------- Layout ---------- */
.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 2.5rem;
}

/* ---------- Hero (brand left, intro right) ---------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  animation: rise 0.7s var(--bounce) both;
}

/* Left — brand lockup */
.hero__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero__logo {
  width: clamp(56px, 9vw, 78px);
  height: auto;
  animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.hero__brand-text { line-height: 1.05; }

.hero__name,
.hero__sub {
  margin: 0;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Right — intro / title */
.hero__intro {
  text-align: right;
  max-width: 32ch;
}

.hero__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-glow);
}

.hero__title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.45rem, 2.7vw, 2.05rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero__title .accent {
  background: linear-gradient(100deg, var(--brand-glow), #8fb6ff 60%, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Card grid ---------- */
/* Fixed 3 columns so the three boxes span the full width and line up
   flush with the full-width Tebex (featured) box below them. */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.85rem, 1.6vw, 1.25rem);
}

/* ---------- Cards ---------- */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1.15rem, 2vw, 1.6rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    transform 0.45s var(--bounce),
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
  animation: rise 0.7s var(--bounce) both;
}

/* Staggered entrance */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }

/* The bounce on hover */
.card:hover,
.card:focus-within {
  transform: translateY(-12px);
  border-color: var(--border-hi);
  background: var(--surface-2);
  box-shadow:
    0 30px 60px -25px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(120, 162, 255, 0.15),
    0 16px 50px -20px rgba(47, 116, 230, 0.45);
}

/* Featured (Tebex) card spans full width on wide screens */
.card--featured {
  grid-column: 1 / -1;
}

.card--featured .card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 60ch;
}

/* ---------- Card icon ---------- */
.card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.85rem;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, rgba(47, 116, 230, 0.35), rgba(0, 67, 131, 0.35));
  border: 1px solid var(--border-hi);
  transition: transform 0.45s var(--bounce);
}

.card:hover .card__icon,
.card:focus-within .card__icon {
  transform: scale(1.1) rotate(-4deg);
}

.card__icon svg { width: 26px; height: 26px; }

.card__icon--docs    { background: linear-gradient(145deg, rgba(17, 146, 64, 0.40), rgba(8, 70, 32, 0.45)); }
.card__icon--discord { background: linear-gradient(145deg, rgba(88, 101, 242, 0.45), rgba(40, 48, 130, 0.45)); }
.card__icon--terms   { background: linear-gradient(145deg, rgba(192, 127, 44, 0.45), rgba(96, 60, 18, 0.45)); }
.card__icon--tebex   { background: linear-gradient(145deg, rgba(31, 155, 155, 0.45), rgba(14, 78, 78, 0.45)); }

/* ---------- Card text ---------- */
.card__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 700;
  color: var(--text);
}

.card__text {
  margin: 0 0 0.65rem;
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Funky Tebex call-to-action that leads into the button */
.card__cta {
  margin: 0.2rem 0 0.95rem;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.cta-highlight {
  white-space: nowrap;
  font-weight: 800;
  background: linear-gradient(100deg, #2bd4d4, #6ff3ea 55%, #b6fff7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.card__badge {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9af0e8;
  background: rgba(31, 155, 155, 0.16);
  border: 1px solid rgba(31, 155, 155, 0.4);
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;        /* pin to bottom so cards align */
  width: 100%;
  max-width: 320px;
  min-height: 48px;
  padding: 0 1.25rem;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.25s var(--bounce), filter 0.25s ease, box-shadow 0.25s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px);
  filter: brightness(1.08);
}

.button:active { transform: translateY(-1px); }

/* Arrow nudges toward the action on hover */
.button__arrow {
  display: inline-block;
  margin-left: 0.4rem;
  transition: transform 0.25s var(--bounce);
}

.button:hover .button__arrow,
.button:focus-visible .button__arrow { transform: translateX(5px); }

.button-documentation { background: var(--c-docs);    box-shadow: 0 10px 26px -10px var(--c-docs); }
.button-discord       { background: var(--c-discord); box-shadow: 0 10px 26px -10px var(--c-discord); }
.button-terms         { background: var(--c-terms);   box-shadow: 0 10px 26px -10px var(--c-terms); }
.button-tebex         { background: var(--c-tebex);   box-shadow: 0 10px 26px -10px var(--c-tebex); }

.button-documentation:hover, .button-documentation:focus-visible { box-shadow: 0 16px 32px -10px var(--c-docs); }
.button-discord:hover,       .button-discord:focus-visible       { box-shadow: 0 16px 32px -10px var(--c-discord); }
.button-terms:hover,         .button-terms:focus-visible         { box-shadow: 0 16px 32px -10px var(--c-terms); }
.button-tebex:hover,         .button-tebex:focus-visible         { box-shadow: 0 16px 32px -10px var(--c-tebex); }

/* ---------- Entrance animation ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }

  /* Stack & centre the hero on small screens.
     Use block layout so children fill the width and the title wraps
     (a flex column with align-items:center sizes the title to its
     max-content width and lets it overflow the viewport). */
  .hero {
    display: block;
    text-align: center;
    margin-bottom: clamp(1.25rem, 5vw, 2rem);
  }

  .hero__brand {
    justify-content: center;
    margin-bottom: 0.9rem;
  }

  .hero__intro {
    text-align: center;
    max-width: 100%;
  }

  /* One full-width column — every box matches the Tebex box width */
  .grid { grid-template-columns: 1fr; }

  .card { padding: 1.5rem 1.25rem; }

  /* Lighter lift on touch screens */
  .card:hover,
  .card:focus-within { transform: translateY(-6px); }
}

/* ---------- Respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover,
  .card:focus-within { transform: none; }
}
