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

:root {
  --hero-from: #1565C0;
  --hero-to: #003E6E;
  --accent-light: #4ca6ff;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-hover: rgba(255, 255, 255, 0.14);
  --text-hero: #fff;
  --text-hero-muted: rgba(255, 255, 255, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --hero-from: #0D3B6E;
    --hero-to: #001528;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.1);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text-hero);
  background: var(--hero-to);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Full-page gradient */
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(170deg, var(--hero-from) 0%, var(--hero-to) 55%, #001a2e 100%);
}

/* ── Layout ── */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Sticky Header ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  transition: background 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  background: rgba(0, 30, 60, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
  text-decoration: none;
}

.site-header.scrolled .header-brand {
  opacity: 1;
}

.header-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.header-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-hero);
}

/* ── Language Picker ── */

.lang-picker {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
}

.lang-option {
  background: transparent;
  border: none;
  color: var(--text-hero-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  line-height: 1.3;
}

.lang-option:hover {
  color: #fff;
}

.lang-option.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ── Hero ── */

.hero {
  position: relative;
  padding: 8rem 0 4rem;
  text-align: center;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
}

.hero-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(20rem, 40vw, 40rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ── Hero Icon ── */

.hero-icon-wrap {
  display: inline-block;
  padding: 10px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1.5rem;
  animation: float 4s ease-in-out infinite;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-icon {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 18px;
}

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

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: #fff;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-hero-muted);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Typing Demo ── */

.typing-demo {
  display: inline-block;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 2.5rem;
  text-align: left;
  min-width: 280px;
  height: 175px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.demo-input-row {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem 0.7rem 2.2rem;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-input {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 1.1rem;
  color: #fff;
  min-height: 1.4em;
}

.demo-cursor {
  width: 2px;
  height: 1.2em;
  background: rgba(255, 255, 255, 0.7);
  animation: blink 0.8s step-end infinite;
  flex-shrink: 0;
}

@keyframes blink {
  50% { opacity: 0; }
}

.demo-candidates {
  padding: 0.3rem 0;
}

.demo-candidate {
  padding: 0.35rem 1rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}

.demo-candidate.selected {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.demo-candidate-num {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  min-width: 1em;
}

/* ── Hero Buttons ── */

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #fff;
  color: var(--hero-from);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #f0f4ff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Hero GitHub Link ── */

.hero-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.hero-github:hover {
  color: rgba(255, 255, 255, 0.9);
}

.hero-github svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Features ── */

.features {
  padding: 4rem 0;
}

.features h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

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

.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.feature-card:hover {
  background: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
}

.feature-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: #fff;
  font-weight: 600;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-hero-muted);
  line-height: 1.5;
}

/* ── Footer ── */

.footer {
  padding: 2.5rem 0 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

/* ── Scroll Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.feature-card.reveal:nth-child(1) { transition-delay: 0s; }
.feature-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.feature-card.reveal:nth-child(3) { transition-delay: 0.2s; }

/* ── Privacy Page ── */

.privacy-layout {
  display: flex;
  flex-direction: column;
}

.privacy-layout .privacy-content {
  flex: 1;
}

.privacy-content {
  max-width: 600px;
  margin: 6rem auto 2rem;
  padding: 0 1.5rem;
}

.privacy-content h1 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.privacy-content h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  color: rgba(255, 255, 255, 0.9);
}

.privacy-content p {
  color: var(--text-hero-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.privacy-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-light);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.privacy-back:hover {
  text-decoration: underline;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero {
    padding: 6rem 0 3rem;
    min-height: 0;
  }

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

  .hero .tagline {
    font-size: 1.05rem;
  }

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

  .typing-demo {
    min-width: 240px;
  }

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

  .features {
    padding: 3rem 0;
  }

  .hero-watermark {
    font-size: 14rem;
  }
}
