/* ========================================================
   CDP IMMERSIVE FRONTEND
   MB Maritime Training System
   Zero rectangles. Zero AI aesthetic.
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Tokens --- */
:root {
  --font-main: 'Outfit', -apple-system, sans-serif;
  --font-data: 'JetBrains Mono', monospace;
  --white: #ffffff;
  --white-90: rgba(255,255,255,0.9);
  --white-70: rgba(255,255,255,0.7);
  --white-50: rgba(255,255,255,0.5);
  --white-30: rgba(255,255,255,0.3);
  --white-15: rgba(255,255,255,0.15);
  --white-08: rgba(255,255,255,0.08);
  --ocean-deep: #0a1628;
  --ocean-mid: #112240;
  --teal: #00d4aa;
  --amber: #f5a623;
  --transition: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  color: var(--white);
  background: var(--ocean-deep);
}

button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection {
  background: rgba(0, 212, 170, 0.3);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ============================
   HERO SCENE — Full viewport
   ============================ */
.hero-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  /* Gentle slow zoom animation */
  animation: heroZoom 30s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

/* Gradient overlay: dark at top and bottom for readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(6, 14, 28, 0.75) 0%,
      rgba(6, 14, 28, 0.35) 25%,
      rgba(6, 14, 28, 0.25) 45%,
      rgba(6, 14, 28, 0.35) 65%,
      rgba(6, 14, 28, 0.7) 85%,
      rgba(6, 14, 28, 0.92) 100%
    );
  z-index: 1;
}

/* --- Animated ocean waves at bottom --- */
.ocean-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  z-index: 2;
  pointer-events: none;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.wave path {
  fill: var(--ocean-deep);
}

.wave-1 {
  opacity: 0.3;
  animation: waveDrift 8s ease-in-out infinite;
}

.wave-2 {
  opacity: 0.5;
  animation: waveDrift 6s ease-in-out infinite reverse;
  bottom: -5px;
}

.wave-3 {
  opacity: 0.8;
  animation: waveDrift 10s ease-in-out infinite;
  bottom: -10px;
}

@keyframes waveDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-25%); }
}

/* --- Captain's real photo --- */
.captain-photo {
  position: absolute;
  bottom: 18%;
  left: 5%;
  width: 140px;
  height: 140px;
  z-index: 2;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  opacity: 0;
  animation: captainAppear 800ms cubic-bezier(0.16, 1, 0.3, 1) 600ms forwards;
}

@keyframes captainAppear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
  .captain-photo {
    width: 80px;
    height: 80px;
    bottom: auto;
    top: 70px;
    left: 16px;
  }
}

/* --- Mist canvas --- */
#mist-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ============================
   CONTENT LAYER — Over photo
   ============================ */
.content-layer {
  position: relative;
  z-index: 10;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Top bar --- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo-img {
  height: 42px;
  width: auto;
  filter: invert(1) brightness(2);
  mix-blend-mode: screen;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.brand-logo-img:hover {
  opacity: 1;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.clock {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 400;
  color: var(--white-70);
  letter-spacing: 1px;
}

.clock span {
  font-size: 9px;
  color: var(--white-30);
  margin-left: 4px;
}

.lang-btn {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--white-70);
  padding: 5px 10px;
  border: 1px solid var(--white-15);
  border-radius: 20px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.lang-btn:hover {
  background: var(--white-15);
  color: var(--white);
  border-color: var(--white-30);
}

/* --- Hero content (center) --- */
.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  margin-top: 0;
}

/* Hero title — MB Maritime */
.hero-title-main {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--white);
  line-height: 1.1;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
  opacity: 0;
  animation: fadeUp 800ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

/* Hero subtitle — DP Training Center */
.hero-title-sub {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--white-70);
  margin-top: 4px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.5);
  opacity: 0;
  animation: fadeUp 800ms cubic-bezier(0.16, 1, 0.3, 1) 400ms forwards;
}

/* Hero logo — SVG vetorial, sem fundo */
.hero-logo {
  height: clamp(70px, 12vw, 120px);
  width: auto;
  margin-top: 24px;
  opacity: 0;
  animation: fadeUp 800ms cubic-bezier(0.16, 1, 0.3, 1) 600ms forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================
   SIDE MENU — Cinematic vertical nav
   Inspired by AAA game menus / film credits
   No icons, no boxes, just typography and motion
   ============================ */
.side-menu {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 20;
  padding: 16px 20px 16px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 14, 28, 0.5), rgba(6, 14, 28, 0.3));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  cursor: pointer;
  position: relative;
  opacity: 0;
  animation: menuSlideIn 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.menu-item:nth-child(1) { animation-delay: 700ms; }
.menu-item:nth-child(2) { animation-delay: 820ms; }
.menu-item:nth-child(3) { animation-delay: 940ms; }
.menu-item:nth-child(4) { animation-delay: 1060ms; }
.menu-item:nth-child(5) { animation-delay: 1180ms; }

@keyframes menuSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.menu-line {
  display: block;
  width: 0;
  height: 1px;
  background: var(--white);
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.menu-item:hover .menu-line {
  width: 32px;
}

.menu-text {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-70);
  transition: color 300ms ease, letter-spacing 400ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.menu-item:hover .menu-text {
  color: var(--white);
  letter-spacing: 4px;
}

.menu-live {
  font-family: var(--font-data);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--teal);
  padding: 2px 6px;
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 2px;
  animation: livePulse 2.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Bottom status strip --- */
.bottom-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 24px;
  flex-shrink: 0;
  background: linear-gradient(180deg, transparent, rgba(10, 22, 40, 0.6));
}

.strip-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--white-30);
  letter-spacing: 0.3px;
}

.strip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.strip-dot.online { background: var(--teal); }
.strip-dot.warning { background: var(--amber); }

.strip-separator {
  width: 1px;
  height: 12px;
  background: var(--white-15);
}

.strip-trainees {
  color: var(--white-50);
  font-weight: 500;
}

/* ============================
   RESPONSIVE
   ============================ */

/* Tablet */
@media (max-width: 900px) {
  .side-menu {
    right: 24px;
  }

  .menu-text {
    font-size: 13px;
  }

  .hero-content {
    margin-top: -40px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .top-bar {
    padding: 12px 16px;
  }

  .brand-name { font-size: 13px; }
  .brand-sub { font-size: 9px; }
  .clock { font-size: 11px; }

  .hero-content {
    margin-top: -60px;
    align-items: flex-start;
    padding-left: 24px;
  }

  .hero-title {
    letter-spacing: -0.01em;
    text-align: left;
  }

  .hero-subtitle {
    letter-spacing: 3px;
    font-size: 0.85rem;
    text-align: left;
  }

  .side-menu {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 24px;
    padding: 0 24px 8px;
    justify-content: center;
  }

  .menu-item {
    padding: 8px 0;
  }

  .menu-text {
    font-size: 12px;
    letter-spacing: 1.5px;
  }

  .menu-line { display: none; }

  .bottom-strip {
    gap: 10px;
    padding: 10px 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .strip-item span:not(.strip-dot) {
    font-size: 9px;
  }
}

/* ============================
   REDUCED MOTION
   ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-photo { animation: none; }
  .wave { animation: none; }
  .status-pulse { animation: none; }
}
