:root {
  --indigo: #4f46e5;
  --indigo-d: #4338ca;
  --indigo-l: #eef2ff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page-max: 1600px;
  --page-gutter: clamp(16px, 3vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--slate-900);
  background:
    radial-gradient(1200px 500px at 50% -200px, var(--indigo-l), transparent),
    var(--slate-50);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.nav {
  width: 100%;
  margin: 0;
  padding: 12px max(var(--page-gutter), calc((100% - var(--page-max)) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--slate-200);
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--indigo); }
.brand-name { font-weight: 800; font-size: 18px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 36px;
}
.nav-links a {
  color: var(--slate-600);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--slate-900); }
.nav-links .topbar-lang {
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 36px;
}
.nav-links .topbar-lang-btn {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
}
.nav-links .btn-sm {
  align-self: center;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 22px; border-radius: 10px; font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent; transition: 0.15s;
  font-family: inherit;
}
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-d); }
.btn-ghost { background: #fff; color: var(--indigo); border-color: var(--slate-300); }
.btn-ghost:hover { border-color: var(--indigo); background: var(--indigo-l); }
.btn-ghost[aria-disabled="true"] { color: var(--slate-400); cursor: default; border-color: var(--slate-200); background: var(--slate-50); }
.btn:disabled { opacity: 0.7; cursor: wait; }

/* Match ai-tools: signed-in shows avatar only (opens shared Tools profile). */
#signin-btn[hidden],
.auth-user-menu[hidden] {
  display: none !important;
}
.auth-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.auth-avatar-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.auth-avatar-btn:hover { filter: brightness(1.06); }
.auth-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero {
  width: min(var(--page-max), calc(100% - 2 * var(--page-gutter)));
  margin: 0 auto;
  padding: clamp(16px, 4vh, 48px) 0 clamp(12px, 2.5vh, 28px);
  text-align: center;
}
.hero-title { font-size: clamp(36px, 8vw, 72px); line-height: 1.05; margin: 0; letter-spacing: -1.5px; }
.hero-sub { font-size: clamp(16px, 2.4vw, 22px); color: var(--slate-500); margin: 10px 0 0; }

.apps {
  width: min(var(--page-max), calc(100% - 2 * var(--page-gutter)));
  margin: 0 auto;
  padding: 8px 0 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 24px);
}
.appcard {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius);
  padding: clamp(16px, 2vh, 32px) clamp(12px, 1.4vw, 24px) clamp(14px, 1.6vh, 24px);
  box-shadow: var(--shadow); transition: 0.18s; min-width: 0;
}
.appcard:not(.appcard-soon):hover { transform: translateY(-4px); border-color: var(--indigo); box-shadow: 0 12px 28px rgba(79, 70, 229, 0.16); }
.appcard-soon { opacity: 0.92; }
.appicon {
  width: clamp(48px, 5vw, 72px); height: clamp(48px, 5vw, 72px); border-radius: 16px; background: var(--indigo-l); color: var(--indigo);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px; overflow: hidden;
}
.appicon svg { width: clamp(24px, 2.4vw, 36px); height: clamp(24px, 2.4vw, 36px); }
.appicon-mark { background: transparent; }
.appicon-photo { background: transparent; padding: 0; }
.appicon-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { font-size: 11px; font-weight: 700; color: var(--slate-500); background: var(--slate-100); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.badge-live { color: var(--green); background: var(--green-bg); }
.appname { font-size: clamp(14px, 1.15vw, 18px); margin: 0 0 6px; line-height: 1.3; }
.appdesc { font-size: clamp(12px, 0.95vw, 15px); color: var(--slate-500); margin: 0 0 14px; min-height: 0; flex: 1; }
.appbtn { width: 100%; margin-top: auto; }

.page {
  width: min(var(--page-max), calc(100% - 2 * var(--page-gutter)));
  margin: 0 auto;
  padding: 12px 0 48px;
}
.page-title {
  text-align: center;
  font-size: clamp(28px, 6vw, 48px);
  letter-spacing: 0.04em;
  margin: 8px 0 10px;
  font-weight: 700;
}
.page-lead {
  text-align: center;
  color: var(--slate-600);
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: 16px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.contact-form { display: grid; gap: 12px; }
.contact-form label { font-size: 13px; font-weight: 600; color: var(--slate-700); }
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  background: #fff;
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--indigo);
  border-color: var(--indigo);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.turnstile-slot { min-height: 65px; }
.form-status { margin: 4px 0 0; font-size: 14px; color: var(--slate-600); }
.form-status-ok { color: var(--green); }
.form-status-error { color: #b91c1c; }

.office { display: flex; gap: 12px; margin: 0 0 18px; }
.office:last-child { margin-bottom: 0; }
.office-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--indigo-l); color: var(--indigo);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.office h3 { margin: 0 0 4px; font-size: 16px; }
.office p { margin: 0 0 4px; color: var(--slate-600); font-size: 14px; }
.office a { color: var(--indigo); font-weight: 600; }

.maps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
}
.map-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-card h3 { margin: 0; padding: 12px 14px; font-size: 15px; }
.map-card iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}

.privacy h2 {
  margin: 28px 0 8px;
  font-size: 22px;
  font-weight: 650;
}
.privacy p, .privacy li { color: var(--slate-600); font-size: 15px; }
.privacy ul { padding-left: 20px; }
.privacy a { color: var(--indigo); font-weight: 600; }

/* Desktop / tablet landscape: all six tiles in one row */
@media (min-width: 900px) {
  .apps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .appcard { min-height: 280px; }
}

@media (max-width: 1024px) {
  .maps { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { padding: 10px var(--page-gutter); }
  .brand-name { font-size: 16px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 14px; }
  .hero { padding: 10px 0 12px; }
  .apps { padding: 6px 0 28px; }
  .appicon { margin-bottom: 8px; }
  .appdesc { margin-bottom: 10px; }
  .btn-sm { height: 34px; font-size: 13px; padding: 0 10px; }
  .page { padding: 8px 0 40px; }
  .form-row { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
}

@media (pointer: coarse) {
  .appbtn { min-height: 44px; }
}


/* —— Featured landing (from mock-landing, kept as reference) —— */
/* Mock-only — does not change live styles.css */

      .brand-logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        object-fit: cover;
        display: block;
        flex-shrink: 0;
      }
      .brand .brand-dot { display: none; }

      .nav-tagline {
        margin: 0;
        flex: 1;
        text-align: center;
        font-size: clamp(15px, 1.7vw, 18px);
        font-weight: 800;
        color: var(--slate-900);
        letter-spacing: -0.02em;
        min-width: 0;
      }

      .top-apps {
        /* gap must match .apps exactly */
        --tile-gap: clamp(10px, 1.4vw, 24px);
        --tile-pad-x: clamp(12px, 1.4vw, 24px);
        /* shared screenshot frame for all 4 tiles (Anti-Virus 1280×720) */
        --tile-shot-aspect: 16 / 9;
        width: min(var(--page-max), calc(100% - 2 * var(--page-gutter)));
        margin: 0.35rem auto 0.35rem;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 1fr auto 1fr;
        gap: var(--tile-gap);
        padding: 0 0 6px;
        height: calc(100dvh - 4.2rem);
        max-height: calc(100dvh - 4.2rem);
        box-sizing: border-box;
        container-type: inline-size;
        container-name: featured;
      }
      .top-apps .appcard {
        align-items: stretch;
        text-align: center;
        min-height: 0;
        height: 100%;
        padding: 2px clamp(8px, 1vw, 12px) 8px;
        display: flex;
        flex-direction: column;
        cursor: default;
        overflow: hidden;
      }
      .top-apps .appcard:hover {
        transform: none;
        border-color: var(--slate-200);
        box-shadow: var(--shadow);
      }
      /*
        Shared screenshot frame for every featured tile (no per-tile hardcoding).
        Height fills preview; width = height × --tile-shot-aspect → same on all 4.
        object-fit cover + top zooms the upper part when source is taller.
      */
      .appcard-preview {
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
        margin: 0 0 8px;
        padding: 0;
        border-radius: 12px;
        background: var(--indigo-l);
        border: 1px solid var(--slate-200);
        box-sizing: border-box;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        overflow: hidden;
        transition: border-color 0.15s, box-shadow 0.15s;
      }
      .appcard-preview:hover {
        border-color: var(--indigo);
        box-shadow: 0 8px 20px rgba(79, 70, 229, 0.14);
      }
      .appcard-preview img {
        position: static;
        display: block;
        flex: 0 0 auto;
        height: 100% !important;
        width: auto !important;
        max-width: 100% !important;
        max-height: 100% !important;
        aspect-ratio: var(--tile-shot-aspect);
        object-fit: cover;
        object-position: center top;
        margin: 0;
        border-radius: 11px;
        background: #dbe7f5;
      }
      /* Heading + blurb as one block at top (no empty gap above or below text) */
      .top-apps .tile-head {
        flex: 0 0 auto;
        width: 100%;
        margin: 0 0 4px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
      }
      .top-apps .appname {
        flex: 0 0 auto;
        font-size: clamp(13px, 1.1vw, 16px);
        margin: 0 0 2px;
        line-height: 1.3;
        width: 100%;
      }
      .top-apps .appdesc {
        flex: 0 0 auto;
        width: 100%;
        margin: 0;
        text-align: center;
        font-size: clamp(11px, 0.9vw, 13px);
        line-height: 1.35;
      }

      /*
        Image + Go row. Anti-Virus reference frame for every tile:
        width = min(bodyHeight × 16/9, bodyWidth − Go), height follows aspect.
        Same template on all 4 — no per-tile hardcoding.
      */
      /* Image centered; Go sits in the middle of the right empty space */
      .top-apps .tile-body {
        flex: 1 1 0;
        min-height: 0;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        justify-items: center;
        gap: 0;
        width: 100%;
        overflow: hidden;
        container-type: size;
      }
      .top-apps .tile-body .appcard-preview {
        --shot-scale: 0.95; /* 5% smaller; tile-body centers the frame */
        grid-column: 2;
        box-sizing: border-box;
        margin: 0;
        min-width: 0;
        min-height: 0;
        width: min(
          calc(100cqh * var(--tile-shot-aspect) * var(--shot-scale)),
          calc(100cqw * var(--shot-scale))
        );
        max-width: calc(100cqw * var(--shot-scale));
        max-height: calc(100cqh * var(--shot-scale));
        aspect-ratio: var(--tile-shot-aspect);
        height: auto;
      }
      .top-apps .tile-body .appcard-preview img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center top;
      }

      /* Horizontal Go — middle of the empty space right of the image */
      .top-apps .tile-body .appbtn {
        grid-column: 3;
        justify-self: center;
        position: static;
        width: auto !important;
        min-width: 3.5rem;
        max-width: none;
        height: 36px !important;
        min-height: 36px;
        padding: 0 16px !important;
        writing-mode: horizontal-tb;
        letter-spacing: normal;
        margin: 0 !important;
        align-self: center;
      }

      /* One shared download row between the two tile rows */
      .top-apps .shared-downloads {
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
        padding: 12px 16px;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
        gap: clamp(8px, 1.2vw, 16px);
        background: #fff;
        border: 1px solid var(--slate-200);
        border-radius: 16px;
        box-shadow: var(--shadow);
      }
      .shared-dl {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 14px;
        text-decoration: none;
        color: var(--slate-800);
        font-size: clamp(15px, 1.35vw, 18px);
        font-weight: 700;
        min-width: 0;
      }
      .shared-dl:hover { color: var(--indigo); }
      .shared-dl-label {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        white-space: nowrap;
      }
      .shared-dl img.os {
        width: 32px;
        height: 32px;
        display: block;
        flex-shrink: 0;
      }
      .shared-dl img.qr {
        width: clamp(88px, 10vw, 120px);
        height: clamp(88px, 10vw, 120px);
        display: block;
        flex-shrink: 0;
        border-radius: 8px;
        background: #fff;
        border: 1px solid var(--slate-200);
      }
      /* Same teal pill as ai-tools .yt-dl-download-btn */
      .shared-dl-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.4rem;
        padding: 0.55rem 1.1rem;
        border: 0;
        border-radius: 999px;
        background: #0f766e;
        color: #fff;
        font: inherit;
        font-weight: 750;
        font-size: 0.95rem;
        text-decoration: none;
        cursor: pointer;
        white-space: nowrap;
        justify-self: center;
      }
      .shared-dl-btn:hover { background: #0d9488; color: #fff; }

      /* Same language control as ai-tools .topbar-lang */
      .topbar-lang {
        position: relative;
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
      }
      .topbar-lang-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        min-height: 2.2rem;
        padding: 0.3rem 0.35rem 0.3rem 0.55rem;
        border: 1px solid var(--slate-300);
        border-radius: 999px;
        background: #fff;
        font-weight: 700;
        font-size: 0.82rem;
        color: #0f766e;
        cursor: pointer;
        font-family: inherit;
      }
      .topbar-lang-btn .chev {
        font-size: 0.7rem;
        opacity: 0.75;
        line-height: 1;
      }
      .topbar-lang-menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.35rem);
        right: 0;
        z-index: 30;
        margin: 0;
        padding: 0.25rem;
        list-style: none;
        min-width: 8rem;
        border: 1px solid var(--slate-200);
        border-radius: 0.85rem;
        background: #fff;
        box-shadow: var(--shadow);
      }
      .topbar-lang.open .topbar-lang-menu { display: grid; gap: 0.1rem; }
      .topbar-lang-menu button {
        width: 100%;
        border: 0;
        background: transparent;
        text-align: left;
        padding: 0.45rem 0.65rem;
        border-radius: 0.55rem;
        font: inherit;
        font-weight: 600;
        white-space: nowrap;
        color: var(--slate-900);
        cursor: pointer;
      }
      .topbar-lang-menu button:hover,
      .topbar-lang-menu button.on {
        background: #f0fdfa;
        color: #0f766e;
      }

      .apps-live { padding-top: 4px; padding-bottom: 12px; }
      .apps-soon { padding-top: 0; }
      @media (min-width: 900px) {
        .apps-live,
        .apps-soon {
          grid-template-columns: repeat(4, minmax(0, 1fr));
        }
        .apps-live .appcard,
        .apps-soon .appcard {
          min-height: 260px;
        }
      }
      /*
        Desktop-first: leave .top-apps desktop rules unchanged.
        Narrow screens only — content-driven breakpoint (MDN / web.dev):
        stacked cards with real preview height (flex:1 + min-height:0 collapses without a fixed viewport height).
      */
      @media (max-width: 720px) {
        .nav-tagline { display: none; }
        .nav {
          flex-wrap: wrap;
          row-gap: 8px;
          padding-top: max(10px, env(safe-area-inset-top, 0px));
        }
        .nav-links {
          width: 100%;
          justify-content: flex-end;
          gap: 10px;
        }
        .top-apps {
          grid-template-columns: 1fr;
          grid-template-rows: none;
          height: auto !important;
          max-height: none !important;
          margin-bottom: 0.75rem;
        }
        .top-apps .appcard {
          height: auto;
          min-height: 0;
          overflow: visible;
          padding: 12px 14px 14px;
        }
        .top-apps .tile-head {
          margin-bottom: 10px;
        }
        .top-apps .appname {
          font-size: 1.05rem;
        }
        .top-apps .appdesc {
          font-size: 0.92rem;
          line-height: 1.45;
        }
        /* Replace desktop cqh-based preview with a normal stacked image + Go */
        .top-apps .tile-body {
          flex: 0 0 auto;
          min-height: 0;
          display: flex;
          flex-direction: column;
          align-items: stretch;
          gap: 12px;
          overflow: visible;
          container-type: normal;
        }
        .top-apps .tile-body .appcard-preview {
          grid-column: auto;
          width: 100%;
          max-width: 100%;
          max-height: none;
          min-height: 0;
          height: auto;
          aspect-ratio: var(--tile-shot-aspect);
          margin: 0;
        }
        .top-apps .tile-body .appcard-preview img {
          width: 100% !important;
          height: 100% !important;
          object-fit: cover;
          object-position: center top;
        }
        .top-apps .tile-body .appbtn {
          grid-column: auto;
          position: static;
          align-self: center;
          width: auto !important;
          min-width: 5rem;
          height: 40px !important;
          min-height: 40px;
          writing-mode: horizontal-tb;
          margin: 0 !important;
        }
        .top-apps .shared-downloads {
          grid-template-columns: 1fr 1fr;
          justify-items: stretch;
          gap: 12px;
          padding: 14px 12px;
        }
        .shared-dl {
          flex-direction: column;
          gap: 8px;
          width: 100%;
          min-width: 0;
        }
        .shared-dl img.qr {
          width: min(36vw, 120px);
          height: min(36vw, 120px);
          max-width: 100%;
        }
        .shared-dl-label {
          justify-content: center;
          white-space: normal;
          text-align: center;
        }
        .apps-live,
        .apps-soon {
          padding-bottom: max(72px, calc(40px + env(safe-area-inset-bottom, 0px)));
        }
        body {
          padding-bottom: env(safe-area-inset-bottom, 0px);
        }
      }

      @media (max-width: 420px) {
        .nav-links a { font-size: 13px; }
        .nav-links .btn-sm { padding: 0 12px; }
        .shared-dl img.qr {
          width: min(40vw, 132px);
          height: min(40vw, 132px);
        }
      }
