/* DuoDesk website. Colors follow the app icon: indigo-to-cyan blue, deep navy screens. */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --text: #0f1a33;
  --muted: #55627a;
  --border: #dfe5f0;
  --accent: #1d6ce0;
  --accent-strong: #1559bf;
  --accent-soft: #e3eeff;
  --cyan: #19b4d6;
  --hero-from: #4d5cbd;
  --hero-mid: #1f78e0;
  --hero-to: #20bfdd;
  --hero-text: #ffffff;
  --button-dark: #0f1a33;
  --button-dark-text: #ffffff;
  --shadow: 0 1px 2px rgb(15 26 51 / 0.06), 0 8px 24px rgb(15 26 51 / 0.06);
  --radius: 18px;
  --art-body: #f2f5fb;
  --art-body-edge: #c9d3e6;
  --art-screen: #17224b;
  --art-bar: #2b3a6e;
  --art-window: #edf2fd;
  --art-line: #aebbd6;
  --art-pad: #22306a;
  --art-key: #34447f;
  --art-touch: #8ce4fb;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #131a2e;
    --surface-2: #1a2340;
    --text: #e8edf7;
    --muted: #9ba7be;
    --border: #253152;
    --accent: #5ea3ff;
    --accent-strong: #86baff;
    --accent-soft: #1a2a4f;
    --cyan: #5fd6ef;
    --hero-from: #1d2346;
    --hero-mid: #142457;
    --hero-to: #173a5a;
    --button-dark: #f2f5fb;
    --button-dark-text: #0f1a33;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    --art-body: #dfe6f3;
    --art-body-edge: #8d9ab8;
    --art-screen: #0f1838;
    --art-window: #dfe7f8;
  }
}

/* Per-language font preferences, ready for the languages still to come. */
:lang(zh-Hant) { --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif; }
:lang(ja) { --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", sans-serif; }
:lang(ko) { --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", sans-serif; }
/* Korean wraps between words, not inside them. */
:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

:lang(zh-Hans) body, :lang(zh-Hant) body, :lang(ja) body, :lang(ko) body { line-height: 1.75; }

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw + 0.6rem, 3.4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.4vw + 0.6rem, 2.1rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; overflow-wrap: anywhere; }
kbd { font-family: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.icon { width: 24px; height: 24px; flex: none; }

/* Anchored sections land below the sticky header (two rows on phones). */
[id] { scroll-margin-top: 112px; }
@media (min-width: 760px) { [id] { scroll-margin-top: 76px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 2px; order: 3; width: 100%; margin: 0 -10px 6px; overflow-x: auto; scrollbar-width: none; }
.site-nav a { padding: 6px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--surface-2); }
/* On phones the logo is the way home, which leaves room for the other four. */
@media (max-width: 759px) {
  .site-nav a[href="index.html"] { display: none; }
  .site-nav a { padding: 6px; font-size: 0.9rem; }
}
@media (min-width: 760px) {
  .site-nav { order: 0; width: auto; margin: 0; }
}

.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; color: var(--muted); font-size: 0.92rem; border: 1px solid var(--border);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary .icon { width: 18px; height: 18px; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); background: var(--surface-2); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.lang-menu li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lang-menu li a:hover { background: var(--surface-2); }
.lang-menu li a[aria-current="true"] { font-weight: 600; color: var(--accent); }

/* Buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 14px; }
.store-button {
  display: inline-flex; align-items: center; gap: 12px; padding: 11px 20px 11px 16px; min-width: 200px;
  flex: 1 1 220px; max-width: 300px;
  border-radius: 14px; background: var(--button-dark); color: var(--button-dark-text); text-decoration: none;
  box-shadow: var(--shadow); transition: transform 0.15s ease;
}
.store-button:hover { color: var(--button-dark-text); transform: translateY(-1px); }
.store-button .icon { width: 28px; height: 28px; }
.store-button span { display: flex; flex-direction: column; line-height: 1.2; }
.store-button small { font-size: 0.75rem; opacity: 0.8; }
.store-button strong { font-size: 1.15rem; }
.store-button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.store-button.secondary:hover { color: var(--text); }
.hero .store-button.secondary { background: rgb(255 255 255 / 0.14); color: var(--hero-text); border-color: rgb(255 255 255 / 0.35); box-shadow: none; }
.hero .store-button { background: #ffffff; color: #0f1a33; }

.button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.button:hover { color: #fff; background: var(--accent-strong); }
:root .button .icon { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { .button, .button:hover { color: #0b1020; } }

/* Hero */
.hero {
  color: var(--hero-text);
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-mid) 55%, var(--hero-to) 100%);
  padding: 56px 0 64px;
  overflow: hidden;
}
.hero-grid { display: grid; gap: 36px; align-items: center; }
.eyebrow { text-transform: none; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; opacity: 0.9; margin-bottom: 14px; }
.hero h1 { margin-bottom: 18px; }
.hero .lead { font-size: 1.05rem; max-width: 34em; opacity: 0.95; }
.hero .note { font-size: 0.9rem; opacity: 0.85; margin: 0; }
.hero-art { justify-self: center; width: min(52vw, 220px); }
.hero-art img { width: 100%; height: auto; border-radius: 22.5%; box-shadow: 0 24px 60px rgb(5 12 40 / 0.35); }
@media (min-width: 880px) {
  .hero { padding: 88px 0 96px; }
  .hero-grid { grid-template-columns: 1.25fr 1fr; }
  .hero .lead { font-size: 1.15rem; }
  .hero-art { width: 380px; }
}

/* Sections */
.section { padding: 64px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 46em; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
@media (min-width: 880px) { .section { padding: 88px 0; } }

.audience { display: grid; gap: 16px; }
@media (min-width: 760px) { .audience { grid-template-columns: repeat(3, 1fr); } }
.audience > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.section.alt .audience > div { background: var(--bg); }
.audience h3 { margin-bottom: 6px; }
.audience p { color: var(--muted); margin: 0; }

.postures { display: grid; gap: 16px; }
@media (min-width: 640px) { .postures { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .postures { grid-template-columns: repeat(4, 1fr); } }
.posture { margin: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 18px; }
.posture .art { width: 100%; max-width: 280px; height: auto; aspect-ratio: 4 / 3; margin: 0 auto 14px; }
.posture figcaption strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.posture figcaption small { display: block; font-size: 0.8rem; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.posture figcaption span { color: var(--muted); }
.art-body { fill: var(--art-body); stroke: var(--art-body-edge); stroke-width: 1; }
.art-screen { fill: var(--art-screen); }
.art-bar { fill: var(--art-bar); }
.art-window { fill: var(--art-window); }
.art-line { fill: var(--art-line); }
.art-red { fill: #ff5f57; } .art-yellow { fill: #febc2e; } .art-green { fill: #28c840; }
.art-cursor { fill: #ffffff; stroke: #0b1020; stroke-width: 1.4; stroke-linejoin: round; }
.art-touch { fill: var(--art-touch); }
.art-touch-ring { fill: none; stroke: var(--art-touch); stroke-opacity: 0.5; stroke-width: 2; }
.art-fold { stroke: #ffffff; stroke-opacity: 0.18; stroke-width: 1.2; stroke-dasharray: 3 3; }
.art-toolbar { fill: rgb(255 255 255 / 0.16); }
.art-toolbar-dot { fill: rgb(255 255 255 / 0.75); }
.art-key { fill: var(--art-key); }
.art-island { fill: #05081a; }
.art-pad { fill: var(--art-pad); stroke: rgb(255 255 255 / 0.12); }

.features { display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature .badge { display: inline-flex; padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; }
.feature.wide { grid-column: 1 / -1; display: grid; gap: 4px 20px; grid-template-columns: auto 1fr; align-items: start; }
.feature.wide .badge { grid-row: span 2; margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 880px) { .steps.row { grid-template-columns: repeat(3, 1fr); } }
.steps > li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 18px 64px; }
.section.alt .steps > li { background: var(--bg); }
.steps > li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--hero-from), var(--hero-mid) 60%, var(--hero-to));
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--muted); margin: 0; }
.steps p + p { margin-top: 0.6em; }
.after-steps { margin-top: 20px; color: var(--muted); }

.trust { display: grid; gap: 16px; }
@media (min-width: 760px) { .trust { grid-template-columns: repeat(3, 1fr); } }
.trust > div { display: flex; gap: 14px; align-items: flex-start; }
.trust .icon { color: var(--accent); margin-top: 3px; }
.trust h3 { margin-bottom: 4px; }
.trust p { margin: 0; color: var(--muted); }

.closing { text-align: center; }
.closing .app-icon { margin: 0 auto 18px; }
.closing .cta-row { justify-content: center; }

.app-icon { border-radius: 22.5%; box-shadow: var(--shadow); }

/* Page heads (download, support, privacy) */
.page-head { padding: 48px 0 8px; }
.page-head p.lead { font-size: 1.12rem; color: var(--muted); max-width: 40em; }
@media (min-width: 880px) { .page-head { padding: 72px 0 12px; } }

.download-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 24px 0 8px; }
@media (min-width: 880px) { .download-grid { grid-template-columns: 1.4fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h2, .card h3 { margin-bottom: 8px; }
.download-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 20px; align-items: center; }
.download-card > picture { grid-row: span 2; }
.download-card .app-icon { width: 84px; height: 84px; }
.download-card h2 { align-self: end; margin: 0; }
.download-card .meta { align-self: start; color: var(--muted); margin: 0; }
.download-card .actions { grid-column: 1 / -1; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.download-card .actions p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.download-card .checksum { grid-column: 1 / -1; margin: 12px 0 0; color: var(--muted); font-size: 0.8rem; }
.download-card .checksum code { font-size: 0.95em; }
.card .cta-row { margin: 14px 0 0; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist .icon { color: var(--accent); width: 20px; height: 20px; margin-top: 5px; }

.tips { display: grid; gap: 16px; }
@media (min-width: 760px) { .tips { grid-template-columns: repeat(2, 1fr); } }

/* Support */
.faq-group { margin: 40px 0; }
.faq-group h2 { font-size: 1.35rem; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 20px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq .answer { padding: 0 20px 18px; color: var(--muted); }
.faq .answer ul, .faq .answer ol { padding-left: 1.3em; margin: 0 0 0.8em; }
.faq .answer li { margin: 0.3em 0; }
.faq .answer > :last-child { margin-bottom: 0; }
.faq .answer strong { color: var(--text); font-weight: 600; }

.contact { display: flex; gap: 16px; align-items: flex-start; margin: 48px 0 72px; }
.contact .badge { display: inline-flex; padding: 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.contact h2 { font-size: 1.35rem; margin-bottom: 6px; }
.contact p { color: var(--muted); }
.contact p:last-child { margin-bottom: 0; }
.contact a.email { font-weight: 600; font-size: 1.1rem; }

/* Privacy */
.prose { max-width: 46em; padding-bottom: 80px; }
.prose h2 { font-size: 1.4rem; margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose .updated { color: var(--muted); }
.summary-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin: 28px 0; }
.summary-box h2 { margin-top: 0; font-size: 1.15rem; }
.summary-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.summary-box li { display: flex; gap: 12px; margin: 0; }
.summary-box .icon { color: var(--accent); margin-top: 3px; }
.toc { background: var(--surface-2); border-radius: 14px; padding: 16px 22px; margin: 0 0 12px; }
.toc p { font-weight: 600; margin-bottom: 6px; }
.toc ol { margin: 0; columns: 2 16em; column-gap: 32px; }
.toc li { margin: 0.2em 0; break-inside: avoid; }
.table-scroll { overflow-x: auto; margin: 1em 0 1.4em; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* How it works */
.diagram { margin: 24px 0 8px; }
.diagram-scroll { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px; }
.diagram-art { width: 100%; max-width: 760px; height: auto; margin: 0 auto; font-family: var(--font); }
/* The wide drawing needs about 600px to stay legible; narrower screens get the stacked one. */
.diagram-wide { display: none; }
.diagram-tall { max-width: 400px; }
@media (min-width: 640px) { .diagram-wide { display: block; } .diagram-tall { display: none; } }
.diagram figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 12px; max-width: 46em; }
.dg-box { stroke-width: 1.5; }
.dg-device { fill: var(--surface-2); stroke: var(--border); }
.dg-service { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 35%, transparent); }
.dg-relay-box { fill: var(--bg); stroke: var(--border); stroke-dasharray: 5 4; }
.dg-title { fill: var(--text); font-size: 14px; font-weight: 600; text-anchor: middle; }
.dg-sub, .dg-label { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.dg-start { text-anchor: start; } .dg-end { text-anchor: end; }
.dg-direct { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; fill: none; }
.dg-signal { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; fill: none; }
.dg-relay { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 5; fill: none; opacity: 0.7; }
.dg-lock-bg { fill: var(--accent); }
.dg-lock { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .dg-lock { stroke: #0b1020; } }

.can-cannot { display: grid; gap: 16px; margin: 1.2em 0; }
@media (min-width: 640px) { .can-cannot { grid-template-columns: 1fr 1fr; } }
.can-cannot h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.can-cannot ul { margin: 0; padding-left: 1.2em; }
.can-cannot li { color: var(--muted); }
.can-cannot .icon { width: 20px; height: 20px; color: var(--accent); }

.prose ol.flow { padding-left: 1.4em; }
.prose ol.flow li { margin: 0.7em 0; }
.prose .table-scroll table { min-width: 560px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.chips li { font-size: 0.85rem; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.section.alt .chips li { background: var(--bg); }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; margin-top: 20px; }
.more-link .icon { width: 18px; height: 18px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 36px 0 28px; font-size: 0.95rem; }
.footer-row { display: grid; gap: 20px; margin-bottom: 12px; }
@media (min-width: 760px) { .footer-row { grid-template-columns: 1fr auto; } }
.footer-row p { margin: 0 0 4px; }
.footer-brand { font-weight: 700; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: flex-start; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); }

/* Language chooser shown when JavaScript is off */
.redirect-box { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; }
.redirect-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.redirect-links a { display: block; padding: 10px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
