/* mdBrowse main site. Colors follow the app's design system (core/designsystem/Color.kt). */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --fill: rgba(118, 118, 128, 0.12);
  --label: #1d1d1f;
  --label2: #6e6e73;
  --label3: #aeaeb2;
  --line: rgba(60, 60, 67, 0.16);
  --accent: #0a66ff;
  --accent-ink: #ffffff;
  --accent-tint: rgba(10, 102, 255, 0.12);
  --brand-a: #2f7bff;
  --brand-b: #6a4dff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Thai",
    "Leelawadee UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --label: #f5f5f7;
    --label2: #98989d;
    --label3: #5a5a5f;
    --line: rgba(84, 84, 88, 0.6);
    --accent: #3d8bff;
    --accent-tint: rgba(61, 139, 255, 0.18);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 0.5px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .top { background: var(--bg); } }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--label); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top nav > a { color: var(--label); padding: 8px 10px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.top nav > a:hover { background: var(--fill); text-decoration: none; }
.top nav > a[aria-current="page"] { color: var(--accent); }

/* Language switcher: works without JS (details/summary). */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 10px; color: var(--label2); font-size: 15px; user-select: none; white-space: nowrap;
}
/* Narrow phones: the globe alone (it keeps its label for screen readers). */
@media (max-width: 440px) { .lang summary span { display: none; } }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { background: var(--fill); }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 0.5px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); min-width: 170px;
}
.lang li a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--label); }
.lang li a:hover { background: var(--fill); text-decoration: none; }
.lang li a[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px; font-weight: 600; font-size: 17px;
  border: 0; cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--accent-tint); color: var(--accent); }
.btn[aria-disabled="true"] { background: var(--fill); color: var(--label3); pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.note { color: var(--label2); font-size: 14px; }

/* Hero */
.hero { padding: 48px 0 40px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 7vw, 56px); font-weight: 800; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { margin-top: 16px; font-size: clamp(17px, 2.4vw, 20px); color: var(--label2); max-width: 36em; }
.hero .actions { margin-top: 28px; }
.hero .note { margin-top: 14px; }
@media (min-width: 860px) {
  .hero { padding: 72px 0 64px; }
  .hero .wrap { grid-template-columns: 1.15fr 1fr; }
  .phone { width: 300px; }
}

/* Phone illustration (decorative, drawn in CSS so there is no fake screenshot to keep current) */
.phone {
  justify-self: center; width: min(240px, 62vw); aspect-ratio: 9 / 18.5;
  border-radius: 44px; padding: 12px; background: #111114;
  box-shadow: 0 30px 60px rgba(20, 30, 80, 0.25), inset 0 0 0 2px #2a2a2e;
}
.phone .screen {
  height: 100%; border-radius: 34px; overflow: hidden; background: #f2f2f7;
  display: flex; flex-direction: column; align-items: center; padding: 18% 9% 0; gap: 7%;
}
.ph-logo { font: 800 clamp(20px, 6vw, 26px)/1 var(--font); color: #1d1d1f; letter-spacing: -0.02em; }
.ph-search {
  width: 100%; height: 38px; border-radius: 19px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex; align-items: center; padding: 0 14px;
}
.ph-search::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #aeaeb2;
}
.ph-search::after { content: ""; margin-left: 10px; height: 8px; width: 46%; border-radius: 4px; background: #e5e5ea; }
.ph-grid { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 0; justify-items: center; }
.ph-grid i { width: 74%; aspect-ratio: 1; border-radius: 28%; display: block; }
.ph-grid i:nth-child(1) { background: #ff6a3d; } .ph-grid i:nth-child(2) { background: #2f7bff; }
.ph-grid i:nth-child(3) { background: #34c759; } .ph-grid i:nth-child(4) { background: #ffcc00; }
.ph-grid i:nth-child(5) { background: #6a4dff; } .ph-grid i:nth-child(6) { background: #ff2d55; }
.ph-grid i:nth-child(7) { background: #1fc7c1; } .ph-grid i:nth-child(8) { background: #8e8e93; }
.ph-news { width: 100%; background: #fff; border-radius: 14px; padding: 12px; display: flex; gap: 10px; }
.ph-news .img { width: 54px; height: 54px; border-radius: 9px; flex: none; background: linear-gradient(135deg, #c7d7ff, #e2d9ff); }
.ph-news .txt { flex: 1; display: flex; flex-direction: column; gap: 7px; padding-top: 3px; }
.ph-news b { display: block; height: 8px; border-radius: 4px; background: #d1d1d6; }
.ph-news b.short { width: 55%; background: #e5e5ea; }

/* Sections */
section { padding: 40px 0; }
.sec-title { font-size: clamp(26px, 4.5vw, 36px); font-weight: 800; text-align: center; }
.sec-lead { color: var(--label2); text-align: center; margin: 10px auto 0; max-width: 36em; font-size: 17px; }
.features { margin-top: 32px; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .features { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent); margin-bottom: 14px;
}
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 19px; }
.feature p { margin-top: 6px; color: var(--label2); }

.band {
  border-radius: 24px; padding: 32px 22px; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
}
.band h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.band p { margin: 10px auto 0; max-width: 34em; opacity: 0.92; font-size: 17px; }
.band .btn { margin-top: 22px; background: #fff; color: #2f5bff; }
.band a.link { color: #fff; text-decoration: underline; }

/* Download page */
.dl-head { padding: 40px 0 8px; text-align: center; }
.dl-head h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 800; }
.dl-head p { margin-top: 10px; color: var(--label2); font-size: 18px; }
.release { max-width: 560px; margin: 28px auto 0; text-align: center; padding: 28px 22px; }
.release img { margin: 0 auto 14px; }
.release h2 { font-size: 22px; }
.release .meta { margin-top: 6px; color: var(--label2); }
.nb { white-space: nowrap; }
.release .actions { justify-content: center; margin-top: 20px; }
.release .btn { width: 100%; max-width: 360px; }
.sha { margin-top: 22px; text-align: left; background: var(--fill); border-radius: 12px; padding: 12px 14px; }
.sha .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sha .k { font-size: 13px; color: var(--label2); font-weight: 600; }
.sha code {
  display: block; margin-top: 6px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all; color: var(--label);
}
.sha button {
  border: 0; background: none; color: var(--accent); font: 600 14px var(--font); cursor: pointer; padding: 4px 6px;
}
.hint {
  max-width: 560px; margin: 16px auto 0; padding: 14px 16px; border-radius: 14px;
  background: var(--accent-tint); color: var(--label); font-size: 15px; text-align: center;
}
.steps { max-width: 760px; margin: 28px auto 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .n {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700;
}
.steps p { padding-top: 3px; }
.faq { max-width: 760px; margin: 28px auto 0; display: grid; gap: 10px; }
.faq details { background: var(--surface); border-radius: 14px; padding: 0 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--label3); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 16px; color: var(--label2); }

/* Footer */
footer { margin-top: 32px; padding: 28px 0 40px; border-top: 0.5px solid var(--line); color: var(--label2); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--label2); }
footer .copy { margin-left: auto; }

/* Language picker page (shown only when JS and the server redirect are both missing) */
.pick { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.pick ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.pick a { display: block; padding: 12px 28px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.pick img { margin: 0 auto; }
.pick .nf { margin-top: 20px; display: grid; gap: 8px; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: filter 0.15s ease; }
}
