/* =========================================================
   TuyaOpen Ecosystem — light, elegant, phone-first
   Palette in OKLCH. Restrained strategy: pure-white surfaces,
   one committed deep-green accent carries the brand.
   ========================================================= */

:root {
  /* surfaces */
  --bg:          oklch(1.000 0.000 0);
  --bg-soft:     oklch(0.975 0.000 0);
  --bg-tint:     oklch(0.985 0.006 150);

  /* ink */
  --ink:         oklch(0.220 0.012 150);
  --ink-soft:    oklch(0.420 0.010 150);
  --muted:       oklch(0.550 0.008 150);

  /* brand accent (deep forest green) */
  --accent:      oklch(0.520 0.110 150);
  --accent-deep: oklch(0.420 0.110 150);
  --accent-soft: oklch(0.950 0.022 150);
  --accent-line: oklch(0.880 0.040 150);
  --on-accent:   oklch(0.995 0.000 0);

  /* lines */
  --line:        oklch(0.905 0.004 150);
  --line-strong: oklch(0.840 0.008 150);

  /* shape */
  --radius:     16px;
  --radius-sm:  11px;
  --radius-xs:  8px;
  --shadow-sm:  0 1px 2px oklch(0.22 0.02 150 / 0.06), 0 1px 1px oklch(0.22 0.02 150 / 0.04);
  --shadow:     0 4px 14px -6px oklch(0.22 0.04 150 / 0.12), 0 2px 4px -2px oklch(0.22 0.04 150 / 0.06);
  --shadow-lg:  0 24px 48px -20px oklch(0.22 0.06 150 / 0.22), 0 8px 16px -8px oklch(0.22 0.06 150 / 0.10);

  --maxw: 1080px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1); /* ease-out-quart */
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px;
  border-radius: var(--radius-xs); font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(1 0 0 / 0.78);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-t);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand-mark {
  height: 44px !important; width: auto !important;
  object-fit: contain; flex: none;
  display: block;
}
.footer-brand .brand-mark { height: 40px !important; }

/* Digital name-card badge */
.namecard-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 4px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
  color: var(--accent-deep);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  white-space: nowrap;
}
.namecard-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
@media (max-width: 420px) {
  /* keep the header tidy on very narrow phones */
  .namecard-badge { font-size: 10px; padding: 4px 8px; }
}

.lang-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-btn {
  border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] {
  background: var(--ink); color: var(--bg);
}

/* Compact header on phones: keep logo + name-card badge + lang toggle
   from overlapping. Smaller toggle, shorter labels, tighter spacing. */
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .header-inner { height: 60px; }
  .brand-mark { height: 34px !important; }
  .lang-toggle { padding: 2px; }
  .lang-btn { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 460px) {
  .brand-mark { height: 32px !important; }
  .namecard-badge {
    font-size: 10px; padding: 3px 7px; letter-spacing: 0;
  }
  .namecard-badge::before { width: 5px; height: 5px; }
}
@media (max-width: 420px) {
  /* name-card badge also appears in the hero, so it's safe to hide here
     to guarantee the logo and lang toggle never overlap on small phones */
  .namecard-badge { display: none; }
  .brand-mark { height: 30px !important; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: clamp(48px, 10vw, 92px) 0 clamp(36px, 7vw, 64px);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(58% 60% at 82% -8%, oklch(0.52 0.11 150 / 0.10), transparent 60%),
    radial-gradient(46% 50% at 8% 6%, oklch(0.42 0.11 150 / 0.07), transparent 62%);
}
.hero-content { text-align: center; position: relative; }

/* Event welcome (shown in hero when ?event= is present) */
.event-welcome {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 16px;
  font-size: 13px; font-weight: 650; letter-spacing: 0.01em;
  color: var(--on-accent);
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 6px 18px -6px oklch(0.52 0.11 150 / 0.6);
}
.event-welcome::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--on-accent); opacity: 0.9;
}
.event-welcome[hidden] { display: none; }

/* Event links section */
.event-section { padding: clamp(32px, 6vw, 52px) 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.event-section[hidden] { display: none; }
.event-title { margin: 0; font-size: clamp(20px, 5vw, 26px); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.event-subtitle { margin: 8px 0 18px; color: var(--ink-soft); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.event-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.event-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink);
  min-height: 44px;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.event-links a:hover { transform: translateY(-1px); border-color: var(--accent-line); background: var(--accent-soft); }
.event-links .ev-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-deep);
  padding: 6px 13px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.hero h1 {
  margin: 0 auto; max-width: 18ch;
  font-size: clamp(30px, 7.5vw, 52px);
  line-height: 1.06; font-weight: 720; letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}
.hero-sub {
  margin: 18px auto 0; max-width: 52ch;
  color: var(--ink-soft); font-size: clamp(15px, 3.8vw, 18px);
  line-height: 1.55;
  text-wrap: pretty;
}

/* ===== Banner + One-pager visuals ===== */
.visuals {
  padding: clamp(32px, 6vw, 56px) 0 clamp(40px, 7vw, 64px);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: clamp(20px, 4vw, 32px);
}
.banner-img,
.onepager-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: #fff;
}

/* ===== Section heads ===== */
.section-head { margin-bottom: 26px; }
.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700; letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}
.section-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; text-wrap: pretty; }

/* ===== Cards ===== */
.cards-section { padding: clamp(48px, 8vw, 80px) 0; }
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 22px 56px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  overflow: hidden;
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid var(--accent-line);
}
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge-accent {
  background: var(--accent-soft); color: var(--accent-deep);
  border-color: var(--accent-line);
}
.card-title { margin: 0; font-size: 17px; font-weight: 660; letter-spacing: -0.012em; color: var(--ink); }
.card-sub { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; flex: 1 1 auto; }
.card-cta {
  position: absolute; right: 20px; bottom: 20px;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.card:hover .card-cta { color: var(--accent); transform: translate(2px, -2px); background: var(--accent-soft); border-color: var(--accent-line); }

/* ===== Staff / Reach out ===== */
.staff-section { padding: clamp(48px, 8vw, 80px) 0; background: var(--bg-soft); border-top: 1px solid var(--line); }
.staff-card {
  display: grid; gap: 18px;
  padding: 26px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.staff-head { display: flex; align-items: center; gap: 16px; }
.staff-photo {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
}
.staff-name { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -0.015em; color: var(--ink); }
.staff-title { margin: 5px 0 0; color: var(--accent-deep); font-size: 14px; font-weight: 600; }
.staff-bio { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.staff-channels { display: flex; flex-wrap: wrap; gap: 10px; }
.channel {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 15px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
  min-height: 44px; cursor: pointer;
  font-family: inherit;
}
.channel:hover { transform: translateY(-1px); border-color: var(--accent-line); background: var(--accent-soft); }
.channel svg, .channel-icon { color: var(--accent-deep); flex: none; }
.channel-icon { border-radius: 4px; }
.staff-notfound {
  padding: 26px; border-radius: var(--radius); text-align: center;
  background: var(--bg); border: 1px solid var(--line);
}
.staff-notfound h3 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.staff-notfound p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 40px 0 calc(28px + var(--safe-b));
}
.footer-inner {
  display: flex; flex-direction: column; gap: 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); }
.footer-tag { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.social-title { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.social-link {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
  min-height: 44px;
}
.social-link:hover { color: var(--ink); border-color: var(--accent-line); transform: translateY(-1px); background: var(--accent-soft); }
.social-link svg { color: var(--accent-deep); }
.footer-base { padding-top: 18px; color: var(--muted); font-size: 13px; }

/* ===== FAB ===== */
.fab {
  position: fixed; right: 18px; bottom: calc(20px + var(--safe-b)); z-index: 60;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 18px; border: 0; cursor: pointer;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font: inherit; font-size: 14px; font-weight: 650; letter-spacing: -0.005em;
  box-shadow: var(--shadow-lg);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.fab:hover { transform: translateY(-2px); background: var(--accent-deep); }
.fab:active { transform: translateY(0); }
.fab-label { line-height: 1; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; padding: 0; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: oklch(0.18 0.02 150 / 0.42);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade 0.2s var(--ease);
}
.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  padding: 26px 22px calc(22px + var(--safe-b));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetUp 0.28s var(--ease);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-soft);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.modal-close:hover { color: var(--ink); background: var(--bg-tint); }
.modal-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.modal-sub { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

.bm-steps { display: grid; gap: 12px; margin-bottom: 22px; }
.bm-step {
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.bm-step.is-active { background: var(--accent-soft); border-color: var(--accent-line); }
.bm-step h3 { margin: 0 0 8px; font-size: 14px; font-weight: 660; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.bm-step h3::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.bm-step ol { margin: 0; padding-left: 20px; }
.bm-step li { margin: 4px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.qr-block {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.qr-text { flex: 1; min-width: 0; }
.qr-text h3 { margin: 0 0 4px; font-size: 14px; font-weight: 660; color: var(--ink); }
.qr-text p { margin: 0; color: var(--muted); font-size: 13px; }
.qr-code {
  width: 116px; height: 116px; flex: none;
  background: #fff; border-radius: 12px; padding: 8px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.qr-code canvas, .qr-code img { width: 100%; height: 100%; display: block; border-radius: 6px; }

/* ===== Animations ===== */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .staff-card { grid-template-columns: auto 1fr; align-items: start; }
  .staff-channels { grid-column: 1 / -1; }
  .footer-inner { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .modal { place-items: center; padding: 20px; }
  .modal-panel { border-radius: 22px; max-width: 460px; }
}
@media (min-width: 1100px) {
  .qr-block { gap: 20px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
