:root {
    --bg-void: #0a0d0c;
    --bg-base: #101412;
    --bg-panel: #151a18;
    --bg-panel-raised: #1a201d;
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text-primary: #f4f6f5;
    --text-secondary: #a8b3ae;
    --text-tertiary: #6b7570;
    --emerald: #34d399;
    --emerald-bright: #4ade80;
    --emerald-dim: #1a5c42;
    --emerald-glow: rgba(52, 211, 153, 0.35);
    --danger: #f87171;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 9px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
    --font-wordmark: "Space Grotesk", var(--font-sans);
  }

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

  html { scroll-behavior: smooth; }

  body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
  }

  /* ---------- Ambient background ---------- */
  .ambient-glow {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 800px;
    background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.10) 0%, rgba(52, 211, 153, 0.03) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  .grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  .page-wrap {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
  }

  /* ---------- Header ---------- */
  header {
    position: sticky;
    top: 0;
    z-index: 50;
    overflow: hidden;
    background: rgba(10, 13, 12, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Ambient falling-leaf layer: sits behind .header-inner (z-index:1),
     clipped to the header's own bounds by header's overflow:hidden.
     Kept deliberately dim so black stays dominant and the scroll blur
     underneath reads as the main effect — these are a barely-visible
     accent, not a feature in themselves. */
  .header-leaves {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }

  .hleaf {
    position: absolute;
    top: -16%;
    left: var(--l, 10%);
    width: var(--s, 18px);
    height: calc(var(--s, 18px) * 0.87);
    fill: var(--emerald);
    opacity: 0;
    animation: hleafFall var(--dur, 10s) linear infinite;
    animation-delay: var(--delay, 0s);
  }

  @keyframes hleafFall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    8%   { opacity: var(--op, 0.12); }
    50%  { transform: translate(6px, 80px) rotate(100deg); }
    92%  { opacity: var(--op, 0.12); }
    100% { transform: translate(-5px, 160px) rotate(200deg); opacity: 0; }
  }

  .header-inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-wordmark);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--text-primary);
  }

  /* ---------- Leaf + gender-symbol mark ---------- */
  .leaf-icon {
    display: block;
    overflow: visible;
    flex-shrink: 0;
    shape-rendering: geometricPrecision;
    transform-origin: 50% 50%;
    animation: leafRoll 8s linear infinite;
  }

  .leaf-icon .leaf-body { fill: url(#leafGradient); }

  .leaf-icon .symbol-shape {
    fill: none;
    stroke: var(--bg-base);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .leaf-icon .symbol-circle { fill: var(--bg-base); }

  /* Filled shapes, not stroked lines — reads as crisp geometry instead
     of a blob where thick round-capped barbs would overlap or meet. */
  .leaf-icon .symbol-glyph { fill: var(--bg-base); stroke: none; }

  /* Leaf spins a full 360 right after each symbol fade completes,
     then holds still through the next fade. Rotation keeps
     accumulating (0 -> 360 -> 720) across the loop so it never
     snaps back visually. */
  @keyframes leafRoll {
    0%     { transform: rotate(0deg); }
    31.25% { transform: rotate(0deg); }
    37.5%  { transform: rotate(0deg); }
    50%    { transform: rotate(360deg); }
    81.25% { transform: rotate(360deg); }
    87.5%  { transform: rotate(360deg); }
    100%   { transform: rotate(720deg); }
  }

  /* Pure crossfade, no flip/squeeze. */
  @keyframes symbolFade {
    0%     { opacity: 1; }
    31.25% { opacity: 1; }
    37.5%  { opacity: 0; }
    81.25% { opacity: 0; }
    87.5%  { opacity: 1; }
    100%   { opacity: 1; }
  }

  .symbol-male, .symbol-female {
    animation: symbolFade 8s ease-in-out infinite;
  }

  .symbol-female { animation-delay: -4s; }

  /* ---------- Wordmark levitation ---------- */
  .brand span, .footer-brand span {
    display: inline-block;
    animation: levitate 3.4s ease-in-out infinite;
  }

  .brand span:last-child, .footer-brand span:last-child {
    animation-delay: -1.7s;
  }

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

  @media (prefers-reduced-motion: reduce) {
    .symbol-male, .symbol-female, .leaf-icon, .brand span, .footer-brand span, .signal-pulse, .status-dot, .hleaf {
      animation: none;
    }
    .symbol-female, .hleaf { opacity: 0; }
  }

  /* ---------- Header social buttons ---------- */
  .social-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-panel-raised);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
  }

  .social-btn svg { width: 16px; height: 16px; }

  .social-btn:hover {
    border-color: rgba(52, 211, 153, 0.35);
    color: var(--emerald);
    transform: translateY(-1px);
  }

  .contact-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 100px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.22);
    color: var(--emerald);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .contact-btn svg { width: 15px; height: 15px; }

  .contact-btn:hover {
    background: rgba(52, 211, 153, 0.14);
    transform: translateY(-1px);
  }

  /* ---------- App container (top of page, no copy around it) ---------- */
  .app-section {
    padding: 28px 0 0;
  }

  /* .app-shell is the decorative frame around the SDK mount point.
     #app_container itself must stay completely empty — no inner
     elements, text, or loading states — so the CooMeet SDK can
     mount the video console into it cleanly. All framing/chrome
     lives in sibling elements outside #app_container. */
  .app-shell {
    position: relative;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    min-height: 560px;
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-base) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.02) inset,
      0 40px 80px -30px rgba(0,0,0,0.65),
      0 0 120px -40px var(--emerald-glow);
    display: flex;
    flex-direction: column;
  }

  #app_container {
    flex: 1 1 auto;
    min-height: 460px;
    position: relative;
  }

  /* ---------- Shared section heading + button styles ---------- */
  .section-title {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
  }

  .section-title .accent {
    background: linear-gradient(120deg, var(--emerald-bright) 0%, var(--emerald) 60%, #22c55e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-family: inherit;
  }

  .btn-primary {
    background: linear-gradient(180deg, var(--emerald-bright) 0%, var(--emerald) 100%);
    color: #06281a;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 24px -8px rgba(52, 211, 153, 0.55);
  }

  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 12px 28px -8px rgba(52, 211, 153, 0.7);
  }

  .btn-secondary {
    background: var(--bg-panel-raised);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
  }

  .btn-secondary:hover {
    transform: translateY(-1px);
    background: #202722;
    border-color: rgba(255,255,255,0.18);
  }

  /* ---------- Intro / "what is LeafCam" ---------- */
  .intro {
    padding: 72px 0 64px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
  }

  .intro-copy .subheadline {
    max-width: 480px;
    margin: 16px 0 0;
    font-size: clamp(1rem, 1.6vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.65;
  }

  .intro-body {
    margin-top: 20px;
    max-width: 520px;
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.75;
  }

  .connect-illustration { width: 100%; height: auto; overflow: visible; }
  .connect-illustration .frame { fill: var(--bg-panel-raised); stroke: var(--border-strong); stroke-width: 1.5; }
  .connect-illustration .avatar-head { fill: var(--emerald); opacity: 0.28; }
  .connect-illustration .avatar-body { fill: none; stroke: var(--emerald); stroke-width: 2.5; stroke-linecap: round; }
  .connect-illustration .signal-line { stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 4 6; fill: none; }
  .connect-illustration .signal-pulse {
    fill: var(--emerald-bright);
    transform-origin: 200px 125px;
    animation: signalPulse 1.8s ease-in-out infinite;
  }

  @keyframes signalPulse {
    0%, 100% { opacity: 0.5; transform: scale(0.85); }
    50%      { opacity: 1; transform: scale(1.15); }
  }

  /* ---------- Feature detail blocks ---------- */
  .feature-detail {
    padding: 40px 0;
    border-top: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
  }

  .feature-detail h3 {
    font-size: 1.4rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
  }

  .feature-detail p {
    color: var(--text-tertiary);
    font-size: 14.5px;
    line-height: 1.75;
    max-width: 640px;
  }

  .feature-detail p + p { margin-top: 12px; }

  /* ---------- Benefits grid ---------- */
  .benefits {
    padding: 64px 0 16px;
  }

  .benefits-header { max-width: 560px; margin-bottom: 36px; }
  .benefits-header p {
    margin-top: 12px;
    color: var(--text-tertiary);
    font-size: 14.5px;
    line-height: 1.7;
  }

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

  .benefit-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: border-color 0.2s ease, transform 0.2s ease;
  }

  .benefit-card:hover {
    border-color: rgba(52, 211, 153, 0.25);
    transform: translateY(-2px);
  }

  .benefit-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
  }

  .benefit-icon svg { width: 20px; height: 20px; }

  .benefit-card h3 {
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 7px;
    color: var(--text-primary);
  }

  .benefit-card p {
    font-size: 13.5px;
    color: var(--text-tertiary);
    line-height: 1.6;
  }

  /* ---------- Stats band ---------- */
  .stats-band {
    margin: 72px 0;
    padding: 40px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    text-align: center;
  }

  .stat-value {
    font-family: var(--font-wordmark);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 700;
    color: var(--emerald);
    letter-spacing: -0.02em;
  }

  .stat-label {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-tertiary);
  }

  /* ---------- FAQ ---------- */
  .faq { padding: 16px 0 64px; }
  .faq-header { max-width: 560px; margin-bottom: 28px; }

  .faq-item {
    border-top: 1px solid var(--border-subtle);
  }

  .faq-item:last-child { border-bottom: 1px solid var(--border-subtle); }

  .faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .faq-item summary::-webkit-details-marker { display: none; }

  .faq-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 15px;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  .faq-item[open] .faq-icon { transform: rotate(45deg); color: var(--emerald); }

  .faq-item p {
    padding: 0 4px 20px 0;
    max-width: 680px;
    color: var(--text-tertiary);
    font-size: 13.5px;
    line-height: 1.7;
  }

  /* ---------- Closing CTA ---------- */
  .cta-band {
    margin: 24px 0 72px;
    padding: 56px 32px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(52,211,153,0.08) 0%, transparent 70%), var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
  }

  .cta-band .section-title { max-width: 480px; margin: 0 auto; }

  .cta-band p {
    margin: 14px auto 0;
    max-width: 440px;
    color: var(--text-tertiary);
    font-size: 14.5px;
  }

  .cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
  }

  @media (max-width: 860px) {
    .intro { grid-template-columns: 1fr; gap: 32px; }
    .feature-detail { grid-template-columns: 1fr; gap: 14px; }
    .benefits-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-band { grid-template-columns: 1fr; gap: 28px; }
  }

  /* ---------- Footer ---------- */
  footer {
    border-top: 1px solid var(--border-subtle);
    padding: 40px 0 32px;
  }

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

  .footer-brand {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-wordmark);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .footer-links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s ease;
  }

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

  .footer-legal {
    max-width: 640px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-tertiary);
    opacity: 0.75;
  }

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

  /* ---------- Responsive ---------- */
  @media (max-width: 760px) {
    .benefits-grid { grid-template-columns: 1fr; }
    .header-inner { padding: 14px 18px; }
    .app-shell { border-radius: 16px; min-height: 460px; }
    #app_container { min-height: 360px; }
    .app-section { padding: 18px 0 0; }
    .intro { padding: 48px 0 40px; }
  }

  @media (max-width: 420px) {
    .cta-actions { flex-direction: column; width: 100%; }
    .btn { width: 100%; }
  }

  /* ---------- Legal footer triggers ---------- */
  .legal-trigger {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
  }

  .legal-trigger:hover { color: var(--text-secondary); }

  /* ---------- Legal modals (fade) ---------- */
  .legal-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }

  .legal-modal.is-open {
    opacity: 1;
    visibility: visible;
  }

  .legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 7, 0.72);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
  }

  .legal-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--bg-panel-raised) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 90px -25px rgba(0, 0, 0, 0.7);
    transform: translateY(10px) scale(0.98);
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
  }

  .legal-modal.is-open .legal-modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .legal-modal-header h2 {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text-primary);
  }

  .legal-modal-close {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .legal-modal-close:hover {
    background: var(--bg-panel-raised);
    color: var(--text-primary);
  }

  .legal-modal-body {
    padding: 22px 24px 28px;
    overflow-y: auto;
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.7;
  }

  .legal-modal-body p {
    margin-bottom: 14px;
  }

  .legal-modal-body p:last-child { margin-bottom: 0; }

  .legal-inline-link {
    color: var(--emerald);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
  }

  .legal-modal-body::-webkit-scrollbar { width: 8px; }
  .legal-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 8px;
  }

  /* ---------- Contact modal ---------- */
  .contact-email-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
  }

  .contact-email {
    font-family: var(--font-wordmark);
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }

  .copy-email-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--bg-panel-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
  }

  .copy-email-btn svg { width: 14px; height: 14px; }

  .copy-email-btn:hover {
    border-color: rgba(52, 211, 153, 0.35);
    color: var(--emerald);
  }

  .copy-email-btn.is-copied {
    border-color: rgba(52, 211, 153, 0.45);
    color: var(--emerald);
  }
