/* GlassWater Website - Liquid Glass-Inspired Design */

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

:root {
  /* Water palette - from AppColors.swift */
  --color-cyan: rgb(0, 174, 240);
  --color-cyan-light: rgb(102, 217, 255);
  --color-blue: rgb(0, 122, 255);
  --gradient-water: linear-gradient(135deg, rgb(0, 191, 242), rgb(0, 122, 255));
  --gradient-water-vertical: linear-gradient(180deg, rgb(0, 191, 242), rgb(0, 122, 255));

  /* Backgrounds */
  --bg-body: #f5f5f7;
  --bg-hero: linear-gradient(160deg, #e8f4fd 0%, #d1ecfa 30%, #c4e6f7 60%, #dae8f0 100%);
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --bg-glass-border: rgba(0, 0, 0, 0.08);
  --bg-glass-shadow: rgba(0, 44, 88, 0.08);

  /* Text */
  --text-primary: #1a1a1e;
  --text-secondary: #58585a;
  --text-tertiary: #8e8e93;
  --text-on-gradient: #fff;

  /* Surfaces */
  --surface-card: rgba(255, 255, 255, 0.6);
  --surface-card-border: rgba(0, 0, 0, 0.06);

  /* Sizing */
  --card-radius: 20px;
  --button-radius: 14px;
  --max-width: 1080px;
  --nav-height: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-cyan: rgb(102, 217, 255);
    --bg-body: #0e1117;
    --bg-hero: linear-gradient(160deg, #0a1628 0%, #0d1f3c 30%, #0b1a30 60%, #0e1117 100%);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --bg-glass-hover: rgba(255, 255, 255, 0.12);
    --bg-glass-border: rgba(255, 255, 255, 0.12);
    --bg-glass-shadow: rgba(0, 0, 0, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #d9d9de;
    --text-tertiary: #b3b3ba;
    --surface-card: rgba(255, 255, 255, 0.06);
    --surface-card-border: rgba(255, 255, 255, 0.1);
  }
}

/* ===== Typography ===== */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--bg-glass-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-brand span {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s var(--ease-out);
}

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

/* ===== Language Picker ===== */
.lang-picker {
  position: relative;
}

.lang-picker select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-card);
  border: 0.5px solid var(--surface-card-border);
  border-radius: 10px;
  padding: 6px 28px 6px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease-out);
}

.lang-picker select:hover {
  background: var(--bg-glass-hover);
}

.lang-picker::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-tertiary);
  pointer-events: none;
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
  background: var(--bg-hero);
  overflow: hidden;
}

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

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin-bottom: 28px;
  box-shadow: 0 12px 40px rgba(0, 122, 255, 0.2);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  background: var(--gradient-water);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

/* App Store Badge */
.app-store-link {
  display: inline-block;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
  border-radius: 12px;
}

.app-store-link:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.app-store-link:active {
  transform: translateY(0);
}

.app-store-link img {
  height: 44px;
  width: auto;
}

.app-store-link [data-lang].active {
  display: inline-block;
}

.app-store-text {
  margin-top: 12px;
  font-size: 0.875rem;
}

.app-store-text a {
  color: var(--color-cyan);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s var(--ease-out);
}

.app-store-text a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.app-store-text [data-lang] {
  display: none;
}

.app-store-text [data-lang].active {
  display: inline;
}

/* Wave animation */
.hero-waves {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 1;
}

.hero-waves svg {
  width: 200%;
  height: 100%;
  display: block;
}

.wave-primary {
  animation: waveShift 8s ease-in-out infinite;
}

.wave-secondary {
  animation: waveShift 12s ease-in-out infinite reverse;
}

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

/* ===== Features Section ===== */
.features {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin-bottom: 48px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

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

.feature-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--bg-glass-border);
  border-radius: var(--card-radius);
  padding: 24px;
  transition: all 0.3s var(--ease-out);
}

.feature-card:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--bg-glass-shadow);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(0, 191, 242, 0.15), rgba(0, 122, 255, 0.1));
}

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ===== Why Section ===== */
.why-section {
  padding: 60px 24px 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

.why-section p {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 720px;
  margin: 0 auto;
}

.why-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== Accessibility Section ===== */
.accessibility {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.a11y-grid > [data-lang].active {
  display: contents;
}

.a11y-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--bg-glass-border);
  border-radius: var(--card-radius);
  transition: all 0.3s var(--ease-out);
}

.a11y-item:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--bg-glass-shadow);
}

.a11y-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.a11y-item strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.a11y-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .a11y-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .a11y-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Privacy Callout ===== */
.privacy-callout {
  max-width: var(--max-width);
  margin: 0 auto 80px;
  padding: 0 24px;
}

.privacy-callout-inner {
  background: var(--gradient-water);
  border-radius: var(--card-radius);
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.privacy-callout-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.privacy-callout h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  position: relative;
}

.privacy-callout p {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ===== Footer ===== */
.footer {
  border-top: 0.5px solid var(--bg-glass-border);
  padding: 32px 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s var(--ease-out);
}

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

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* ===== Legal Pages (Privacy & Terms) ===== */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) 24px 80px;
}

.legal h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.legal .legal-date {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 40px;
}

.legal h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
}

.legal h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.65;
}

.legal ul {
  color: var(--text-secondary);
  padding-left: 24px;
  margin-bottom: 12px;
}

.legal li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.legal a {
  color: var(--color-cyan);
  text-decoration: none;
}

.legal a:hover {
  text-decoration: underline;
}

.legal strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== 404 Page ===== */
.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.page-404 h1 {
  font-size: 6rem;
  font-weight: 700;
  background: var(--gradient-water);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 12px;
}

.page-404 p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 28px;
}

.page-404 a {
  display: inline-block;
  padding: 12px 28px;
  background: var(--gradient-water);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s var(--ease-out);
}

.page-404 a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

/* ===== Language visibility ===== */
[data-lang] {
  display: none;
}

[data-lang].active {
  display: block;
}

/* In grids, use contents to avoid breaking grid layout */
.features-grid > [data-lang].active {
  display: contents;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1.0625rem;
  }

  .hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.625rem;
  }

  .privacy-callout-inner {
    padding: 36px 24px;
  }

  .privacy-callout h2 {
    font-size: 1.375rem;
  }

  .legal h1 {
    font-size: 1.75rem;
  }

  .nav-links a.nav-link-desktop {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 75vh;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .nav-brand span {
    font-size: 1rem;
  }

  .app-store-link img {
    height: 40px;
  }
}

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

:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}
