/* ═══════════════════════════════════════════════════════════════
   ROYAL NAVY — STYLESHEET
   Paleta "Dia de Sol no Mar": céu azul, mar turquesa, sol dourado,
   espuma branca, coral (boia) e areia.
   ═══════════════════════════════════════════════════════════════ */

/* ── CUSTOM PROPERTIES ─────────────────────────────────────── */
:root {
  /* Céu */
  --sky-50:   #f3fbff;
  --sky-100:  #e3f4fd;
  --sky-200:  #c4e6f9;
  --sky-300:  #92d2f3;
  --sky-400:  #57b8ea;
  --sky-500:  #2a9bdc;
  --sky-600:  #1a7dbb;

  /* Azul-marinho (texto, rodapé) */
  --navy-900: #0a2a4a;
  --navy-800: #0f3a63;
  --navy-700: #164a7c;
  --navy-600: #1f5d96;

  /* Mar turquesa */
  --sea-300:  #6fe3d8;
  --sea-400:  #2ec9c2;
  --sea-500:  #0fa9b1;
  --sea-600:  #0a8795;
  --sea-700:  #076a78;

  /* Sol */
  --sun-100:  #fff7d9;
  --sun-200:  #ffec9f;
  --sun-300:  #ffdb5c;
  --sun-400:  #ffc62e;
  --sun-500:  #f9a71a;
  --sun-600:  #e58a0b;
  --sun-700:  #b96500;
  --sun-800:  #a35700;

  /* Coral (boia) e areia */
  --coral-400: #ff8060;
  --coral-500: #f2593a;
  --sand-50:  #fffdf6;
  --sand-100: #fdf3dc;

  --white: #ffffff;

  /* Aparência dos quadros 3D enquanto o WebGL ainda não desenhou */
  --scene-bg: linear-gradient(180deg, #3d9fe4 0%, #86cdf3 26%, #cdeefb 38%, #1fb0c8 42%, #0e8aa8 100%);

  --text-primary:   var(--navy-900);
  --text-secondary: #3b5673;
  --text-muted:     #5b7590;
  --on-dark:           #ffffff;
  --on-dark-secondary: rgba(255, 255, 255, 0.86);
  --on-dark-muted:     rgba(255, 255, 255, 0.64);

  --grad-sun:   linear-gradient(135deg, #fff1a8 0%, #ffd23f 45%, #ffab1f 100%);
  --grad-sea:   linear-gradient(135deg, var(--sea-400) 0%, var(--sky-500) 100%);
  --grad-card:  linear-gradient(160deg, #ffffff 0%, var(--sky-50) 100%);

  --border-soft: 1px solid rgba(26, 125, 187, 0.16);
  --border-sun:  1px solid rgba(229, 138, 11, 0.42);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --shadow-card:  0 10px 28px -10px rgba(15, 74, 120, 0.24), 0 2px 6px rgba(15, 74, 120, 0.07);
  --shadow-hover: 0 22px 44px -14px rgba(15, 74, 120, 0.34), 0 4px 10px rgba(15, 74, 120, 0.1);
  --shadow-xl:    0 30px 80px -20px rgba(10, 42, 74, 0.55);
  --glow-sun:     0 8px 28px -6px rgba(255, 171, 31, 0.65);

  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Onda usada como divisor entre seções (colorida via background) */
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 28C150 58 340 0 600 28S1050 58 1200 28V60H0Z'/%3E%3C/svg%3E");
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 70px;
  scrollbar-gutter: stable;     /* evita "pulo" de layout ao abrir/fechar o modal */
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--sky-50);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
canvas { display: block; }
button { font: inherit; }

::selection {
  background: var(--sun-300);
  color: var(--navy-900);
}

:focus-visible {
  outline: 3px solid var(--sun-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar       { width: 10px; }
::-webkit-scrollbar-track { background: var(--sky-100); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--sea-400), var(--sky-500));
  border-radius: 6px;
  border: 2px solid var(--sky-100);
}

/* ── TYPOGRAPHY UTILITIES ───────────────────────────────────── */
.section-tag {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--sun-800);
  padding: 0.3rem 1rem;
  border: var(--border-sun);
  border-radius: 100px;
  background: rgba(255, 198, 46, 0.18);
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.15;
  margin-bottom: 0.8rem;
}

.section-title .accent      { color: var(--sea-600); }
.section-title .accent-gold { color: var(--sun-300); }

.section-sub {
  font-size: 1.02rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  padding: 0 1rem 4rem;
  position: relative;
}

.section-header.light .section-title { color: var(--white); }
.section-header.light .section-sub   { color: var(--on-dark-secondary); }
.section-header.light .section-tag {
  color: var(--sun-200);
  border-color: rgba(255, 219, 92, 0.5);
  background: rgba(255, 219, 92, 0.14);
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.2rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}

.btn-primary {
  color: var(--navy-900);
  background: var(--grad-sun);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--glow-sun), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgba(255, 171, 31, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--navy-800);
  transform: translateY(-2px);
}

.btn-view-ship {
  width: 100%;
  padding: 0.7rem 1.2rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sea-700);
  background: rgba(15, 169, 177, 0.1);
  border: 1px solid rgba(10, 135, 149, 0.28);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn-view-ship:hover {
  background: var(--sea-600);
  border-color: var(--sea-600);
  color: var(--white);
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 2rem;
  height: 70px;
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(26, 125, 187, 0.14);
  box-shadow: 0 6px 24px -10px rgba(15, 74, 120, 0.3);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-anchor {
  font-size: 1.5rem;
  display: inline-block;
  transform-origin: 50% 15%;
  animation: anchorSway 4s ease-in-out infinite;
  will-change: transform;
}

@keyframes anchorSway {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}

.brand-text {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--white);
  text-shadow: 0 1px 10px rgba(10, 42, 74, 0.35);
  transition: color 0.35s var(--ease);
}

.navbar.scrolled .brand-text { color: var(--navy-800); text-shadow: none; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  padding: 0.4rem 0.9rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(10, 42, 74, 0.35);
  border-radius: var(--radius-sm);
  white-space: nowrap;           /* "Frota Atual" nunca quebra em duas linhas */
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0.9rem; right: 0.9rem;
  height: 3px;
  background: var(--grad-sun);
  border-radius: 3px;
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}

.nav-link:hover, .nav-link.active { color: var(--white); background: rgba(255, 255, 255, 0.16); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.navbar.scrolled .nav-link { color: var(--text-secondary); text-shadow: none; }
.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active { color: var(--navy-900); background: rgba(42, 155, 220, 0.12); }

.nav-badge {
  flex-shrink: 0;
  padding: 0.3rem 0.8rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--navy-900);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 100px;
  background: var(--grad-sun);
  box-shadow: 0 4px 14px -4px rgba(255, 171, 31, 0.7);
}

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* reserva espaço para a navbar (topo) e a barra de estatísticas (base):
     em telas baixas o conteúdo empurra a altura em vez de ficar escondido */
  padding: 5.5rem 0 7rem;
  background: linear-gradient(180deg, #1b7cc6 0%, #4aaee8 46%, #14a4c4 52%, #0a6f9d 100%);
}

#ocean-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Vinheta que garante contraste do texto sobre o céu/mar */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 48% at 50% 46%, rgba(8, 52, 96, 0.42) 0%, transparent 72%),
    linear-gradient(180deg, rgba(8, 52, 96, 0.25) 0%, transparent 22%);
}

/* Raios de sol estáticos (uma única pintura, sem animação) */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-conic-gradient(from 195deg at 78% 24%, rgba(255, 244, 190, 0.09) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle at 78% 24%, #000 0%, transparent 70%);
          mask-image: radial-gradient(circle at 78% 24%, #000 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
  max-width: 900px;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translate3d(0, 34px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.hero-subtitle-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--sun-200);
  text-shadow: 0 1px 10px rgba(8, 52, 96, 0.55);
  margin-bottom: 1.5rem;
  animation: heroFadeIn 1.2s var(--ease-out) 0.2s both;
}

.hero-subtitle-top .line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sun-300));
}

.hero-subtitle-top .line:last-child { background: linear-gradient(90deg, var(--sun-300), transparent); }

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(3.5rem, min(12vw, 17vh), 9rem);   /* também limitado pela altura da tela */
  font-weight: 900;
  line-height: 0.9;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.title-line-1 {
  color: var(--white);
  text-shadow: 0 4px 30px rgba(8, 52, 96, 0.45);
  animation: heroFadeIn 1s var(--ease-out) 0.4s both;
}

.title-line-2 {
  background: var(--grad-sun);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 16px rgba(8, 52, 96, 0.4));
  animation: heroFadeIn 1s var(--ease-out) 0.6s both;
}

.hero-desc {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 500;
  color: var(--white);
  text-shadow: 0 1px 14px rgba(8, 52, 96, 0.6);
  margin-bottom: 2.5rem;
  line-height: 1.7;
  animation: heroFadeIn 1s var(--ease-out) 0.8s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroFadeIn 1s var(--ease-out) 1s both;
}

/* Hero Stats Bar */
.hero-stats {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.4rem 2rem;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 -12px 40px -16px rgba(8, 52, 96, 0.4);
  animation: heroFadeIn 1s var(--ease-out) 1.2s both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 3rem;
  gap: 0.2rem;
}

.stat-number {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sun-800);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, transparent, rgba(26, 125, 187, 0.35), transparent);
  flex-shrink: 0;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 110px;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--on-dark-secondary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  transform: translateX(-50%);
  animation: fadeInUp 1s var(--ease-out) 1.5s both, bounce 2s ease-in-out 2.5s infinite;
}

.scroll-mouse {
  width: 22px; height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 11px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-wheel {
  width: 3px; height: 8px;
  background: var(--white);
  border-radius: 2px;
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(6px); opacity: 0.3; }
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   HISTORY / TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.history-section {
  padding: 8rem 2rem;
  background: linear-gradient(180deg, var(--sky-50) 0%, var(--sand-50) 100%);
  position: relative;
  overflow: hidden;
}

.timeline {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, transparent, var(--sky-300) 10%, var(--sea-400) 50%, var(--sky-300) 90%, transparent);
}

.timeline-item {
  display: flex;
  gap: 3rem;
  margin-bottom: 3.5rem;
  position: relative;
  align-items: flex-start;
}

.timeline-item.left  { flex-direction: row; padding-right: calc(50% + 2rem); }
.timeline-item.right { flex-direction: row-reverse; padding-left: calc(50% + 2rem); }

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 1.2rem;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  background: var(--sun-400);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 198, 46, 0.35);
  z-index: 1;
  transition: transform 0.3s var(--ease-out), background-color 0.3s var(--ease);
}

.timeline-item:hover .timeline-dot {
  transform: translate(-50%, -50%) scale(1.35);
  background: var(--coral-400);
}

.timeline-card {
  background: var(--white);
  border: var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.8rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sea-400), var(--sun-400));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.timeline-card:hover {
  transform: translateY(-4px);
  border-color: rgba(42, 155, 220, 0.4);
  box-shadow: var(--shadow-hover);
}

.timeline-card:hover::before { opacity: 1; }

.timeline-year {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--sun-700);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.timeline-card h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--navy-800);
  margin-bottom: 0.6rem;
}

.timeline-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   SHIPS SECTION
   ═══════════════════════════════════════════════════════════════ */
.ships-section {
  padding: 8rem 2rem;
  background: linear-gradient(180deg, var(--sand-50) 0%, var(--sky-100) 100%);
  position: relative;
}

.ships-filter {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1.4rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-700);
  background: var(--white);
  border: 1px solid var(--sky-300);
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.filter-btn:hover {
  background: var(--sky-100);
  border-color: var(--sky-500);
  transform: translateY(-1px);
}

.filter-btn.active {
  color: var(--white);
  background: var(--grad-sea);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(10, 135, 149, 0.7);
}

.ships-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Ship Cards */
.ship-card {
  background: var(--white);
  border: var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
              border-color 0.3s var(--ease), opacity 0.35s var(--ease);
  position: relative;
}

.ship-card:hover {
  transform: translateY(-8px);
  border-color: rgba(42, 155, 220, 0.45);
  box-shadow: var(--shadow-hover);
}

.ship-card.is-dimmed {
  opacity: 0.28;
  transform: scale(0.965);
  pointer-events: none;
}

.ship-3d-wrapper {
  position: relative;
  height: 220px;
  background: var(--scene-bg);
  overflow: hidden;
}

.ship-3d-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.9));
  pointer-events: none;
}

/* Canvases ocupam o wrapper sem afetar o layout (evita laços de resize) */
.ship-canvas, .gallery-canvas, #fleet-canvas, #modal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.is-dragging { cursor: grabbing !important; }

/* Sem WebGL: o gradiente do wrapper vira o "modelo" e o selo 3D some */
.no-webgl .ship-3d-label,
.no-webgl .fleet-canvas-label { display: none; }

.ship-3d-label {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  z-index: 2;
  padding: 0.25rem 0.6rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--sea-700);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(10, 135, 149, 0.25);
  border-radius: 4px;
  pointer-events: none;
}

.ship-card-body { padding: 1.4rem 1.6rem 1.6rem; cursor: pointer; }

.ship-class {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sea-700);
  margin-bottom: 0.4rem;
}

.ship-name {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 0.8rem;
  line-height: 1.2;
}

.ship-stats-mini {
  display: flex;
  gap: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.ship-stats-mini span { font-weight: 700; color: var(--sun-700); }

/* ═══════════════════════════════════════════════════════════════
   BATTLES SECTION — mar profundo iluminado pelo sol
   ═══════════════════════════════════════════════════════════════ */
.battles-section {
  padding: 10rem 2rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #0e4d86 0%, #0a6aa0 45%, #0a8a9c 100%);
}

.battles-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 219, 92, 0.34), transparent 42%),
    radial-gradient(ellipse at 8% 92%, rgba(111, 227, 216, 0.24), transparent 55%);
  pointer-events: none;
}

/* Divisores em onda (topo e base) */
.battles-section::before,
.battles-section::after,
.footer::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  pointer-events: none;
  -webkit-mask: var(--wave-mask) center / 100% 100% no-repeat;
          mask: var(--wave-mask) center / 100% 100% no-repeat;
}

.battles-section::before { top: -1px;    background: var(--sky-100); transform: scaleY(-1); }
.battles-section::after  { bottom: -1px; background: var(--sky-50); }

.battles-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  position: relative;
}

.battle-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.3s var(--ease-out), background-color 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
  color: var(--sun-200);       /* glifos de texto (⚔ ⚓) herdam esta cor */
}

.battle-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sky-300), transparent);
  transition: opacity 0.3s var(--ease);
}

.battle-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sun-300), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.battle-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 219, 92, 0.55);
  box-shadow: 0 24px 44px -18px rgba(4, 30, 56, 0.6);
}

.battle-card:hover::after { opacity: 1; }

.battle-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 0.15rem 2.5rem;
  align-items: start;
  background: linear-gradient(135deg, rgba(255, 219, 92, 0.2) 0%, rgba(255, 255, 255, 0.09) 100%);
  border-color: rgba(255, 219, 92, 0.5);
}

/* Posições explícitas: sem elas a coluna "auto" crescia com o texto e
   empurrava o título e o selo para o canto direito */
.battle-card.featured .battle-year   { grid-column: 1; grid-row: 1 / 5; align-self: center; }
.battle-card.featured .battle-icon   { grid-column: 2; grid-row: 1; }
.battle-card.featured h3             { grid-column: 2; grid-row: 2; }
.battle-card.featured p              { grid-column: 2; grid-row: 3; }
.battle-card.featured .battle-result { grid-column: 2; grid-row: 4; justify-self: start; }

.battle-card.featured::before { background: var(--grad-sun); }

.battle-card.featured .battle-year { font-size: 4rem; }

.battle-year {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--sun-300);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 14px rgba(4, 30, 56, 0.35);
}

.battle-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  display: block;
}

.battle-card.featured .battle-icon { font-size: 2.5rem; }

.battle-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.8rem;
}

.battle-card.featured h3 { font-size: 1.8rem; }

.battle-card p {
  font-size: 0.92rem;
  color: var(--on-dark-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.battle-result {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-900);
  background: var(--sun-300);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   FLEET SECTION
   ═══════════════════════════════════════════════════════════════ */
.fleet-section {
  padding: 8rem 2rem;
  background: linear-gradient(180deg, var(--sky-50) 0%, var(--white) 100%);
}

.fleet-overview {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.fleet-3d-display {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--scene-bg);
  border: 4px solid var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.fleet-canvas-label {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  white-space: nowrap;
  color: var(--sea-700);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.3rem 1rem;
  border: 1px solid rgba(10, 135, 149, 0.22);
  border-radius: 100px;
  pointer-events: none;
}

.fleet-categories { display: flex; flex-direction: column; gap: 1rem; }

.fleet-cat {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
  background: var(--white);
  border: var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease);
  cursor: default;
}

.fleet-cat:hover {
  border-color: rgba(42, 155, 220, 0.45);
  box-shadow: var(--shadow-hover);
  transform: translateX(6px);
}

.fleet-cat-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--sky-100);
  border: var(--border-soft);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.fleet-cat-info { flex: 1; }

.fleet-cat-info h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy-800);
  margin-bottom: 0.2rem;
}

.fleet-cat-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.55rem;
}

.fleet-bar {
  height: 6px;
  background: var(--sky-100);
  border-radius: 3px;
  overflow: hidden;
}

/* A largura é animada com transform (compositor) usando --fill (0 a 1) */
.fleet-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--sea-400), var(--sky-500));
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.3s var(--ease-out);
}

/* Largura de cada barra: atributo data-fill no HTML (a CSP nao permite style="" inline) */
.fleet-bar-fill[data-fill="1"] { --fill: 1; }
.fleet-bar-fill[data-fill="0.9"] { --fill: 0.9; }
.fleet-bar-fill[data-fill="0.8"] { --fill: 0.8; }
.fleet-bar-fill[data-fill="0.75"] { --fill: 0.75; }
.fleet-bar-fill[data-fill="0.6"] { --fill: 0.6; }
.fleet-bar-fill[data-fill="0.4"] { --fill: 0.4; }
.fleet-categories.is-visible .fleet-bar-fill { transform: scaleX(var(--fill, 1)); }
.fleet-categories.is-visible .fleet-cat:nth-child(2) .fleet-bar-fill { transition-delay: 0.08s; }
.fleet-categories.is-visible .fleet-cat:nth-child(3) .fleet-bar-fill { transition-delay: 0.16s; }
.fleet-categories.is-visible .fleet-cat:nth-child(4) .fleet-bar-fill { transition-delay: 0.24s; }
.fleet-categories.is-visible .fleet-cat:nth-child(5) .fleet-bar-fill { transition-delay: 0.32s; }
.fleet-categories.is-visible .fleet-cat:nth-child(6) .fleet-bar-fill { transition-delay: 0.4s; }

.fleet-count {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sun-700);
  min-width: 44px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   GALLERY
   ═══════════════════════════════════════════════════════════════ */
.gallery-section {
  padding: 8rem 2rem;
  background: linear-gradient(180deg, var(--white) 0%, var(--sky-200) 100%);
}

.gallery-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 280px 280px;
  gap: 1rem;
}

.gallery-item {
  position: relative;
  background: var(--scene-bg);
  border: 3px solid var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.gallery-item.large { grid-row: 1 / 3; }

.gallery-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.gallery-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 1.6rem 1.2rem 0.8rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--white);
  background: linear-gradient(180deg, transparent, rgba(8, 52, 96, 0.72));
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  position: relative;
  background: var(--navy-900);
  padding: 6.5rem 2rem 0;
}

.footer::before { top: -1px; background: var(--sky-200); transform: scaleY(-1); }

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.footer-anchor { font-size: 2.5rem; }

.footer-title {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--white);
  margin-bottom: 0.3rem;
}

.footer-tagline {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--sun-300);
  letter-spacing: 0.08em;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col h5 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sun-300);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.5rem;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.footer-col a:hover { color: var(--white); transform: translateX(4px); }

.footer-about {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   SHIP MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 42, 74, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s var(--ease), visibility 0s;
}

.modal-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);   /* a linha respeita o max-height e o painel direito rola */
  position: relative;
  box-shadow: var(--shadow-xl);
  transform: scale(0.97) translate3d(0, 16px, 0);
  transition: transform 0.4s var(--ease-out);
}

.modal-overlay.open .modal-container { transform: none; }

.modal-close {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  z-index: 10;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid rgba(26, 125, 187, 0.25);
  border-radius: 50%;
  color: var(--navy-800);
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(10, 42, 74, 0.35);
  transition: transform 0.3s var(--ease-out), background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.modal-close:hover {
  background: var(--coral-500);
  border-color: var(--coral-500);
  color: var(--white);
  transform: rotate(90deg);
}

.modal-left {
  position: relative;
  background: var(--scene-bg);
  display: flex;
  flex-direction: column;
}

.modal-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 380px;
}

.modal-canvas-controls {
  padding: 0.8rem;
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--navy-800);
  background: rgba(255, 255, 255, 0.72);
}

.modal-right {
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overscroll-behavior: contain;
}

.modal-right::-webkit-scrollbar       { width: 6px; }
.modal-right::-webkit-scrollbar-thumb { background: var(--sky-300); border-radius: 3px; border: 0; }

.modal-class {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sea-700);
}

.modal-name {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.15;
}

.modal-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-specs h4,
.modal-armament h4,
.modal-history h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sun-800);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--sun-200);
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.spec-item {
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.spec-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.spec-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy-900);
}

.modal-armament ul { display: flex; flex-direction: column; gap: 0.4rem; }

.modal-armament li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.5;
}

.modal-armament li::before {
  content: '◆';
  color: var(--sun-500);
  font-size: 0.6rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.modal-history p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS & UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* Revelação ao rolar. As classes são REMOVIDAS pelo JS ao final da
   transição, para não competir com os estilos de hover dos cards. */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.7s var(--ease-out) var(--reveal-delay, 0s),
              transform 0.7s var(--ease-out) var(--reveal-delay, 0s);
}
.reveal--left  { transform: translate3d(-32px, 0, 0); }
.reveal--right { transform: translate3d(32px, 0, 0); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Brilho do sol que segue o cursor (só em dispositivos com mouse) */
.sun-glow {
  position: fixed;
  top: 0; left: 0;
  width: 320px; height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1500;
  background: radial-gradient(circle, rgba(255, 214, 80, 0.2) 0%, transparent 68%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  will-change: transform;
}
.sun-glow.is-on { opacity: 1; }

/* Número do contador */
.counting { animation: numberPop 0.35s var(--ease-out); }
@keyframes numberPop {
  0%   { transform: scale(1.25); color: var(--sun-600); }
  100% { transform: scale(1);    color: var(--navy-800); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-height: 820px) {
  .scroll-indicator { display: none; }
}

@media (max-width: 1100px) {
  .fleet-overview       { grid-template-columns: 1fr; }
  .battles-grid         { grid-template-columns: 1fr 1fr; }
  .battle-card.featured { grid-column: 1 / -1; }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    grid-auto-rows: 260px;
  }
  .gallery-item.large { grid-column: 1 / -1; grid-row: auto; min-height: 340px; }

  .modal-container { grid-template-columns: 1fr; grid-template-rows: auto; max-height: 88vh; overflow-y: auto; }
  .modal-left      { min-height: 300px; }
  .modal-canvas-wrap { min-height: 260px; }
}

@media (max-width: 768px) {
  .navbar    { padding: 0 1rem; }
  .nav-links { display: none; }
  .nav-badge { display: none; }

  .hero-stats { flex-wrap: wrap; gap: 1rem; padding: 1rem; }
  .stat-item  { padding: 0 1.2rem; }
  .stat-divider { display: none; }

  .timeline::before { left: 24px; }
  .timeline-item.left,
  .timeline-item.right { padding: 0 0 0 4rem; flex-direction: row; }
  .timeline-dot { left: 24px; }

  .ships-grid   { grid-template-columns: 1fr; }
  .battles-grid { grid-template-columns: 1fr; }
  .battle-card.featured { grid-template-columns: 1fr; }
  .battle-card.featured .battle-year,
  .battle-card.featured .battle-icon,
  .battle-card.featured h3,
  .battle-card.featured p,
  .battle-card.featured .battle-result { grid-column: 1; grid-row: auto; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-links { grid-template-columns: 1fr 1fr; }

  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.large { min-height: 280px; }
}

@media (max-width: 480px) {
  .hero-title   { font-size: clamp(3rem, 15vw, 4.5rem); }
  .hero-cta     { flex-direction: column; align-items: center; }
  .footer-links { grid-template-columns: 1fr; }
  .specs-grid   { grid-template-columns: 1fr; }
}

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   BOTÃO DE TEMA (claro / escuro) — canto superior direito
   ═══════════════════════════════════════════════════════════════ */
.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: -1.4rem;              /* aproxima do selo "Since 1546" */
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.95);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(10, 42, 74, 0.35);
  transition: color 0.35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.navbar.scrolled .theme-toggle { color: var(--text-secondary); text-shadow: none; }

.theme-toggle__track {
  position: relative;
  width: 64px;
  height: 32px;
  border-radius: 100px;
  background: linear-gradient(135deg, #57b8ea 0%, #2a9bdc 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 14px -4px rgba(10, 42, 74, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
  transition: background 0.6s var(--ease), border-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

/* "Estrelas" que surgem no trilho no modo escuro */
.theme-toggle__track::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 22% 30%, #fff 0 1px, transparent 1.6px),
    radial-gradient(circle at 40% 72%, #cfe3ff 0 1px, transparent 1.6px),
    radial-gradient(circle at 58% 24%, #fff 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 30% 55%, #ffd9a8 0 0.8px, transparent 1.4px);
  transition: opacity 0.6s var(--ease);
}

.theme-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fffbe0, #ffd85e);
  color: #c56a00;
  box-shadow: 0 2px 8px rgba(10, 42, 74, 0.45);
  transition: transform 0.6s var(--ease-out), background 0.6s var(--ease), color 0.6s var(--ease);
}

.theme-toggle__icon {
  position: absolute;
  inset: 4px;
  width: 16px;
  height: 16px;
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease-out);
}

.theme-toggle__icon--moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }

.theme-toggle[aria-checked="true"] .theme-toggle__knob {
  transform: translateX(32px);
  background: linear-gradient(135deg, #e9f1ff, #b9cdee);
  color: #22406b;
}
.theme-toggle[aria-checked="true"] .theme-toggle__icon--sun  { opacity: 0; transform: rotate(60deg) scale(0.6); }
.theme-toggle[aria-checked="true"] .theme-toggle__icon--moon { opacity: 1; transform: none; }

.theme-toggle[aria-checked="true"] .theme-toggle__track {
  background: linear-gradient(135deg, #0b1c33 0%, #050b14 100%);
  border-color: rgba(255, 138, 61, 0.7);
  box-shadow: 0 0 16px -2px rgba(255, 106, 31, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.theme-toggle[aria-checked="true"] .theme-toggle__track::before { opacity: 1; }

.theme-toggle:focus-visible { outline: 3px solid var(--sun-500); outline-offset: 4px; border-radius: 100px; }

/* ═══════════════════════════════════════════════════════════════
   TRANSIÇÃO ENTRE TEMAS (View Transitions API + cortina de reserva)
   ═══════════════════════════════════════════════════════════════ */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

.theme-veil {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   ELEMENTOS EXCLUSIVOS DE UM TEMA — ocultos por padrão
   (o visual deles fica em dark.css e light.css)
   ═══════════════════════════════════════════════════════════════ */
.deep-canvas, .depth-gauge, .abyss-band { display: none; }
.calm-canvas, .calm-gauge, .calm-band { display: none; }

/* Barra em telas médias (769–1280 px): os 7 links, a marca e o botão de tema precisam caber
   numa linha só; antes o selo "Since 1546" e o botão de tema eram empurrados para fora da tela
   (a barra completa, com selo e rótulo do botão, só cabe a partir de ~1260 px). */
@media (max-width: 1280px) {
  .theme-toggle__label { display: none; }
  .navbar      { padding: 0 1.25rem; }
  .nav-inner   { gap: 1rem; }
  .nav-badge   { display: none; }
  .nav-links   { gap: 0; min-width: 0; justify-content: center; }
  .nav-link    { padding: 0.4rem 0.55rem; letter-spacing: 0.05em; }
  .nav-link::after { left: 0.55rem; right: 0.55rem; }
  .theme-toggle { margin-left: 0; }
}
@media (max-width: 960px) {
  .brand-text  { font-size: 0.95rem; letter-spacing: 0.1em; }
  .nav-link    { padding: 0.4rem 0.3rem; font-size: 0.82rem; letter-spacing: 0.03em; }
  .nav-link::after { left: 0.3rem; right: 0.3rem; }
}
@media (max-width: 820px) {
  .nav-links { gap: 0; }
  .nav-link  { padding: 0.4rem 0.2rem; letter-spacing: 0; }
  .nav-link::after { left: 0.2rem; right: 0.2rem; }
}
@media (max-width: 768px)  { .theme-toggle { margin-left: auto; } }

/* ═══════════════════════════════════════════════════════════════
   CONSULTA DE NAVIOS (v3.0) — atalho de busca na barra
   Só aparece em telas estreitas, onde o menu de links some.
   ═══════════════════════════════════════════════════════════════ */
.nav-search { display: none; }
@media (max-width: 768px) {
  .nav-search {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-left: auto; flex-shrink: 0;
    color: #fff; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
  }
  .navbar.scrolled .nav-search { color: var(--navy-800); border-color: rgba(26, 125, 187, 0.3); background: var(--sky-100); }
  .nav-search svg { width: 20px; height: 20px; }
  .nav-inner { gap: 0.8rem; }                               /* o espaçamento de 3rem estouraria a barra estreita */
  .nav-search + .theme-toggle { margin-left: 0; }
}
