:root {
  --bg-light: #ffffff;
  --bg-dark: #14171f;
  --surface-light: #f6f8fb;
  --surface-dark: #1c212c;
  --card-light: #ffffff;
  --card-dark: #222836;
  --text-light: #0f172a;
  --text-dark: #f8fafc;
  --muted-light: #475569;
  --muted-dark: #c5cedb;
  --border-light: #e5e9f0;
  --border-dark: #313a4d;
  --brand-light: #1d4ed8;
  --brand-dark: #60a5fa;
  --brand-soft-light: #eff6ff;
  --brand-soft-dark: #1e3357;
  --target-size: 24px;

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --card: var(--card-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --border: var(--border-light);
  --brand: var(--brand-light);
  --brand-soft: var(--brand-soft-light);

  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --card: var(--card-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --border: var(--border-dark);
    --brand: var(--brand-dark);
    --brand-soft: var(--brand-soft-dark);
  }

  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --card: light-dark(var(--card-light), var(--card-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-soft: light-dark(var(--brand-soft-light), var(--brand-soft-dark));
  }

  color-scheme: light dark;
  accent-color: var(--brand);
}

@media (pointer: coarse) {
  :root { --target-size: 44px; }
}

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

/* Match html & body canvas to eliminate any dark/black bar in bottom safe area or overscroll */
html {
  background-color: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { max-inline-size: 100%; block-size: auto; display: block; }
a { color: var(--brand); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

:where(nav a, .btn, summary) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

.container {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}

/* Header extends seamlessly into the top status bar / Dynamic Island area with matching color */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  min-block-size: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.lang-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text) !important;
}

/* Hero */
.hero {
  padding: clamp(44px, 7vw, 84px) 0 clamp(40px, 6vw, 72px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 1.1rem + 3vw, 3.35rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.hero-lead {
  font-size: clamp(1rem, 0.92rem + 0.5vw, 1.2rem);
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 56ch;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--brand);
  color: #ffffff;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}
.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-visual img {
  width: min(340px, 85vw);
  aspect-ratio: 648 / 1305;
  filter: drop-shadow(0 24px 48px rgba(15, 23, 42, 0.18));
}

/* Sections */
.section {
  padding: clamp(52px, 7vw, 88px) 0;
}
.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}
.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 44px;
}
.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 1rem + 1.8vw, 2.3rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* Showcase Rows */
.showcase-list {
  display: grid;
  gap: clamp(44px, 6vw, 76px);
}
.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}
.showcase-row.reverse .showcase-media { order: -1; }
.showcase-media {
  display: flex;
  justify-content: center;
}
.showcase-media img {
  width: min(300px, 80vw);
  aspect-ratio: 648 / 1305;
  filter: drop-shadow(0 18px 36px rgba(15, 23, 42, 0.14));
}
.showcase-copy .badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.showcase-copy h3 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 0.95rem + 1.4vw, 1.9rem);
  line-height: 1.25;
}
.showcase-copy p {
  margin: 0 0 16px;
  color: var(--muted);
}
.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.check-list li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
  margin-right: 10px;
}

/* FAQ */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 22px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.04rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; color: var(--brand); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 12px 0 0; color: var(--muted); }

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #ffffff;
  border-radius: 28px;
  padding: clamp(36px, 5vw, 56px) clamp(24px, 4vw, 48px);
  text-align: center;
}
.cta-banner h2 { margin: 0 0 12px; font-size: clamp(1.5rem, 1rem + 1.8vw, 2.3rem); }
.cta-banner p { margin: 0 auto 26px; max-width: 54ch; color: rgba(255, 255, 255, 0.86); }
.cta-banner .btn-primary { background: #ffffff; color: #0f172a; }

/* Footer extends transparently to the bottom safe area (Home Indicator / Android gesture bar) */
.site-footer {
  padding: 36px 0 calc(44px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid, .showcase-row { grid-template-columns: 1fr; }
  .showcase-row.reverse .showcase-media { order: 0; }
  .hero-visual { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Official Apple App Store Badge */
.app-store-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  border-radius: 10px;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.app-store-link:hover {
  transform: translateY(-1px);
  opacity: 0.92;
  text-decoration: none;
}
.app-store-badge {
  height: 50px;
  width: auto;
  display: block;
}

/* Language Dropdown (Globe + Current Language) */
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  min-block-size: var(--target-size);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.lang-trigger:hover {
  border-color: var(--brand);
}
.lang-trigger[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.lang-trigger .chevron {
  transition: transform 0.15s ease;
}
.lang-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.lang-popover {
  margin: 0;
  padding: 6px;
  min-inline-size: 164px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

@supports (position-area: block-end) {
  .lang-popover {
    position-area: block-end span-inline-start;
    position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline;
    inset: auto;
    margin-block-start: 8px;
  }
}

@supports not (position-area: block-end) {
  .lang-popover {
    position: fixed;
    inset: auto;
  }
}

.lang-popover a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  min-block-size: var(--target-size);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.lang-popover a:hover,
.lang-popover a:focus-visible {
  background: var(--surface);
  text-decoration: none;
}
.lang-popover a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.lang-popover a[aria-current="page"]::after {
  content: "✓";
  font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
  .lang-popover {
    opacity: 0;
    transition: opacity 0.14s ease, translate 0.14s ease, display 0.14s ease, overlay 0.14s ease;
    transition-behavior: allow-discrete;
  }
  @supports selector(:popover-open) {
    .lang-popover { translate: 0 -4px; }
    .lang-popover:popover-open {
      opacity: 1;
      translate: 0 0;
      transition-duration: 0.1s;
      @starting-style { opacity: 0; translate: 0 -4px; }
    }
  }
}

.footer-langs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* iPhone Duo Foldable Showcase with Folded/Unfolded Switch */
.duo-showcase {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 5vw, 52px);
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
}
.duo-stage {
  display: grid;
  place-items: center;
  perspective: 1400px;
  min-block-size: clamp(260px, 34vw, 410px);
  cursor: pointer;
}
.duo-frame {
  grid-area: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  backface-visibility: hidden;
  transform-origin: center center;
}
.duo-frame-expanded img {
  width: min(560px, 100%);
  max-height: 400px;
  object-fit: contain;
  filter: drop-shadow(0 20px 38px rgba(15, 23, 42, 0.2));
}
.duo-frame-folded img {
  height: clamp(250px, 33vw, 390px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 36px rgba(15, 23, 42, 0.24));
}

.duo-showcase[data-duo-state="expanded"] .duo-frame-expanded,
.duo-showcase[data-duo-state="folded"] .duo-frame-folded {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .duo-frame {
    transition:
      opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .duo-showcase[data-duo-state="expanded"] .duo-frame-expanded {
    transform: rotateY(0deg) scale(1);
  }
  .duo-showcase[data-duo-state="expanded"] .duo-frame-folded {
    transform: rotateY(24deg) scale(0.88);
  }
  .duo-showcase[data-duo-state="folded"] .duo-frame-folded {
    transform: rotateY(0deg) scale(1);
  }
  .duo-showcase[data-duo-state="folded"] .duo-frame-expanded {
    transform: rotateY(-20deg) scale(0.82);
  }
}

.duo-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: 18px;
  gap: 4px;
}
.duo-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  min-block-size: var(--target-size);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.duo-switch button:hover {
  color: var(--text);
}
.duo-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
}

@media (max-width: 900px) {
  .duo-showcase { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .app-store-link { transition: none; }
}
