/* CableDrop landing page.
 *
 * Values mirror internal/serve/assets/css/tokens.css — the page is meant to
 * look like the product, so it borrows the product's palette rather than
 * inventing one. No external fonts, no icon library, no framework.
 */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --text: #1d1d1f;
  --text-2: #66666e;
  --text-3: #a1a1a6;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);
  --accent: #0a84ff;
  --accent-text: #0071e3;
  --accent-soft: rgba(10, 132, 255, 0.11);
  --ok: #34c759;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --purple: #af52de;
  --purple-soft: rgba(175, 84, 222, 0.12);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.04);
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 99px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-med: 180ms;
  --max: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --surface: #1d1d20;
    --surface-2: #242428;
    --text: #f2f2f5;
    --text-2: #a2a2ab;
    --text-3: #6c6c74;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent-text: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.2);
    --ok: #3ecf6a;
    --ok-soft: rgba(67, 194, 99, 0.18);
    --purple: #c77df2;
    --purple-soft: rgba(199, 125, 242, 0.18);
    --shadow-card: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 0.1em 0.36em;
  border-radius: var(--r-sm);
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .bar { background: var(--bg); }
}

.bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; }
.brand img { border-radius: 6px; }

.bar-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.bar-nav a { color: var(--text-2); }
.bar-nav a:hover { color: var(--text); text-decoration: none; }

.bar-gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text) !important;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
  padding: 76px 24px 64px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 15ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent-text);
}

.lede {
  margin: 0 0 26px;
  font-size: 17.5px;
  color: var(--text-2);
  max-width: 46ch;
}

.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
  transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
}

.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #0071e3; border-color: #0071e3; }

.note {
  margin: 20px 0 0;
  font-size: 13.5px;
  color: var(--text-3);
}

.hero-shot img {
  width: 380px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

/* ---------- pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding-bottom: 8px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.pillar h3 { margin: 14px 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.pillar p { margin: 0; font-size: 14.5px; color: var(--text-2); }

.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  flex: none;
}

.ic-blue   { background: var(--accent-soft); color: var(--accent); }
.ic-green  { background: var(--ok-soft);     color: var(--ok); }
.ic-purple { background: var(--purple-soft); color: var(--purple); }
.ic-plain  { background: var(--surface-2);   color: var(--text-2); }

/* ---------- generic sections ---------- */

.section { padding: 64px 24px 8px; }

.section h2 {
  margin: 0 0 10px;
  font-size: clamp(23px, 2.6vw, 30px);
  letter-spacing: -0.02em;
  font-weight: 680;
}

.section-lede {
  margin: 0 0 34px;
  font-size: 16.5px;
  color: var(--text-2);
  max-width: 62ch;
}

/* ---------- screenshots ---------- */

.shots {
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.shot {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.shot img {
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.shot-panel img { width: 380px; }
.shot-phone img { width: 340px; border-radius: 24px; }

.shots figcaption {
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
  max-width: 60ch;
}

.shots figcaption strong { color: var(--text); font-weight: 600; }

/* ---------- flow diagram ---------- */

.flow {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 0.7fr) 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
}

.node {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.node-ic { color: var(--text-2); margin-bottom: 6px; }
.node-strong { border-color: var(--accent); }
.node-strong .node-ic { color: var(--accent); }
.node b { font-size: 15.5px; }
.node small { font-size: 12.5px; color: var(--text-3); }

.link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.link-line {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(to right,
      var(--accent) 0 7px, transparent 7px 14px);
}

.facts { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 15px; }
.facts li { margin-bottom: 9px; }

/* ---------- feature grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 18px;
}

.grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

.grid h3 { margin: 0 0 6px; font-size: 15.5px; letter-spacing: -0.01em; }
.grid p { margin: 0; font-size: 14.5px; color: var(--text-2); }

/* ---------- android app ---------- */

.apk {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.apk-shot {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 18px;
  display: flex;
  justify-content: center;
}

.apk-shot img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.apk-side { display: flex; flex-direction: column; gap: 22px; }

.apk-icon {
  display: flex;
  align-items: center;
  gap: 16px;
}

.apk-icon img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  flex: none;
  box-shadow: var(--shadow-card);
}

.apk-icon p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.apk-icon strong { color: var(--text); font-weight: 600; }

.apk-gains {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  color: var(--text-2);
}

.apk-gains li {
  position: relative;
  padding-left: 26px;
}

.apk-gains li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.apk-gains b { color: var(--text); font-weight: 600; }

.specs {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  font-size: 14.5px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.specs dt { color: var(--text-3); font-weight: 550; }
.specs dd { margin: 0; color: var(--text-2); }

/* ---------- trust ---------- */

.trust {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.trust h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.trust p { margin: 0; color: var(--text-2); font-size: 15px; max-width: 70ch; }

/* ---------- download ---------- */

.steps {
  margin: 0 0 22px;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 15.5px;
}

.steps li { margin-bottom: 16px; }
.steps b { color: var(--text); }
.steps em { font-style: normal; color: var(--text); font-weight: 550; }

.steps pre {
  margin: 10px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--text);
}

.steps pre code { background: none; color: inherit; padding: 0; }

.build-targets {
  font-size: 14px;
  color: var(--text-3);
  padding-bottom: 56px;
}

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); margin-top: 40px; }

.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 26px 24px 40px;
  font-size: 14px;
  color: var(--text-2);
}

.foot-links { display: flex; gap: 18px; }

/* ---------- narrow screens ---------- */

@media (max-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-top: 52px;
    text-align: left;
  }
  .hero h1 { max-width: none; }
  .hero-shot { display: flex; justify-content: center; }
  .hero-shot img { width: min(380px, 100%); }

  .bar-nav a:not(.bar-gh) { display: none; }

  .flow { grid-template-columns: 1fr; gap: 14px; }
  .link { flex-direction: row; gap: 12px; }
  .link-line { width: 46px; flex: none; }

  .apk { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .apk-shot { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 520px) {
  .wrap, .section, .hero { padding-left: 18px; padding-right: 18px; }
  .shot { padding: 14px; }
  .shot-phone img { width: 100%; }
  .trust { flex-direction: column; }
  /* a 390px screen can't hold the aligned command + comment; wrap instead of
     letting the code block scroll sideways */
  .steps pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- language switch ---------- */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: var(--surface-2);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

.lang-switch button:hover { color: var(--text); }

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

/* A brief dim while the copy swaps, so the change reads as a change rather
 * than a flicker. Applied for a couple of frames by i18n.js. */
.lang-switching body { opacity: 0.55; }
body { transition: opacity 140ms var(--ease); }

/* ---------- scroll-in transitions ---------- */

/* Only armed when JS is present (.js on <html>): with no JS every section
 * stays visible instead of being stuck at opacity 0. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}

.js .reveal.in { opacity: 1; transform: none; }

/* Stagger the children of a section so a grid arrives as a group, not a slab. */
.js .reveal.in .pillar,
.js .reveal.in .grid article,
.js .reveal.in .dl-card {
  animation: rise 620ms var(--ease) both;
}

.js .reveal.in .pillar:nth-child(2),
.js .reveal.in .grid article:nth-child(2),
.js .reveal.in .dl-card:nth-child(2) { animation-delay: 70ms; }

.js .reveal.in .pillar:nth-child(3),
.js .reveal.in .grid article:nth-child(3),
.js .reveal.in .dl-card:nth-child(3) { animation-delay: 140ms; }

.js .reveal.in .grid article:nth-child(4),
.js .reveal.in .dl-card:nth-child(4) { animation-delay: 210ms; }

.js .reveal.in .grid article:nth-child(n+5),
.js .reveal.in .dl-card:nth-child(n+5) { animation-delay: 260ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- download cards ---------- */

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dl-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "ic name"
    "ic note"
    "get get";
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  color: var(--text);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease);
}

.dl-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.08);
}

.dl-ic {
  grid-area: ic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  flex: none;
}

.dl-name { grid-area: name; font-weight: 620; font-size: 15.5px; letter-spacing: -0.01em; }
.dl-note { grid-area: note; font-size: 13px; color: var(--text-3); }

.dl-get {
  grid-area: get;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dl-get::after {
  content: "";
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M8 2v8m0 0 3-3m-3 3-3-3M3 13h10'/%3E%3C/svg%3E");
  mask: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M8 2v8m0 0 3-3m-3 3-3-3M3 13h10'/%3E%3C/svg%3E");
  transition: transform var(--t-med) var(--ease);
}

.dl-card:hover .dl-get::after { transform: translateY(2px); }

.dl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  margin: 0 0 8px;
}

.dl-sep { color: var(--text-3); }

@media (max-width: 880px) {
  .lang-switch { margin-left: auto; }
  .bar-nav { gap: 12px; }
}
