/* ==========================================================================
   Alvin Lab — global stylesheet
   Tokens → reset → typography → components → header/footer → motion
   ========================================================================== */

/* ---------- font ---------- */
@font-face {
  font-family: "InterV";
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "InterV";
  src: url("../fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "InterV";
  src: url("../fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "InterV";
  src: url("../fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}

/* ---------- tokens ---------- */
:root {
  /* brand, sampled from the logo */
  --brand-950: #001030;
  --brand-900: #001848;
  --brand-800: #003078;
  --brand-700: #00489c;
  --brand-600: #0060c0;
  --brand-500: #0084e4;
  --brand-400: #00a8f0;
  --brand-300: #4cc4f7;
  --brand-100: #e3f4fe;

  /* neutrals */
  --ink: #06172c;
  --ink-2: #10263f;
  --muted: #5a6b80;
  --muted-2: #8494a8;
  --line: #e3e9f2;
  --line-2: #eef2f7;
  --paper: #ffffff;
  --paper-2: #f6f8fb;
  --paper-3: #eef3f9;

  /* type */
  --font: "InterV", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* size */
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(64px, 8vw, 112px);
  --radius: 14px;
  --radius-lg: 22px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(6, 23, 44, 0.06);
  --sh-2: 0 2px 6px rgba(6, 23, 44, 0.06), 0 12px 28px -16px rgba(6, 23, 44, 0.22);
  --sh-3: 0 30px 60px -28px rgba(0, 24, 72, 0.35), 0 2px 8px rgba(0, 24, 72, 0.08);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 72px;
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
/* 图标默认尺寸：任何没被单独指定大小的 svg 都不会撑成一大块 */
svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
::selection {
  background: var(--brand-500);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: var(--section);
}
.section--tight {
  padding-block: clamp(48px, 5vw, 72px);
}
.section--paper {
  background: var(--paper-2);
}
.section--ink {
  background: var(--brand-950);
  color: #eaf2fb;
}
.center {
  text-align: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* 锚点跳转时让开粘性页头 */
[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ---------- typography ---------- */
.display {
  font-size: clamp(2.35rem, 5.4vw, 4.15rem);
  line-height: 1.04;
  letter-spacing: -0.033em;
  font-weight: 600;
  text-wrap: balance;
}
.h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 600;
  text-wrap: balance;
}
.h3 {
  font-size: clamp(1.25rem, 1.7vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 600;
}
.lede {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem);
  line-height: 1.62;
  color: var(--muted);
  max-width: 62ch;
  text-wrap: pretty;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-600);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}
.section--ink .eyebrow {
  color: var(--brand-300);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.mono {
  font-family: var(--mono);
  letter-spacing: -0.01em;
}
.section-head {
  max-width: 720px;
}
.section-head .h2 {
  margin-top: 14px;
}
.section-head .lede {
  margin-top: 16px;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--brand-500);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 24, 72, 0.12), 0 10px 22px -12px rgba(0, 132, 228, 0.6);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease);
}
.btn:hover {
  --btn-bg: #0073ce;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 24, 72, 0.14), 0 16px 30px -12px rgba(0, 132, 228, 0.55);
}
.btn:active {
  transform: translateY(0);
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1px var(--brand-300), var(--sh-1);
}
.btn--light {
  --btn-bg: #fff;
  --btn-fg: var(--brand-900);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.5);
}
.btn--light:hover {
  --btn-bg: var(--brand-100);
  --btn-fg: var(--brand-900);
}
.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: #eaf2fb;
  box-shadow: inset 0 0 0 1px rgba(234, 242, 251, 0.28);
}
.btn--outline-light:hover {
  --btn-bg: rgba(255, 255, 255, 0.08);
  --btn-fg: #fff;
}
.btn--sm {
  height: 40px;
  padding: 0 16px;
  font-size: 0.875rem;
}
.btn--inline {
  height: 42px;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--brand-600);
  transition: gap 0.18s var(--ease), color 0.18s var(--ease);
}
.link-arrow svg {
  width: 15px;
  height: 15px;
}
.link-arrow:hover {
  gap: 11px;
  color: var(--brand-800);
}

/* ---------- top strip ---------- */
.topbar {
  background: var(--brand-950);
  color: #a9bed6;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.topbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
}
.topbar__l,
.topbar__r {
  display: flex;
  align-items: center;
  gap: 18px;
}
.topbar a:hover {
  color: #fff;
}
.topbar .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(0, 168, 240, 0.18);
}
.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.topbar strong {
  color: #e8f1fb;
  font-weight: 500;
}

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 24px -12px rgba(6, 23, 44, 0.28);
}
.header__in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand img {
  height: 38px;
  width: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  position: relative;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 450;
  color: var(--ink-2);
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}
.nav a:hover {
  color: var(--brand-700);
  background: var(--paper-3);
}
.header__cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
}
.burger {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border-radius: 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ink);
}
.burger:hover {
  background: var(--paper-3);
}
.burger span {
  display: block;
  width: 20px;
  height: 1.6px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.24s var(--ease), opacity 0.2s var(--ease);
}

/* mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  background: rgba(3, 15, 30, 0.44);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}
.drawer.is-open {
  display: block;
}
.drawer.is-shown {
  opacity: 1;
}
.drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(84vw, 360px);
  background: #fff;
  padding: 22px var(--gutter) 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateX(18px);
  transition: transform 0.3s var(--ease);
  box-shadow: -20px 0 60px -30px rgba(0, 24, 72, 0.5);
  overflow-y: auto;
}
.drawer.is-shown .drawer__panel {
  transform: none;
}
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.drawer__head img {
  height: 30px;
}
.drawer a.drawer__link {
  padding: 14px 4px;
  font-size: 1.06rem;
  font-weight: 500;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}
.drawer a.drawer__link svg {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}
.drawer .btn {
  margin-top: 20px;
  width: 100%;
}
.drawer__meta {
  margin-top: auto;
  padding-top: 26px;
  font-size: 0.8rem;
  color: var(--muted-2);
  line-height: 1.7;
}

/* ---------- footer ---------- */
.footer {
  background: var(--brand-950);
  color: #93a9c2;
  padding-block: clamp(48px, 6vw, 76px) 28px;
  font-size: 0.9rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.8fr 1.1fr;
  gap: 40px 32px;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.footer__chip {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.footer__chip img {
  width: 34px;
}
.footer__name {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}
.footer__name span {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f97b3;
  margin-top: 2px;
}
.footer p {
  margin-top: 18px;
  line-height: 1.68;
  max-width: 34ch;
}
.footer h4 {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer ul li + li {
  margin-top: 10px;
}
.footer a:hover {
  color: #fff;
}
.footer__contact li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.footer__contact svg {
  width: 15px;
  height: 15px;
  margin-top: 4px;
  color: var(--brand-300);
  flex: none;
}
.footer__bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(147, 169, 194, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #77909f;
}
.footer__bottom nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* 有些元素自带 display 规则，[hidden] 默认样式会被盖掉，这里强制生效 */
[hidden] {
  display: none !important;
}

/* ---------- forms ---------- */
.field {
  position: relative;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
/* 单选/复选不要被上面的输入框样式污染 */
.field input[type="radio"],
.field input[type="checkbox"] {
  width: 17px;
  height: 17px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--brand-500);
  flex: none;
}
.field textarea {
  height: auto;
  min-height: 116px;
  padding: 13px 14px;
  line-height: 1.6;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #9aa8b9;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(0, 132, 228, 0.14);
}
.field input:focus-visible {
  outline: none;
}
.field--lg input {
  height: 56px;
  font-size: 1rem;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 7px;
}
.form-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: #8ea1b6;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  line-height: 1.5;
}
.form-note svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 2px;
}
.alert {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 0.86rem;
  line-height: 1.5;
  display: none;
}
.alert.is-on {
  display: block;
}
.alert--err {
  background: #fff2f2;
  border: 1px solid #ffd7d7;
  color: #a3222a;
}
.alert--ok {
  background: #eefaf3;
  border: 1px solid #cfeddb;
  color: #0a6b42;
}

/* ---------- reveal on scroll ---------- */
/* 只有 JS 可用时才隐藏，避免任何情况下内容看不见 */
.reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.has-js .reveal {
  opacity: 0;
  transform: translateY(14px);
}
html.has-js .reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.has-js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .nav,
  .header__cta {
    display: none;
  }
  .burger {
    display: flex;
  }
  .brand img {
    height: 30px;
  }
  .topbar__l span.hide-m {
    display: none;
  }
  :root {
    --header-h: 64px;
  }
}
@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }
  .topbar__r {
    display: none;
  }
  .topbar__in {
    justify-content: flex-start;
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer__bottom {
    flex-direction: column;
  }
  .btn {
    height: 46px;
  }
}
