:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #565963;
  --border: #e5e5e8;
  --surface: #f7f7f8;
  --red: #d40019;
  --red-hover: #b40018;
  --red-tint: #fff0f1;
  --console: #18191d;
  --wrap-width: 74rem;
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  scroll-behavior: smooth;
}

:root:lang(zh-Hans) {
  font-family: "Inter", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root:lang(en) {
  font-family: "Inter", system-ui, sans-serif;
}

:root:lang(hi) {
  font-family: "Noto Sans Devanagari", "Nirmala UI", Mangal, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  line-height: 1.65;
}

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

button {
  font: inherit;
}

figure,
p,
h1,
h2,
h3,
ul,
dl,
dd {
  margin: 0;
}

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

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

section[id],
#member-login {
  scroll-margin-top: 2rem;
}

.wrap {
  width: min(var(--wrap-width), calc(100% - 4rem));
  margin-inline: auto;
}

.visually-hidden,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  inset: 0.75rem auto auto 0.75rem;
  z-index: 5;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--ink);
}

.masthead {
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.25rem;
  gap: 2rem;
}

.brand {
  flex: 0 0 auto;
  width: 10.5rem;
}

.brand img {
  height: auto;
}

.main-nav,
.footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.main-nav a,
.footer nav a {
  color: #41434b;
  font-size: 0.9375rem;
  font-weight: 650;
  white-space: nowrap;
}

.main-nav a:hover,
.footer nav a:hover {
  color: var(--red);
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-inline-start: auto;
}

.language-switcher {
  min-height: 2.75rem;
  max-width: 100%;
  flex-shrink: 0;
  padding-inline: 0.65rem;
  border: 1px solid #dcdce1;
  border-radius: 0.55rem;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.language-switcher:hover {
  border-color: #b8b8c1;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font-size: 0.9375rem;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}

.masthead-login {
  min-height: 2.75rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
}

.button--outline {
  border-color: #dcdce1;
  color: var(--ink);
  background: #fff;
}

.button--outline:hover {
  border-color: #b8b8c1;
  background: #f9f9fa;
}

.button--primary {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.button--primary:hover {
  border-color: var(--red-hover);
  background: var(--red-hover);
}

.button--small {
  min-height: 2.45rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
}

body:has(> .maintenance-dialog[open]) {
  overflow: hidden;
}

/* The HTML-only fallback stays blocking until the native form closes it. */
.maintenance-dialog[open] ~ * {
  visibility: hidden;
}

.maintenance-dialog:modal ~ * {
  visibility: visible;
}

.maintenance-dialog {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: min(34rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  height: fit-content;
  margin: auto;
  padding: clamp(1rem, 4vw, 1.75rem);
  overflow: auto;
  border: 1px solid #e4c890;
  border-block-start: 4px solid #ab6a0b;
  border-radius: .875rem;
  background: #fffdf9;
  color: var(--ink);
  box-shadow: 0 0 0 100vmax #262122a8, 0 1.25rem 4rem #26212240;
}

.maintenance-dialog:modal {
  box-shadow: 0 1.25rem 4rem #26212240;
}

.maintenance-dialog::backdrop {
  background: #262122a8;
}

.maintenance-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .65rem;
}

.maintenance-dialog h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  color: #39260d;
}

.maintenance-demo {
  border: 1px solid #ddbc7d;
  border-radius: .35rem;
  padding: 0 .45rem;
  background: #fff8e9;
  color: #514022;
  font-size: .8125rem;
  font-weight: 650;
}

.maintenance-time {
  display: grid;
  gap: .15rem;
  padding: .8rem 1rem;
  border-radius: .5rem;
  background: #fff4db;
  color: #514022;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.maintenance-time time {
  font-variant-numeric: tabular-nums;
}

.maintenance-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.hero {
  overflow: clip;
  padding-block: 5.4rem 5.95rem;
  background:
    radial-gradient(ellipse at 88% 49%, #ffecef 0%, transparent 37%),
    linear-gradient(#fff 10%, #fafafb 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 2.65rem;
}

.beta-status,
.beta-date {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #9d001c;
  font-size: 0.875rem;
  font-weight: 750;
}

.beta-status {
  min-height: 2rem;
  padding: 0.15rem 0.7rem;
  border: 1px solid #ffced4;
  border-radius: 5rem;
  background: var(--red-tint);
}

.beta-status:hover {
  background: #ffe1e5;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
}

.hero h1 {
  margin-block: 1.15rem 1.35rem;
  font-size: clamp(2.3rem, 5.2vw, 5rem);
  font-weight: 860;
  line-height: 1.115;
  letter-spacing: -0.055em;
}

:lang(en) .hero h1 {
  font-size: clamp(2.05rem, 4.7vw, 4.5rem);
}

:root:lang(hi) :is(.hero h1, .section-copy h2) {
  letter-spacing: normal;
  line-height: 1.3;
}

:root:lang(hi) .hero h1 {
  font-size: clamp(1.75rem, 4.2vw, 3.6rem);
}

.hero h1 span {
  display: block;
}

.hero h1 span + span {
  margin-top: 0.12em;
  color: var(--red);
}

.hero-copy > p {
  max-width: 28rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.7rem;
}

.event-figure {
  position: relative;
  min-width: 0;
  margin-bottom: 1.5rem;
  isolation: isolate;
}

.event-figure::before {
  position: absolute;
  z-index: -1;
  inset: -3rem -3rem -3rem 1.8rem;
  content: "";
  border-radius: 2rem;
  background-image: radial-gradient(#d3adb4 0.85px, transparent 0.85px);
  background-size: 1rem 1rem;
  opacity: 0.5;
  mask-image: linear-gradient(145deg, transparent 3%, #000 60%, transparent 100%);
}

.event-panel {
  overflow: hidden;
  border: 1px solid #35363d;
  border-radius: 1rem;
  color: #f4f4f6;
  background: var(--console);
  box-shadow: 0 22px 55px #20111723;
}

.event-toolbar {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid #33343b;
}

.event-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.event-symbol {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  place-content: center;
  border: 1px solid #5b3640;
  border-radius: 0.55rem;
  color: #ff9dab;
  background: #352127;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
}

.event-heading .event-title {
  font-size: 1rem;
  font-weight: 730;
}

.event-heading p + p {
  color: #b8b9c4;
  font-size: 0.8125rem;
}

.event-transport {
  padding: 0.2rem 0.55rem;
  border: 1px solid #4f505a;
  border-radius: 0.35rem;
  color: #d4d4dc;
  font: 0.8125rem/1.5 "IBM Plex Mono", Consolas, monospace;
}

pre {
  margin: 0;
  overflow: auto;
  font: 0.875rem/1.7 "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  tab-size: 4;
}

pre code {
  font: inherit;
}

.event-json {
  padding: 1.05rem 1.4rem 2.25rem;
}

.json-punctuation {
  color: #a5a6b5;
}

.json-key {
  color: #f0bac3;
}

.json-value {
  color: #d1d1dd;
}

.json-highlight {
  color: #ff91a0;
}

.event-card {
  position: absolute;
  right: -0.55rem;
  bottom: -2rem;
  display: flex;
  min-width: 14.3rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #ebdfe2;
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 9px 30px #341d2520;
}

.event-card-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--red-tint);
}

.event-card-icon::before {
  width: 0.85rem;
  height: 1rem;
  content: "";
  background: var(--red);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.event-card p:first-child {
  font-size: 0.9375rem;
  font-weight: 750;
}

.event-card p + p {
  color: var(--muted);
  font-size: 0.8125rem;
}

.features {
  padding-block: 1.95rem;
  border-block: 1px solid var(--border);
  background: #fff;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  padding: 0;
}

.feature-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: 0.9rem;
  padding: 0.3rem 1.25rem 0.3rem 0;
}

.feature-list li + li {
  border-left: 1px solid var(--border);
  padding-left: 1.25rem;
}

.feature-list h3 {
  font-size: 1.0625rem;
  line-height: 1.45;
}

.feature-list p {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.feature-icon {
  position: relative;
  display: block;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.6rem;
  color: var(--red);
  background: var(--red-tint);
}

.feature-icon::before,
.feature-icon::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.feature-icon--bell::before {
  top: 0.68rem;
  width: 0.72rem;
  height: 0.77rem;
  border: 2px solid currentColor;
  border-radius: 0.55rem 0.55rem 0.2rem 0.2rem;
}

.feature-icon--bell::after {
  top: 1.7rem;
  width: 0.32rem;
  height: 0.17rem;
  border-radius: 8rem;
  background: currentColor;
}

.feature-icon--list::before {
  top: 0.68rem;
  width: 1.03rem;
  height: 0.94rem;
  border: 2px solid currentColor;
  border-radius: 0.22rem;
}

.feature-icon--list::after {
  top: 1.06rem;
  width: 0.64rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0.28rem currentColor;
}

.feature-icon--cache::before {
  top: 0.76rem;
  width: 0.88rem;
  height: 0.76rem;
  border: 2px solid currentColor;
  border-radius: 0.2rem;
}

.feature-icon--cache::after {
  top: 1.02rem;
  left: 55%;
  width: 0.88rem;
  height: 0.76rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0.2rem;
}

.section-grid,
.beta-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: start;
  gap: clamp(2rem, 7vw, 6.2rem);
}

.integration {
  padding-block: 6rem;
}

.section-copy h2 {
  max-width: 22rem;
  font-size: clamp(1.95rem, 3.6vw, 3.3rem);
  font-weight: 820;
  line-height: 1.18;
  letter-spacing: -0.05em;
}

.section-copy > p + h2,
.section-copy h2 + p {
  margin-top: 0.8rem;
}

.section-copy h2 + p,
.section-copy .setup-note {
  color: var(--muted);
  font-size: 1rem;
}

.setup-note {
  margin-top: 1.2rem;
  padding-left: 0.8rem;
  border-left: 3px solid #ff99a6;
}

.example {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 8px 26px #17171709;
}

.example-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: thin;
}

.example-tabs button {
  min-height: 3.1rem;
  flex: 1 0 auto;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 690;
  cursor: pointer;
}

.example-tabs button[aria-selected="true"] {
  border-bottom-color: var(--red);
  color: var(--red);
  background: #fff;
}

.example-tabs button:focus-visible {
  outline-offset: -3px;
}

.example-toolbar {
  display: flex;
  min-height: 3.8rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 1.05rem;
  font-weight: 720;
}

.example-panel pre {
  min-height: 10rem;
  padding: 1rem 1.15rem;
  border-block: 1px solid #eeeeef;
  color: #252632;
  background: #fcfcfd;
}

.code-keyword {
  color: #af0035;
}

.code-string {
  color: #226554;
}

.example-note {
  min-height: 3.5rem;
  padding: 0.85rem 1.05rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.beta {
  padding-block: 3.6rem 4rem;
  border-block: 1px solid #f4d7dc;
  background: #fff5f6;
}

.beta-grid {
  align-items: center;
}

.beta-join {
  margin-top: 1.2rem;
  margin-inline-end: 1rem;
}

.beta-limits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid #f0d6db;
  border-radius: 0.75rem;
  background: #fff;
}

.beta-limits > div {
  min-width: 0;
  padding: 1rem 1.2rem;
}

.beta-limits > div:nth-child(even) {
  border-left: 1px solid #f3e2e5;
}

.beta-limits > div:nth-child(n+3) {
  border-top: 1px solid #f3e2e5;
}

.beta-limits dt {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
}

.beta-limits dd {
  margin-top: 0.25rem;
  color: #a70020;
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  font-weight: 790;
  line-height: 1.3;
}

.beta-limits dd span {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 650;
}

.footer-inner {
  display: flex;
  min-height: 6rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand--footer {
  width: 7.9rem;
  flex-shrink: 0;
}

.footer small {
  color: var(--muted);
}

.text-link,
.content-page a:not(.button) {
  color: var(--red-hover);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.section-copy > .text-link {
  display: inline-block;
  margin-top: 0.7rem;
}

.content-page {
  width: min(68rem, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 5vw, 3.5rem);
  overflow-wrap: anywhere;
}

.content-page h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

.content-page h2 {
  margin-block: 0 0.35rem;
  font-size: 1.35rem;
}

.content-page p + p,
.content-page p + form,
.content-page h1 + p,
.content-page section + section {
  margin-top: 0.8rem;
}

.panel {
  margin-block: 1rem;
  padding: clamp(0.9rem, 3vw, 1.4rem);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.stack,
.form-row {
  display: grid;
  gap: 0.65rem;
}

.form-row {
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  align-items: end;
}

.content-page label,
.content-page dt {
  font-weight: 650;
}

.content-page :is(input:not([type="hidden"], [type="checkbox"], [type="radio"]), textarea, select) {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #b8b8c1;
  border-radius: 0.45rem;
  color: inherit;
  background: #fff;
  font: inherit;
}

.content-page textarea {
  resize: vertical;
}

.content-page label + :is(input, textarea, select),
.content-page dt:not(:first-child) {
  margin-top: 0.4rem;
}

.notice {
  margin-block: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.45rem;
  background: var(--surface);
}

.notice--error {
  border-inline-start: 0.2rem solid var(--red);
  background: var(--red-tint);
}

.table-scroll,
.content-page pre {
  max-width: 100%;
  overflow: auto;
}

.content-page table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
}

.content-page :is(th, td) {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.content-page pre {
  padding: 0.85rem;
  border-radius: 0.45rem;
  background: var(--console);
  color: #f7f7f8;
}

@media (max-width: 900px) {
  .hero-grid {
    gap: 1.65rem;
  }

  .masthead-inner,
  .main-nav {
    gap: 1.2rem;
  }

  .feature-list li {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .integration {
    padding-block: 4rem;
  }

  .section-grid,
  .beta-grid {
    gap: 2rem;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: calc(100% - 2.5rem);
  }

  .masthead-inner {
    flex-wrap: wrap;
    min-height: auto;
    gap: 0.65rem;
    padding-block: 0.65rem 0.8rem;
  }

  .brand {
    width: 8.8rem;
  }

  .main-nav {
    order: 1;
    width: 100%;
    gap: 0.45rem 0.9rem;
  }

  .main-nav a {
    font-size: 0.875rem;
  }

  .hero {
    padding-block: 2.45rem 4.65rem;
  }

  .hero-grid,
  .section-grid,
  .beta-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 1.9rem;
  }

  .hero h1 {
    margin-block: 0.85rem 1rem;
    font-size: clamp(2.05rem, 7.6vw + 0.25rem, 4.5rem);
    letter-spacing: -0.045em;
  }

  .hero-actions {
    margin-top: 1.25rem;
  }

  .event-figure {
    margin-bottom: 0;
  }

  .event-toolbar {
    min-height: 3.7rem;
    padding: 0.7rem 0.8rem;
  }

  .event-json {
    padding-inline: 0.8rem;
    font-size: 0.8125rem;
  }

  .event-card {
    right: 0.55rem;
    bottom: -1.7rem;
  }

  .features {
    padding-block: 0.75rem;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .feature-list li,
  .feature-list li + li {
    display: grid;
    padding: 0.95rem 0;
    border-left: 0;
    gap: 0.85rem;
  }

  .feature-list li + li {
    border-top: 1px solid var(--border);
  }

  .beta {
    padding-block: 2.5rem;
  }

  .beta-limits > div {
    padding-inline: 0.65rem;
  }

  .footer-inner {
    flex-wrap: wrap;
    padding-block: 0.75rem 1rem;
  }

  .footer nav {
    gap: 1.05rem;
  }

  .footer nav a {
    font-size: 0.875rem;
  }
}

@media (max-width: 460px) {
  .masthead .brand {
    width: clamp(4.7rem, 27vw, 8.8rem);
  }

  .masthead-actions {
    gap: 0.4rem;
  }

  .language-switcher {
    width: clamp(5.5rem, 30vw, 7.5rem);
    padding-inline: 0.35rem;
  }

  .masthead-login {
    padding-inline: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
}
