/* ============================================================
   Tales of Pirates — Shared Stylesheet
   Stack: pure CSS3, mobile-first, no frameworks
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --bg-deep:   #050C1A;
  --bg-dark:   #0A1A30;
  --bg-card:   #0D2241;
  --bg-card2:  #0F2B52;
  --gold:      #C8921A;
  --gold-lt:   #E8B840;
  --gold-grad: linear-gradient(135deg, #C8921A 0%, #F0CC50 100%);
  --teal:      #1B7A8E;
  --teal-lt:   #22A0BC;
  --text:      #EEF2F7;
  --muted:     #7A9BB5;
  --border:    rgba(200, 146, 26, 0.25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  --radius:    12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
  --header-h:  70px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a  { color: var(--gold-lt); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }
ul { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}
.section-title span { color: var(--gold-lt); }
.section-desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section {
  padding: 5rem 0;
}
.section--alt { background: var(--bg-dark); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); opacity: 0.92; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gold-grad);
  color: #0A1020;
  box-shadow: 0 4px 20px rgba(200,146,26,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(200,146,26,0.6); color: #0A1020; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(238,242,247,0.35);
}
.btn-outline:hover { border-color: var(--gold-lt); color: var(--gold-lt); }

.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(5, 12, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}
.header__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.header__logo img {
  height: 38px;
  width: auto;
}
.header__logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.header__logo-text span { color: var(--gold-lt); }

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.lang-switcher a {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
}
.lang-switcher a:hover,
.lang-switcher a.active {
  color: var(--gold-lt);
  background: rgba(200,146,26,0.12);
}
.lang-switcher a.active { pointer-events: none; }

/* Mobile menu toggle */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  flex-direction: column;
  gap: 5px;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(5,12,26,0.88) 0%,
    rgba(5,12,26,0.65) 50%,
    rgba(5,12,26,0.82) 100%
  );
  z-index: 1;
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 4rem 0 3rem;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(200,146,26,0.12);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-lt);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.hero__eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 1.2rem;
  max-width: 720px;
}
.hero h1 .highlight { color: var(--gold-lt); }
.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  max-width: 580px;
  margin-bottom: 2rem;
}
.hero__platforms {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.platform-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}
.platform-badge svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Stats bar ---------- */
.stats-bar {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}
.stat-item__num {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-item__label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  pointer-events: none;
}
.about-img-wrap img { width: 100%; }
.about__text h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 1rem; }
.about__text h2 span { color: var(--gold-lt); }
.about__text p { color: var(--muted); margin-bottom: 1rem; }
.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.tag {
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(200,146,26,0.1);
  border: 1px solid var(--border);
  color: var(--gold-lt);
}

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(200,146,26,0.5);
}
.feature-card__icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.feature-card p { font-size: 0.9rem; color: var(--muted); }

/* ---------- Classes ---------- */
.classes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.class-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.class-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.class-card__img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.class-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.class-card:hover .class-card__img img { transform: scale(1.06); }
.class-card__img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(0deg, rgba(5,12,26,0.85) 0%, transparent 100%);
}
.class-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.class-card__role {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.class-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.class-card p { font-size: 0.88rem; color: var(--muted); }

/* ---------- Video section ---------- */
.video-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
}
.video-wrap video,
.video-wrap iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Screenshots ---------- */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.screenshot-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.screenshot-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}
.screenshot-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* ---------- How to Play (Steps) ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  counter-reset: steps;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  counter-increment: steps;
}
.step-card::before {
  content: counter(steps);
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  background: var(--gold-grad);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0A1020;
  margin-top: -18px;
}
.step-card__icon { font-size: 2rem; margin-bottom: 1rem; }
.step-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.step-card p { font-size: 0.88rem; color: var(--muted); }

/* ---------- Mobile section ---------- */
.mobile-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.mobile-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 0.6rem 1.25rem;
  transition: border-color var(--transition), background var(--transition);
}
.dl-badge:hover {
  border-color: var(--gold);
  background: rgba(200,146,26,0.08);
  color: var(--text);
}
.dl-badge svg { width: 24px; height: 24px; fill: var(--text); flex-shrink: 0; }
.dl-badge__text { line-height: 1.2; }
.dl-badge__sub { font-size: 0.7rem; color: var(--muted); display: block; }
.dl-badge__name { font-size: 1rem; font-weight: 700; color: var(--text); display: block; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition);
}
.faq-q:hover { color: var(--gold-lt); }
.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(200,146,26,0.1);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform var(--transition), background var(--transition);
  color: var(--gold-lt);
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: rgba(200,146,26,0.2);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding var(--transition);
}
.faq-a p {
  padding-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 400px; }

/* ---------- CTA section ---------- */
.cta-section {
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(200,146,26,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.cta-section h2 span { color: var(--gold-lt); }
.cta-section p { color: var(--muted); margin-bottom: 2rem; font-size: 1.05rem; }
.cta-section .btn-group { justify-content: center; }

/* ---------- Trust badges ---------- */
.trust-bar {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.trust-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.trust-item svg { width: 18px; height: 18px; fill: var(--gold); }

/* ---------- Footer ---------- */
.footer {
  background: #030810;
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer__brand img { height: 36px; margin-bottom: 0.75rem; }
.footer__brand p { font-size: 0.88rem; color: var(--muted); max-width: 300px; }
.footer__col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer__col li { margin-bottom: 0.5rem; }
.footer__col a { font-size: 0.9rem; color: var(--muted); }
.footer__col a:hover { color: var(--gold-lt); }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer__social {
  display: flex;
  gap: 0.75rem;
}
.footer__social a {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.footer__social a:hover {
  background: rgba(200,146,26,0.12);
  color: var(--gold-lt);
  border-color: var(--border);
}

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features-grid,
  .classes-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .nav { display: none; }
  .burger { display: flex; }

  .nav--open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(5,12,26,0.98);
    backdrop-filter: blur(16px);
    padding: 1rem 1.25rem 2rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav--open a { padding: 0.75rem 1rem; font-size: 1rem; }

  .hero { min-height: 80vh; }
  .hero h1 { font-size: 2rem; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); }

  .about-grid,
  .mobile-section-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-img-wrap { order: -1; }

  .features-grid { grid-template-columns: 1fr; }
  .classes-grid  { grid-template-columns: repeat(2, 1fr); }
  .steps-grid    { grid-template-columns: 1fr; }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }

  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; text-align: center; }

  .trust-grid { gap: 1.25rem; }

  .section { padding: 3.5rem 0; }
}

@media (max-width: 480px) {
  .classes-grid { grid-template-columns: 1fr; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero h1 { font-size: 1.75rem; }
  .btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
  .btn-group { flex-direction: column; align-items: stretch; }
  .btn-group .btn { justify-content: center; }
}
