:root {
  --display: 'Spectral', Georgia, serif;
  --bg: #0a0b10;
  --panel: #0e1015;
  --panel-2: #14171e;
  --border: #22262f;
  --text: #eef1f5;
  --text-dim: #9ba2ad;
  --text-faint: #5b6270;
  --accent: #7dd3c8;
  --accent-strong: #92e0d6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  overflow-x: hidden;
}

/* Page backdrop: the red Mastro fading in below the hero video (behind the reel, Origin and Choose Your Power),
   and the blue Mastro rising from the bottom. body is its own stacking context so the z-index:-1 layer paints above body's background. */
body { position: relative; isolation: isolate; }
.page-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.page-bg-top, .page-bg-bottom {
  position: absolute; left: 0; right: 0; height: 150vh;
  background-size: cover; background-repeat: no-repeat;
}
.page-bg-top {
  top: 92vh; height: 1900px;
  background-image: url("assets/bg-mastro-red.webp");
  background-position: center 35%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 58%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 58%, transparent 100%);
}
.page-bg-bottom {
  bottom: 0;
  background-image: url("assets/bg-mastro-blue.webp");
  background-position: center 65%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 35%, transparent 100%);
          mask-image: linear-gradient(to top, #000 0%, #000 35%, transparent 100%);
}

a { color: var(--accent); }

.section-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav { position: relative; z-index: 5; width: 100%; }
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f4f2ea;
}
.btn-ghost {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #cfd4dc;
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  text-decoration: none;
  display: inline-block;
  background: var(--accent);
  color: #0a0b10;
  font-weight: 700;
  font-size: 15px;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-primary.full { width: 100%; text-align: center; }
.btn-primary.disabled { opacity: 0.55; cursor: default; pointer-events: none; }

/* Hero */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  margin-top: -84px;
  padding-top: 84px;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
/* Darker than the old scrim: the clip has bright snow and sea under the eyebrow and CTA. Fades to the page colour at the bottom. */
.hero-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 78%, rgba(10,11,16,0.55) 0%, rgba(10,11,16,0) 100%),
    linear-gradient(180deg, rgba(10,11,16,0.55) 0%, rgba(10,11,16,0.22) 35%, rgba(10,11,16,0.6) 78%, var(--bg) 100%);
}
.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 72px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); display: flex; align-items: center; gap: 10px;
}
.eyebrow .line { width: 28px; height: 1px; background: var(--accent); }
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.1;
  color: #f8f6ee;
}
.hero-content > p { margin: 0; max-width: 560px; font-size: 16px; line-height: 1.7; color: #cfd4dc; }

.verb-canvas { display: block; width: 960px; max-width: 100%; aspect-ratio: 960 / 168; height: auto; margin-top: 6px; }

/* Five Castles reel: one video element, its src swapped per clip */
.reel { padding: 88px 0 16px; }
.reel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-caption {
  position: absolute; left: 28px; bottom: 24px; right: 96px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 620px;
  background: none; border: none; padding: 0; margin: 0; text-align: left; color: inherit; font: inherit; cursor: pointer;
}
.reel-caption:disabled { cursor: default; }
.reel-name { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.1; color: #f8f6ee; }
.reel-line { font-size: 14px; line-height: 1.55; color: #cfd4dc; }
.reel-caption:not(:disabled):hover .reel-name,
.reel-caption:not(:disabled):focus-visible .reel-name { color: var(--accent); }
.reel-caption:not(:disabled) .reel-name::after { content: " \203A"; color: var(--accent); }
.reel-arrow {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(10,11,16,0.55); border: 1px solid rgba(255,255,255,0.14); color: #eef1f5; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.reel-arrow:hover, .reel-arrow:focus-visible { border-color: var(--accent); color: var(--accent); }
.reel-prev { left: 14px; }
.reel-next { right: 14px; }

/* Origin slideshow */
.showcase { padding: 88px 0 16px; }
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 20px;
}
.origin-frame {
  position: relative; width: 100%; aspect-ratio: 16/9; max-height: 560px;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--panel);
}
.origin-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.5s ease; }
.origin-scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,11,16,0.85), transparent 45%); }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.dots .dot-i { height: 6px; border-radius: 3px; background: var(--border); width: 6px; transition: background 0.3s ease, width 0.3s ease; }
.dots .dot-i.active { background: var(--accent); width: 22px; }

/* Choose Your Power / Philosophy */
.power, .factions { padding: 88px 0 0; }
.power-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.power-btn {
  position: relative; height: 150px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); cursor: pointer; background-size: cover; background-position: center;
  transition: transform 0.2s ease;
}
.power-btn:hover, .power-btn:focus-visible { transform: translateY(-3px); }
.power-btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10,11,16,1) 0%, rgba(10,11,16,0) 100%);
}
.power-btn .p-name {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--display); font-size: 15px; font-weight: 700; color: #f4f2ea;
}
.subpanel {
  height: 0; opacity: 0; overflow: hidden; margin-top: 0;
  transition: height 0.35s ease, opacity 0.3s ease, margin-top 0.35s ease;
  border-radius: 14px;
}
.subpanel.open { height: 220px; opacity: 1; margin-top: 14px; }
.subpanel-bg {
  position: relative; height: 100%; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background-size: cover; background-position: center;
}
.subpanel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.subpanel-bg::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(10,11,16,0.92) 30%, rgba(10,11,16,0.5) 100%);
}
.subpanel-inner { position: relative; z-index: 2; padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.subpanel-inner .sp-title { font-family: var(--display); font-size: 22px; font-weight: 700; color: #f4f2ea; }
.subpanel-inner .sp-desc { font-size: 14px; line-height: 1.6; color: #cfd4dc; }
.sp-col-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.sp-line { font-size: 13px; color: #b7bec9; margin-bottom: 3px; }
.sp-chip { font-size: 12px; padding: 6px 12px; border: 1px solid #262b36; border-radius: 999px; color: #b7bec9; }
.sp-chips { display: flex; gap: 10px; flex-wrap: wrap; }

/* Ability hover split (class cards only): left is static info, right shows whatever ability is hovered/focused. */
.sp-split { flex-direction: row; gap: 32px; max-width: 100%; }
.sp-left { flex: 1 1 52%; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sp-right {
  flex: 1 1 48%; min-width: 0; padding-left: 28px;
  border-left: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 8px; justify-content: flex-start;
}
.sp-detail-name { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--accent); }
.sp-detail-desc { font-size: 13px; line-height: 1.6; color: #cfd4dc; }
.sp-detail-meta { font-size: 12px; color: var(--text-dim); }

/* Ability chips: every live ability, tagged like the in-game Abilities tab (SIG / AUTO / AWK / ULT, same colours). */
.sp-ability-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.sp-ability-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: #e8e8ea; padding: 7px 11px; border: 1px solid #262b36; border-radius: 8px;
  background: rgba(10, 11, 16, 0.45); cursor: pointer; outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.sp-ability-item:hover, .sp-ability-item:focus-visible, .sp-ability-item.active {
  border-color: var(--accent); background: rgba(125, 211, 200, 0.1);
}
.sp-ability-tag { font-size: 9px; font-weight: 800; letter-spacing: 0.06em; }
.sp-tier-basic { color: #a8a8a8; }
.sp-tier-auto { color: #7fc8c8; }
.sp-tier-awakened { color: #b48cff; }
.sp-tier-ultimate { color: #e8c547; }

/* Field / Value rows, as the ability reference lays them out. */
.sp-fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin-top: 4px; }
.sp-field-key { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); padding-top: 2px; }
.sp-field-val { font-size: 13px; line-height: 1.55; color: #cfd4dc; }
.sp-field-val strong, .sp-detail-desc strong { color: #f0f2f5; font-weight: 700; }

/* Inside the Game: screenshot gallery + lightbox */
.gallery { padding: 88px 0 24px; outline: none; }
.gallery:focus-visible .gallery-frame { border-color: var(--accent); }
.gallery-frame {
  display: block; width: 100%; aspect-ratio: 16/9; max-height: 640px; padding: 0; margin: 0;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--panel); cursor: zoom-in;
}
.gallery-frame img { width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity 0.25s ease; }
.gallery-caption { margin-top: 14px; text-align: center; min-height: 24px; font-size: 16px; font-weight: 600; line-height: 1.5; color: #e8ebf0; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 16px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb {
  flex: 0 0 140px; height: 79px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); opacity: 0.6; transition: opacity 0.2s ease, border-color 0.2s ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Centred, but auto margins (not justify-content: center) so a strip wider than the screen still scrolls from its first thumb. */
.gallery-thumb:first-child { margin-left: auto; }
.gallery-thumb:last-child { margin-right: auto; }
.gallery-thumb:hover, .gallery-thumb:focus-visible { opacity: 0.9; }
.gallery-thumb.active { opacity: 1; border-color: var(--accent); }

.lightbox {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 56px 24px 24px; background: rgba(5,6,9,0.92);
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); }
.lightbox-close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(20,23,30,0.8); border: 1px solid var(--border); color: #eef1f5;
}
.lightbox-close:hover, .lightbox-close:focus-visible { border-color: var(--accent); color: var(--accent); }
body.no-scroll { overflow: hidden; }

/* Access */
.access { padding: 88px 24px 40px; display: flex; justify-content: center; }
.access-card {
  width: 100%; max-width: 560px;
  border: 1px solid #262b36; background: var(--panel); border-radius: 20px;
  padding: 44px 40px; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6);
}
.access-title { font-family: var(--display); font-size: 24px; font-weight: 600; color: #f4f2ea; margin-bottom: 10px; text-align: center; }
.access-sub { font-size: 14px; line-height: 1.6; color: var(--text-dim); text-align: center; margin-bottom: 24px; }
#signupForm { display: flex; flex-direction: column; gap: 12px; }
#emailInput {
  width: 100%; background: var(--panel-2); border: 1px solid #262b36; border-radius: 10px;
  padding: 14px 16px; font-size: 15px; color: var(--text); font-family: 'Manrope', sans-serif;
}
#emailInput:focus { outline: none; border-color: var(--accent); }
.access-fine { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 18px; }
.access-error { text-align: center; font-size: 13px; color: #e0607a; margin-top: 10px; min-height: 18px; }
.check-badge {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(125,211,200,0.15);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.hidden { display: none; }

/* Honeypot: off-screen, not display:none/visibility:hidden, since some bots skip fields hidden that way. */
.hp-field { position: absolute; left: -5000px; top: -5000px; width: 1px; height: 1px; overflow: hidden; }

.consent-row {
  display: flex; align-items: flex-start; gap: 10px; margin: 14px 0;
  font-size: 13px; line-height: 1.4; color: var(--text-dim); cursor: pointer;
}
.consent-row input[type="checkbox"] { flex: 0 0 auto; margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); }

.cf-turnstile { margin: 14px 0; }

/* Footer */
.footer { padding: 24px 0 40px; border-top: 1px solid #171a21; margin-top: 24px; }
.footer-inner { font-size: 12px; color: var(--text-faint); }

@media (max-width: 900px) {
  .power-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .power-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reel-caption { left: 16px; right: 16px; bottom: 14px; gap: 2px; }
  .reel-name { font-size: 20px; }
  .reel-line { display: none; }
  .reel-arrow { top: 14px; transform: none; width: 36px; height: 36px; }
  .reel-prev { left: auto; right: 58px; }
  .reel-next { right: 14px; }
  .gallery-thumb { flex-basis: 104px; height: 59px; }
  .access-card { padding: 32px 22px; }
  .sp-split { flex-direction: column; gap: 16px; }
  .sp-right { padding-left: 0; padding-top: 16px; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
}
