:root {
  --bg: #06090e;
  --panel: rgba(13, 19, 29, 0.78);
  --panel-solid: #0d131d;
  --line: rgba(126, 166, 214, 0.16);
  --line-strong: rgba(126, 166, 214, 0.32);
  --text: #e9eef5;
  --muted: #8d9cb1;
  --accent: #5cb8ff;
  --accent-soft: rgba(92, 184, 255, 0.14);
  --swiss: #e30613;
  --radius: 22px;
  --display: "Unbounded", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", "IBM Plex Sans Thai", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
:lang(th) { --body: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, sans-serif; }
:lang(zh) { --body: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
:lang(th) body, body:lang(th) { line-height: 1.75; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 30% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 0%, #000 0%, transparent 75%);
  opacity: 0.55;
}
.bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 420px at 15% -5%, rgba(40, 120, 220, 0.35), transparent 70%),
    radial-gradient(520px 520px at 100% 100%, rgba(20, 70, 150, 0.28), transparent 70%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, calc((100% - 1088px) / 2)) 8px;
  background: rgba(6, 9, 14, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mark { font: 700 18px/1 var(--display); letter-spacing: 0.02em; }
.mark span { color: var(--accent); }
.langs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); backdrop-filter: blur(10px); }
.langs button {
  font: 500 12.5px/1 var(--mono); letter-spacing: 0.04em;
  min-height: 38px; min-width: 44px; padding: 8px 12px; border-radius: 999px; color: var(--muted);
  transition: background-color .2s, color .2s;
}
.langs button[lang="th"], .langs button[data-lang="th"] { font-family: "IBM Plex Sans Thai", var(--mono); }
.langs button:hover { color: var(--text); }
.langs button[aria-pressed="true"] { background: var(--accent); color: #031120; }

.lang-hint {
  display: flex; align-items: center; gap: 8px;
  margin: 2px auto 0; max-width: calc(100% - 32px); width: max-content;
  padding: 9px 16px; border-radius: 999px;
  background: var(--accent); color: #031120; font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 30px -10px rgba(92, 184, 255, 0.8);
  animation: rise .5s .4s cubic-bezier(.2,.8,.2,1) both;
}
.lang-hint[hidden] { display: none; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1120px; margin: 0 auto;
  padding: 10px 16px calc(40px + env(safe-area-inset-bottom));
  display: grid; gap: 18px;
}
@media (min-width: 960px) {
  .layout { grid-template-columns: 420px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 22px; }
}

/* ---------- Identity card ---------- */
.id-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

.portrait {
  position: relative; margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1018;
  isolation: isolate;
}
@media (max-width: 959px) { .portrait { aspect-ratio: 1 / 1; } .portrait img { object-position: 50% 22%; } }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-human img { filter: saturate(0.92) contrast(1.03); }
.p-ai { opacity: 0; transition: opacity .35s ease; }
.portrait[data-mode="ai"] .p-ai { opacity: 1; }
.portrait.glitch .p-ai { animation: glitch .55s steps(2, end); }
@keyframes glitch {
  0%   { clip-path: inset(10% 0 70% 0); transform: translateX(-8px); opacity: 1; }
  20%  { clip-path: inset(55% 0 20% 0); transform: translateX(8px); }
  40%  { clip-path: inset(30% 0 45% 0); transform: translateX(-4px); }
  60%  { clip-path: inset(75% 0 5% 0);  transform: translateX(6px); }
  80%  { clip-path: inset(0 0 85% 0);   transform: translateX(-2px); }
  100% { clip-path: inset(0 0 0 0);     transform: none; }
}
.portrait::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(6, 9, 14, 0.75));
}
.scan {
  position: absolute; left: 0; right: 0; top: -20%; height: 18%; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(92, 184, 255, 0.28), transparent);
  animation: scan 2.6s 0.6s ease-in-out 1 both;
}
.portrait.glitch .scan { animation: scan 1s ease-in-out 1 both; }
@keyframes scan { from { top: -20%; } to { top: 110%; } }

.mode {
  position: absolute; z-index: 3; left: 12px; bottom: 12px;
  display: flex; padding: 3px; gap: 2px;
  border-radius: 999px; background: rgba(6, 9, 14, 0.72);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mode button { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; color: var(--muted); transition: background-color .2s, color .2s; }
.mode button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.id-text { padding: 18px 6px 4px; }
.kicker { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font: 500 12.5px/1.4 var(--mono); color: var(--muted); }
:lang(th) .kicker, :lang(zh) .kicker { font-family: var(--body); font-size: 13.5px; }
.flag { width: 16px; height: 16px; border-radius: 3px; flex: none; }
.flag.ch {
  background:
    linear-gradient(#fff, #fff) center / 10px 3.2px no-repeat,
    linear-gradient(#fff, #fff) center / 3.2px 10px no-repeat,
    var(--swiss);
}
.flag.th { width: 22px; height: 15px; border-radius: 2px; background: linear-gradient(#a51931 0 16.6%, #f4f5f8 0 33.3%, #2d2a4a 0 66.6%, #f4f5f8 0 83.3%, #a51931 0); }
h1 {
  margin: 0;
  font: 700 clamp(2.5rem, 11vw, 3.4rem)/0.98 var(--display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.role { margin: 14px 0 2px; color: var(--muted); font-size: 15px; }
.orgs { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 700 15px/1.3 var(--display); letter-spacing: .02em; }
.orgs a { color: var(--accent); }
.orgs a:hover { text-decoration: underline; text-underline-offset: 4px; }
.orgs i { color: var(--muted); font-style: normal; }
.tagline { margin: 14px 0 0; color: #c5d0de; font-size: 15.5px; }
.sourcing-chip {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(92, 184, 255, 0.45); background: var(--accent-soft);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.sourcing-chip:hover { border-color: var(--accent); }

.save {
  margin: 18px 0 10px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; border-radius: 16px;
  background: var(--accent); color: #031120;
  font-weight: 600; font-size: 17px;
  box-shadow: 0 12px 30px -10px rgba(92, 184, 255, 0.7), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s ease, box-shadow .2s;
}
.save:hover { box-shadow: 0 16px 40px -10px rgba(92, 184, 255, 0.9), inset 0 1px 0 rgba(255,255,255,.4); }
.save:active { transform: scale(0.98); }

.actions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions a, .actions button {
  width: 100%; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12.5px; color: #cdd7e4;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.actions a:hover, .actions button:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.actions a:active, .actions button:active { transform: scale(0.96); }
.actions svg { color: var(--accent); }
.phone { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.phone i { font-style: normal; opacity: .5; padding: 0 4px; }
.phone a { color: var(--accent); }
.phone a:hover { text-decoration: underline; }

/* ---------- QR ---------- */
.qr { margin-top: 16px; border-top: 1px dashed var(--line-strong); padding-top: 16px; }
.qr-tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 12px; }
.qr-tabs button { font-size: 13px; padding: 7px 14px; border-radius: 999px; color: var(--muted); }
.qr-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.qr-body { display: grid; grid-template-columns: 148px 1fr; gap: 14px; align-items: center; }
.qr-code { background: #fff; border-radius: 14px; padding: 8px; }
.qr-code img { width: 100%; height: auto; image-rendering: pixelated; }
.qr-code img.qr-wechat { image-rendering: auto; }
.qr-title { margin: 0 0 4px; font-weight: 600; }
.qr-hint { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.qr-links { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.qr-links .share, .qr-dl { font-size: 12px; color: var(--accent); }
.qr-links .share:hover, .qr-dl:hover { text-decoration: underline; }

/* ---------- Content ---------- */
.content { display: grid; gap: 18px; min-width: 0; }
.label { margin: 0 0 14px; font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
:lang(th) .label, :lang(zh) .label { font-family: var(--body); letter-spacing: .04em; font-size: 13px; }
.brand { font: 700 clamp(1.5rem, 6vw, 2rem)/1.05 var(--display); letter-spacing: -0.01em; margin: 0; }
.go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font: 500 13.5px/1 var(--mono); color: var(--accent); padding: 9px 0; }
.go span { transition: transform .2s; }
.go:hover span { transform: translate(2px, -2px); }

.now {
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  padding: 24px;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(92, 184, 255, 0.22), transparent 70%),
    linear-gradient(160deg, #0f2036, #0b1220 60%);
  border: 1px solid rgba(92, 184, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(92, 184, 255, 0.08), 0 24px 60px -24px rgba(92, 184, 255, 0.45);
}
.now .label { color: var(--accent); }
.now .brand { font-size: clamp(2.2rem, 9vw, 3rem); }
.now p:not(.label) { margin: 10px 0 0; color: #cdd7e4; max-width: 52ch; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(92,184,255,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(92,184,255,0); } 100% { box-shadow: 0 0 0 0 rgba(92,184,255,0); } }

.block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px); padding: 22px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.co + .co { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.co-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.co-head .brand { font-size: 1.35rem; }
.tag { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
:lang(th) .tag, :lang(zh) .tag { font-family: var(--body); font-size: 12.5px; }
.co p { margin: 10px 0 0; color: #c5d0de; }

.mission {
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--line);
  background:
    radial-gradient(360px 300px at 85% 20%, rgba(92, 184, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #0d1522, #080c13);
}
.mission img {
  position: absolute; right: -30px; top: 0;
  width: min(78%, 340px); height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.6));
  mask-image: linear-gradient(180deg, #000 45%, transparent 88%);
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 88%);
}
.mission-text { position: relative; padding: 300px 24px 24px; background: linear-gradient(180deg, transparent 150px, rgba(8,12,19,.94) 290px); }
@media (min-width: 640px) {
  .mission { min-height: 400px; display: grid; align-items: center; }
  .mission img { width: 330px; right: -20px; }
  .mission-text { padding: 28px; max-width: 58%; background: none; }
}
.mission .brand { font-size: clamp(2rem, 8vw, 2.6rem); }
.mission .brand em { font-style: normal; color: var(--accent); }
.quote { margin: 12px 0 0; font: 500 1.15rem/1.4 var(--body); color: var(--text); }
:lang(en) .quote, :lang(de) .quote { font-family: var(--display); font-size: 1.02rem; line-height: 1.45; }
.mission p:not(.quote) { margin: 10px 0 0; color: #c5d0de; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); font-size: 14px; }
.chips li:nth-child(-n+2) { border-color: rgba(92,184,255,.5); background: var(--accent-soft); }

.edu { list-style: none; margin: 0; padding: 0; counter-reset: e; }
.edu li { counter-increment: e; position: relative; padding: 0 0 16px 42px; }
.edu li:last-child { padding-bottom: 0; }
.edu li::before {
  content: "0" counter(e); position: absolute; left: 0; top: 2px;
  font: 500 12px/1 var(--mono); color: var(--accent);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 6px;
}
.edu strong { display: block; font-weight: 600; }
.edu span { display: block; color: var(--muted); font-size: 14.5px; }

.social { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.social a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px;
  border-radius: 14px; border: 1px solid var(--line); font-size: 13px; color: #cdd7e4;
  transition: border-color .2s, background-color .2s;
}
.social a:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.social svg { color: var(--accent); }

.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 4px 6px; }
.offline::before { content: "●"; color: #4ade80; margin-right: 6px; }

/* ---------- Sourcing ---------- */
.sourcing {
  scroll-margin-top: 70px;
  border-radius: calc(var(--radius) + 6px);
  padding: 22px;
  background:
    radial-gradient(420px 240px at 0% 0%, rgba(92, 184, 255, 0.16), transparent 70%),
    var(--panel);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.src-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.src-head .label { margin: 0; color: var(--accent); }
.src-head .tag { border-color: rgba(92, 184, 255, 0.45); color: var(--text); }
.src-intro { margin: 10px 0 16px; color: #c5d0de; }
.src { border-top: 1px solid var(--line); padding: 16px 0; }
.src-main { border: 1px solid rgba(92, 184, 255, 0.4); border-radius: 18px; padding: 16px; background: rgba(92, 184, 255, 0.06); margin-bottom: 4px; }
.src-title { display: flex; align-items: center; gap: 12px; }
.src-title svg { color: var(--accent); width: 26px; height: 26px; }
.src-title h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.src-brand { font: 700 14px/1.3 var(--display); letter-spacing: .03em; color: var(--accent); }
.src p { margin: 8px 0 0 38px; color: #c5d0de; font-size: 15px; }
.src ul { margin: 10px 0 0 38px; padding: 0; list-style: none; display: grid; gap: 6px; }
.src li { position: relative; padding-left: 16px; color: #dbe3ee; font-size: 15px; line-height: 1.5; }
.src li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.src .volume {
  display: inline-block; margin: 12px 0 0 38px; padding: 6px 12px; border-radius: 10px;
  background: var(--accent); color: #031120; font-size: 13px; font-weight: 500;
}
:lang(th) .src .volume, :lang(zh) .src .volume { font-family: var(--body); font-size: 14px; }
.src-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.src-btn {
  flex: 1 1 auto; text-align: center; min-height: 44px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.03);
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: border-color .2s, background-color .2s;
}
.src-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.src-btn:first-child { background: #07c160; border-color: #07c160; color: #fff; }

/* ---------- Floating save (mobile) ---------- */
.float-save {
  position: fixed; left: 16px; right: 16px; z-index: 9;
  bottom: calc(14px + env(safe-area-inset-bottom));
  margin: 0; min-height: 52px;
  transform: translateY(140%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.float-save.show { transform: none; }
@media (min-width: 960px) { .float-save { display: none; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 10;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); width: max-content;
  padding: 12px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 500;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.7);
  transition: opacity .25s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Load reveal ---------- */
.reveal { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.content > .reveal:nth-child(1) { animation-delay: .12s; }
.content > .reveal:nth-child(2) { animation-delay: .2s; }
.content > .reveal:nth-child(3) { animation-delay: .28s; }
.content > .reveal:nth-child(4) { animation-delay: .36s; }
.content > .reveal:nth-child(5) { animation-delay: .44s; }
.content > .reveal:nth-child(6) { animation-delay: .52s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
