/* Shared site primitives. Native app previews keep their isolated styles. */
:root {
  color-scheme: light;
  --bg:#fafafa;
  --surface:#f1f1f4;
  --raised:#fff;
  --ink:#1b1b1e;
  --muted:#62626c;
  --dim:#73737d;
  --line:#e4e4e9;
  --border:#d6d6df;
  --accent:#54545f;
  --accent-soft:#eaeaef;
  --button:#242427;
  --button-ink:#fff;
  --shadow:#18181f12;
  --heading:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-family:var(--heading);
  --title-soft:#777782;
}

:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#141416;
  --surface:#1c1c20;
  --raised:#232327;
  --ink:#f3f3f6;
  --muted:#b5b5c0;
  --dim:#a2a2b0;
  --line:#303037;
  --border:#45454f;
  --accent:#d7d7e2;
  --accent-soft:#303037;
  --button:#eeeeF2;
  --button-ink:#1b1b1e;
  --shadow:#0004;
  --title-soft:#a1a1ae;
}

* {
  box-sizing:border-box;
}

html {
  scroll-behavior:smooth;
  scroll-padding-top:100px;
}

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

.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}

button,select,input {
  font:inherit;
}

button,a {
  -webkit-tap-highlight-color:transparent;
}

button {
  cursor:pointer;
  color:inherit;
}

a {
  color:inherit;
  text-decoration:none;
}

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

h1,h2,h3,p {
  margin:0;
}

h1,h2,h3 {
  font-family:var(--heading);
}

h2 {
  font-size:clamp(30px,3.8vw,46px);
  font-weight:560;
  line-height:1.28;
  letter-spacing:-.045em;
}

svg {
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex-shrink:0;
}

:where(button,a,summary,select,input):focus-visible {
  outline:2px solid var(--accent);
  outline-offset:5px;
}

[hidden] {
  display:none!important;
}

::selection {
  background:var(--accent-soft);
  color:var(--ink);
}

.container {
  width:min(1120px,calc(100% - 96px));
  margin-inline:auto;
}

.icon-sprite {
  position:absolute;
  width:0;
  height:0;
  overflow:hidden;
}

.skip-link {
  position:fixed;
  top:-80px;
  left:20px;
  z-index:50;
  padding:12px 20px;
  border-radius:8px;
  color:var(--button-ink);
  background:var(--button);
}

.skip-link:focus {
  top:15px;
}

.eyebrow {
  color:var(--muted);
  font:500 10px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.14em;
}

.text-link {
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--ink);
  font-size:13px;
}

.text-link:hover {
  color:var(--accent);
}

.text-link svg {
  width:16px;
  height:16px;
  transition:transform .2s;
}

.text-link:hover svg {
  transform:translateX(3px);
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:48px;
  padding:12px 21px;
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--ink);
  background:transparent;
  font-size:14px;
  font-weight:550;
  line-height:1.5;
  text-align:center;
  transition:background .2s,box-shadow .2s,transform .2s;
}

.button:active {
  transform:translateY(1px);
}

.button:hover {
  background:var(--surface);
  transform:translateY(-1px);
}

.button-primary,.button-small {
  border-radius:999px;
  border-color:var(--button);
  color:var(--button-ink);
  background:var(--button);
  box-shadow:0 2px 3px var(--shadow),inset 0 1px 0 #ffffff18;
}

.button-primary:hover,.button-small:hover {
  color:var(--button-ink);
  background:var(--button);
  box-shadow:0 5px 12px var(--shadow);
}

.button-small {
  white-space:nowrap;
  min-height:37px;
  padding:8px 13px;
  font-size:12px;
  border-radius:999px;
}

.button svg {
  width:16px;
  height:16px;
}

.icon-button {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
}

.icon-button:hover {
  background:var(--surface);
}

.icon-button svg {
  width:17px;
  height:17px;
}

.site-header {
  position:sticky;
  top:0;
  z-index:20;
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--bg) 92%,transparent);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

.header-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  min-height:76px;
}

.brand {
  display:inline-flex;
  align-items:center;
  gap:9px;
  flex-shrink:0;
  font-size:21px;
  line-height:1;
  font-weight:650;
  letter-spacing:-.065em;
}

.brand-mark,.brand>svg {
  width:31px;
  height:31px;
  stroke-width:1.7;
}

.brand-period {
  color:var(--accent);
}

.brand>img {
  width:36px;
  border-radius:10px;
}

.desktop-nav {
  display:flex;
  align-items:center;
  gap:27px;
  margin-left:auto;
  color:var(--muted);
  font-size:13px;
}

.desktop-nav a:hover {
  color:var(--ink);
}

.header-actions {
  display:flex;
  align-items:center;
  gap:9px;
}

.language-switch select {
  max-width:90px;
  min-height:36px;
  padding:5px 3px;
  border:0;
  border-radius:4px;
  background:var(--bg);
  color:var(--muted);
  font-size:11px;
  cursor:pointer;
}

.menu-toggle {
  display:none;
}

.mobile-nav {
  position:absolute;
  top:calc(100% + 8px);
  right:20px;
  width:min(280px,calc(100% - 40px));
  padding:10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--raised);
  box-shadow:0 16px 40px var(--shadow);
}

.mobile-nav a {
  display:block;
  padding:12px;
  border-radius:5px;
  font-size:14px;
}

.mobile-nav a:hover {
  background:var(--surface);
}

.site-footer {
  padding-top:35px;
  padding-bottom:25px;
}

.footer-top {
  display:flex;
  align-items:center;
  gap:28px;
  padding-bottom:36px;
}

.footer-tagline {
  color:var(--dim);
  font:italic 15px Georgia,"Times New Roman",serif;
}

.footer-links {
  display:flex;
  flex-wrap:wrap;
  gap:23px;
  margin-left:auto;
  font-size:11px;
  color:var(--muted);
}

.footer-links a:hover,.footer-colophon a:hover {
  color:var(--accent);
}

.footer-colophon {
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding-top:20px;
  border-top:1px solid var(--line);
  color:var(--dim);
  font:9px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.05em;
}

@media(max-width:1024px) {
  .desktop-nav {
    display:none;
  }
  .menu-toggle {
    display:grid;
  }
  .header-actions {
    margin-left:auto;
  }
}

@media(max-width:960px) {
  .desktop-nav {
    gap:16px;
  }
  .header-inner {
    gap:20px;
  }
  .header-actions {
    gap:3px;
  }
}

@media(max-width:800px) {
  .container {
    width:calc(100% - 48px);
  }
  .desktop-nav {
    display:none;
  }
  .header-actions {
    margin-left:auto;
    gap:7px;
  }
  .menu-toggle {
    display:grid;
  }
  .footer-tagline {
    display:none;
  }
}

@media(max-width:480px) {
  .header-actions > .button-small {
    display:none;
  }
  .container {
    width:calc(100% - 40px);
  }
  .header-inner {
    min-height:66px;
    gap:8px;
  }
  .brand {
    font-size:19px;
    gap:6px;
  }
  .brand-mark {
    width:27px;
    height:27px;
  }
  .header-actions {
    gap:2px;
  }
  .language-switch select {
    max-width:72px;
    font-size:10px;
  }
  .header-actions .button-small {
    padding:7px 10px;
    font-size:10px;
  }
  .header-actions .button-small svg {
    display:none;
  }
  .icon-button {
    width:31px;
  }
  .footer-top {
    align-items:flex-start;
    gap:25px;
  }
  .footer-links {
    flex-direction:column;
    gap:12px;
  }
  .footer-colophon>span:nth-child(2) {
    display:none;
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto;
  }
  *,*::before,*::after {
    animation:none!important;
    transition:none!important;
  }
}

:root:lang(zh-Hant) { --heading:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang TC","Microsoft JhengHei",sans-serif; }
