/* ── Design Tokens ── */
:root {
  --color-primary:        #4C7A2F;
  --color-primary-bright: #6BA644;
  --color-secondary:      #3F6B2E;
  --color-accent:         #E0A82E;
  --color-bg:             #EFF3E7;
  --color-fg:             #1C3311;
  --color-muted:          #E4EDD8;
  --color-border:         #CFE0BC;
  --color-white:          #FFFFFF;
  --color-dark:           #14210C;

  --font-heading: 'Baloo 2', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, sans-serif;

  --radius-card: 20px;
  --radius-btn:  50px;

  --shadow-card: 0 8px 32px rgba(28, 51, 17, 0.15);
  --shadow-btn:  0 4px 16px rgba(76, 122, 47, 0.35);

  --section-py-desktop: 80px;
  --section-py-mobile:  48px;

  --max-width: 1280px;

  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-fg);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-fg);
}

/* ── Utility ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
}
.skip-link:focus-visible {
  left: 24px;
  outline: 3px solid var(--color-white);
  outline-offset: 3px;
}

/* ── Focus states ── */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(239, 243, 231, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar__logo { display: flex; align-items: center; gap: 8px; }
.navbar__logo-mark { height: 32px; width: 32px; }
.navbar__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  color: var(--color-fg);
}

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

.navbar__links a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-fg);
  transition: color var(--transition-fast);
}
.navbar__links a:hover { color: var(--color-primary); }

.navbar__cta-btn {
  background: var(--color-primary);
  color: var(--color-white) !important;
  padding: 8px 20px;
  border-radius: var(--radius-btn);
  font-size: 14px !important;
  transition: background var(--transition-fast), transform var(--transition-fast) !important;
}
.navbar__cta-btn:hover {
  background: var(--color-fg) !important;
  transform: translateY(-1px);
}

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 8px;
  min-height: 48px;
  min-width: 48px;
  justify-content: center;
  align-items: center;
}
.navbar__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-fg);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}
.navbar__hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navbar__hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .navbar__hamburger { display: flex; }
  .navbar__links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px 24px;
  }
  .navbar__links.is-open { display: flex; }
  .navbar__links li { width: 100%; }
  .navbar__links a { display: block; padding: 12px 0; font-size: 18px; }
  .navbar__cta-btn { margin-top: 8px; text-align: center; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  min-height: 52px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-btn);
}
.btn--primary:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(28, 51, 17, 0.3);
}
.btn--ghost {
  background: transparent;
  color: var(--color-fg);
  border: 2px solid var(--color-border);
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

/* ── Hero ── */
.hero { padding: var(--section-py-desktop) 0; overflow: hidden; }

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero__badge {
  display: inline-block;
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero__headline {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  margin-bottom: 20px;
}

.hero__sub {
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-secondary);
  max-width: 480px;
  margin-bottom: 36px;
}

.hero__ctas { display: flex; flex-wrap: wrap; gap: 16px; }

.hero__visual { display: flex; justify-content: center; align-items: center; }

.hero__demo {
  width: 100%;
  max-width: 420px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1023px) {
  .hero__inner { gap: 48px; }
  .hero__visual { order: 2; }
  .hero__copy { order: 1; }
  .hero__sub { max-width: 100%; }
}

@media (max-width: 767px) {
  .hero { padding: var(--section-py-mobile) 0; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__headline { font-size: 36px; }
  .hero__ctas { flex-direction: column; }
  .btn { justify-content: center; width: 100%; }
}

/* ── Hero Animation ── */
.demo-input-wrap {
  width: 100%;
  max-width: 380px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.demo-input-label {
  font-size: 12px;
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.demo-input-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-fg);
  flex: 1;
  min-height: 1.2em;
}

.demo-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--color-primary);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

.demo-ai-badge {
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-muted);
  border-radius: 50px;
  padding: 3px 10px;
  white-space: nowrap;
}

.demo-card-scene {
  width: 100%;
  max-width: 380px;
  height: 180px;
  perspective: 800px;
}

.demo-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.demo-card-inner.is-flipped { transform: rotateY(180deg); }

.demo-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.demo-card-front {
  background: var(--color-white);
  border: 2px solid var(--color-border);
}

.demo-card-back {
  background: linear-gradient(135deg, var(--color-primary-bright), #2F5E1E);
  transform: rotateY(180deg);
}

.demo-card-flag { font-size: 28px; margin-bottom: 8px; line-height: 1; }

.demo-card-word {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: 4px;
}

.demo-card-lang { font-size: 13px; color: var(--color-secondary); font-weight: 600; }

.demo-card-translation {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 8px;
}

.demo-card-example {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  font-style: italic;
}

.demo-shimmer {
  width: 100%;
  max-width: 380px;
  height: 180px;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, var(--color-muted) 25%, var(--color-border) 50%, var(--color-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Shared section styles ── */
.section { padding: var(--section-py-desktop) 0; }

.section-badge {
  display: inline-block;
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.section-heading {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-secondary);
  max-width: 480px;
  margin-bottom: 32px;
}

/* ── Notifications ── */
.notif-section { background: var(--color-white); }

.notif-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.phone-mockup {
  width: 280px;
  height: 560px;
  background: #1C1C1E;
  border-radius: 44px;
  padding: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.08);
  margin: 0 auto;
  position: relative;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 28px;
  background: #1C1C1E;
  border-radius: 0 0 20px 20px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border-radius: 32px;
  overflow: hidden;
  padding: 52px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  color: white;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.phone-lock-text {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  text-align: center;
  margin-bottom: 16px;
}

.notif-card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  animation: notifPulse 3s ease-in-out infinite;
}

.notif-card--dim { opacity: 0.55; animation: none; }

@keyframes notifPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 166, 68, 0); }
  50% { box-shadow: 0 0 0 6px rgba(107, 166, 68, 0.15); }
}

.notif-card__app {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.notif-card__icon {
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 5px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
}

.notif-card__app-name { color: rgba(255,255,255,0.7); font-size: 11px; font-weight: 600; flex: 1; }
.notif-card__time { color: rgba(255,255,255,0.4); font-size: 10px; }
.notif-card__title { color: white; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-card__body { color: rgba(255,255,255,0.65); font-size: 12px; }

.notif-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }

.pill {
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 14px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-fg);
}

@media (max-width: 1023px) {
  .notif-inner { grid-template-columns: 1fr; gap: 48px; }
  .notif-visual { order: 2; }
  .notif-copy { order: 1; }
  .section-sub { max-width: 100%; }
}

@media (max-width: 767px) {
  .section { padding: var(--section-py-mobile) 0; }
  .phone-mockup { width: 240px; height: 480px; }
}

/* ── FSRS Section ── */
.fsrs-section { background: var(--color-bg); }

.fsrs-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.fsrs-stats { list-style: none; display: flex; gap: 24px; flex-wrap: wrap; }

.fsrs-stat { display: flex; flex-direction: column; }

.fsrs-stat__num {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.fsrs-stat__label {
  font-size: 13px;
  color: var(--color-secondary);
  font-weight: 600;
  margin-top: 4px;
}

.fsrs-chart-wrap {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

.fsrs-chart { width: 100%; height: auto; }

@media (max-width: 1023px) {
  .fsrs-inner { grid-template-columns: 1fr; gap: 48px; }
}

/* ── Screenshots ── */
.screenshots-section { background: var(--color-white); overflow: hidden; }

.screenshots-header { text-align: center; margin-bottom: 48px; }

.carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel__track {
  display: flex;
  gap: 24px;
  padding: 16px 24px;
  width: max-content;
}

.carousel__slide { scroll-snap-align: center; }

.device-frame {
  position: relative;
  width: 200px;
  background: linear-gradient(150deg, #3a3a3d 0%, #18181a 38%, #0c0c0e 100%);
  border-radius: 42px;
  padding: 7px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.38),
    0 2px 6px rgba(0, 0, 0, 0.30),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    inset 0 0 0 4px #0a0a0c;
}

/* Dynamic Island */
.device-frame::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 17px;
  background: #000;
  border-radius: 10px;
  z-index: 3;
  pointer-events: none;
}

.device-frame img {
  width: 100%;
  height: auto;
  border-radius: 35px;
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
  background: var(--color-muted);
  display: block;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.carousel__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  min-width: 8px;
  min-height: 8px;
}
.carousel__dot::before {
  content: '';
  position: absolute;
  inset: -10px;
}
.carousel__dot.is-active {
  background: var(--color-primary);
  transform: scale(1.4);
}

/* ── Screenshots: desktop coverflow ── */
@media (min-width: 1024px) {
  .screenshots-section .carousel {
    position: relative;
    height: 560px;
    overflow: visible;
  }
  .screenshots-section .carousel__track {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
  }
  .screenshots-section .carousel__slide {
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.6);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    z-index: 1;
  }
  .screenshots-section .carousel__slide.is-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
    z-index: 3;
  }
  .screenshots-section .carousel__slide.is-prev {
    opacity: 0.65;
    transform: translate(calc(-50% - 300px), -50%) rotate(-6deg) scale(0.82);
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
  }
  .screenshots-section .carousel__slide.is-next {
    opacity: 0.65;
    transform: translate(calc(-50% + 300px), -50%) rotate(6deg) scale(0.82);
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
  }
  .screenshots-section .device-frame { width: 240px; }
  .screenshots-section .device-frame::before { top: 18px; height: 19px; }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .screenshots-section .carousel__slide { transition: none; }
}

/* ── Download CTA ── */
.cta-section {
  background: var(--color-fg);
  padding: var(--section-py-desktop) 0;
}

.cta-inner { text-align: center; }

.cta-heading {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 16px;
}

.cta-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 40px;
}

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

.btn--cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-white);
  color: var(--color-fg);
  padding: 16px 32px;
  border-radius: var(--radius-btn);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  min-height: 56px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.btn--cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.btn--cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: rgba(255,255,255,0.4);
  padding: 16px 32px;
  border-radius: var(--radius-btn);
  border: 2px solid rgba(255,255,255,0.2);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  min-height: 56px;
  cursor: default;
}

/* ── Footer ── */
.footer { background: var(--color-dark); padding: 40px 0; }

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer__brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.footer__logo { display: flex; align-items: center; gap: 8px; }
.footer__logo img { height: 40px; width: 40px; }
.footer__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--color-white);
}

.footer__tagline { color: rgba(255,255,255,0.5); font-size: 14px; }

.footer__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: color var(--transition-fast);
}
.footer__links a:hover { color: var(--color-white); }

.footer__copy { color: rgba(255,255,255,0.3); font-size: 13px; }

@media (max-width: 767px) {
  .cta-section { padding: var(--section-py-mobile) 0; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .btn--cta-primary, .btn--cta-ghost { width: 100%; max-width: 320px; justify-content: center; }
}
