/* ReefCast.io — Deep Ocean Theme */
/* Bioluminescent design system: glassmorphism, cyan accents, dark abyss */

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

:root {
  --bg: #050B14;
  --bg-light: #111C26;
  --bg-dark: #030710;
  --primary: #00E5FF;
  --primary-light: #33EBFF;
  --primary-dark: #00B8D4;
  --primary-glow: rgba(0, 229, 255, 0.3);
  --secondary: #0077B6;
  --secondary-light: #0096D6;
  --text: #FFFFFF;
  --text-secondary: #8A9BA8;
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  --glass-bg: rgba(17, 28, 38, 0.65);
  --glass-border: rgba(0, 229, 255, 0.08);
  --glass-border-hover: rgba(0, 229, 255, 0.18);
  --surface: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
  --green: #10B981;
  --amber: #F59E0B;
  --blue: #60A5FA;
  --purple: #818CF8;
  --red: #EF4444;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: drift 20s ease-in-out infinite alternate;
}

.ambient-orb--cyan {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15), transparent 70%);
  top: -10%;
  right: -10%;
}

.ambient-orb--blue {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 119, 182, 0.12), transparent 70%);
  bottom: -5%;
  left: -8%;
  animation-delay: -8s;
  animation-duration: 25s;
}

.ambient-orb--purple {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.08), transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -14s;
  animation-duration: 30s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ---- Layout ---- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-light);
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(5, 11, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nav-logo-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-logo-glow {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.10), transparent 70%);
  animation: glow-pulse 4.8s ease-in-out infinite;
  pointer-events: none;
}

.nav-logo-spinner {
  width: 32px;
  height: 32px;
  animation: slow-spin 12s linear infinite;
}

.nav-logo {
  width: 32px;
  height: 32px;
  display: block;
  animation: breathe 4.8s ease-in-out infinite;
}

/* ---- Bioluminescent breathing — matches app BrandLogo ---- */
/* App: scale 0.94-1.06, opacity 0.75-1.0, 4.8s full cycle (2.4s up + 2.4s down) */
@keyframes breathe {
  0%, 100% {
    transform: scale(0.94);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* Hero animated logo — glow + slow rotation wrapper, breathing on image */
.hero-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 32px;
  width: 72px;
  height: 72px;
}

.hero-logo-glow {
  display: none;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

.hero-logo-spinner {
  width: 72px;
  height: 72px;
}

@keyframes slow-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-logo {
  width: 72px;
  height: 72px;
  display: block;
}

/* Wordmark with letter stagger — matches app AnimatedSplash */
.hero-wordmark {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-bottom: 12px;
}

.hero-wordmark .letter {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 300;
  letter-spacing: 4px;
  opacity: 0;
  transform: translateY(12px) scale(0.5);
  animation: letter-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Gradient colors matching app: soft blue → bright cyan (Reefcast only) */
.hero-wordmark .letter:nth-child(1)  { animation-delay: 0.3s; color: #5EB8FF; }
.hero-wordmark .letter:nth-child(2)  { animation-delay: 0.39s; color: #5CC0FF; }
.hero-wordmark .letter:nth-child(3)  { animation-delay: 0.48s; color: #5AC8FF; }
.hero-wordmark .letter:nth-child(4)  { animation-delay: 0.57s; color: #58D0FF; }
.hero-wordmark .letter:nth-child(5)  { animation-delay: 0.66s; color: #56D8FF; }
.hero-wordmark .letter:nth-child(6)  { animation-delay: 0.75s; color: #54E0FF; }
.hero-wordmark .letter:nth-child(7)  { animation-delay: 0.84s; color: #52E8FF; }
.hero-wordmark .letter:nth-child(8)  { animation-delay: 0.93s; color: #50EFFF; }

/* Suffix dot — the hinge between brand and domain */
.hero-wordmark .suffix-dot {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--primary);
  opacity: 0;
  transform: scale(0);
  animation: dot-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.3s forwards;
}

@keyframes dot-pop {
  0%   { opacity: 0; transform: scale(0); }
  50%  { opacity: 1; transform: scale(1.6); }
  100% { opacity: 0.6; transform: scale(1); }
}

/* Suffix "io" — arrives as a single unit, slides in from the right with a glow */
.hero-wordmark .suffix-io {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--primary);
  opacity: 0;
  transform: translateX(8px);
  animation: suffix-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.0);
}

@keyframes suffix-in {
  0%   { opacity: 0; transform: translateX(8px); text-shadow: 0 0 20px rgba(0, 229, 255, 0); }
  60%  { opacity: 1; transform: translateX(-1px); text-shadow: 0 0 24px rgba(0, 229, 255, 0.5); }
  100% { opacity: 0.85; transform: translateX(0); text-shadow: 0 0 12px rgba(0, 229, 255, 0.2); }
}

@keyframes letter-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.5);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tagline fade-in after wordmark + suffix settle */
.hero-tagline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: fade-up 0.6s ease-out 2.1s forwards;
  margin-bottom: 40px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.35;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 11, 20, 0.9) 0%,
    rgba(5, 11, 20, 0.3) 35%,
    rgba(5, 11, 20, 0.3) 65%,
    rgba(5, 11, 20, 1) 100%
  );
  z-index: 1;
}

.hero-content {
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 32px;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 200;
  letter-spacing: -3px;
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary), var(--secondary-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 300;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.25s;
}

.store-badge:hover {
  border-color: var(--glass-border-hover);
  background: rgba(17, 28, 38, 0.85);
  transform: translateY(-2px);
  color: var(--text);
}

.store-badge svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.store-badge .store-label {
  text-align: left;
  line-height: 1.2;
}

.store-badge .store-label small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

/* ---- Features ---- */
.features {
  padding: 100px 0 120px;
  position: relative;
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 60px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 32px 28px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border-hover), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-4px);
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 22px;
  position: relative;
}

.feature-icon--cyan {
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.08);
}

.feature-icon--blue {
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue);
  box-shadow: 0 0 24px rgba(96, 165, 250, 0.08);
}

.feature-icon--purple {
  background: rgba(129, 140, 248, 0.1);
  color: var(--purple);
  box-shadow: 0 0 24px rgba(129, 140, 248, 0.08);
}

.feature-icon--green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.08);
}

.feature-icon--amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.08);
}

.feature-icon--red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.08);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Data Sources strip ---- */
.sources {
  padding: 60px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.sources-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.sources-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px 48px;
}

.sources-list span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.2px;
}

/* ---- CTA Section ---- */
.cta-section {
  padding: 120px 0;
  text-align: center;
}

.cta-section .section-title {
  margin-bottom: 24px;
}

.cta-section .section-desc {
  margin: 0 auto 48px;
  text-align: center;
}

/* ---- Footer ---- */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border-light);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Legal pages (Privacy, Terms) ---- */
.legal-page {
  padding: 140px 0 100px;
}

.legal-page .container {
  max-width: 740px;
}

.legal-page h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 48px;
}

.legal-section {
  margin-bottom: 40px;
}

.legal-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary);
}

.legal-section p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin-bottom: 12px;
}

.legal-section li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
}

.legal-contact {
  margin-top: 48px;
  padding: 24px 28px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.legal-contact p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

.legal-contact a {
  color: var(--primary);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero {
    padding: 100px 20px 60px;
    min-height: auto;
  }

  .hero h1 {
    letter-spacing: -2px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .store-badge {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .nav-links {
    gap: 20px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .sources-list {
    gap: 16px 32px;
  }

  .section-desc {
    font-size: 16px;
  }

  .legal-page {
    padding: 120px 0 80px;
  }
}

@media (max-width: 480px) {
  .nav-brand {
    font-size: 17px;
  }

  .nav-links {
    gap: 14px;
  }

  .features-grid {
    gap: 12px;
  }

  .feature-card {
    padding: 24px 20px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Language toggle button ---- */
.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 4px 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  line-height: 1.6;
}
.lang-toggle:hover {
  border-color: var(--glass-border-hover);
}
/* Show/hide label based on current language */
.lang-toggle-dv { display: none; }
.lang-dv .lang-toggle-en { display: none; }
.lang-dv .lang-toggle-dv { display: inline; }

/* ---- Thaana / Dhivehi font ---- */
@font-face {
  font-family: 'Faruma';
  src: url('/fonts/Faruma.ttf') format('truetype');
  font-display: swap;
}

/* Dhivehi language overrides */
.lang-dv {
  font-family: 'Faruma', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Keep system font on brand elements — never Faruma */
.lang-dv .nav-brand,
.lang-dv .hero-wordmark,
.lang-dv .hero-tagline,
.lang-dv .footer-brand {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.lang-dv .hero h1,
.lang-dv .section-title,
.lang-dv .feature-card h3,
.lang-dv .legal-page h1 {
  letter-spacing: 0;
  font-weight: 400;
}

/* Thaana text reads RTL — keep LTR page layout (matches mobile app) */
.lang-dv [data-i18n],
.lang-dv [data-i18n-html] {
  direction: rtl;
  text-align: right;
}

/* Centered sections stay centered */
.lang-dv .hero [data-i18n],
.lang-dv .hero [data-i18n-html],
.lang-dv .cta-section [data-i18n],
.lang-dv .cta-section [data-i18n-html],
.lang-dv .sources [data-i18n] {
  text-align: center;
}

/* Don't RTL layout containers — only text direction */
.lang-dv .hero-cta,
.lang-dv .features-grid,
.lang-dv .sources-list,
.lang-dv .nav .container,
.lang-dv .footer .container {
  direction: ltr;
}

/* Font size boost for Thaana (same as mobile: +2px) */
.lang-dv .feature-card p,
.lang-dv .hero-subtitle,
.lang-dv .section-desc,
.lang-dv .legal-section p,
.lang-dv .legal-section li {
  font-size: calc(1em + 2px);
}
