@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #030303;
  --ink: #f2efe8;
  --ink-soft: rgba(242, 239, 232, 0.66);
  --ink-dim: rgba(242, 239, 232, 0.42);
  --ink-faint: rgba(242, 239, 232, 0.24);
  --accent: #e4e2dc;
  --line: rgba(242, 239, 232, 0.14);
  --font-display: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mx: 50vw;
  --my: 50vh;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #080808;
}

/* ---------- deep space ---------- */

.space {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 86% 70% at 50% 38%, rgba(255, 255, 255, 0.042), transparent 68%),
    radial-gradient(ellipse 46% 42% at 82% 8%, rgba(255, 255, 255, 0.028), transparent 72%),
    radial-gradient(ellipse 48% 50% at 12% 92%, rgba(255, 255, 255, 0.018), transparent 74%),
    #030303;
}

.space::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.66) 0 1px, transparent 1.8px),
    radial-gradient(circle at 17% 72%, rgba(255, 255, 255, 0.42) 0 1px, transparent 1.7px),
    radial-gradient(circle at 24% 31%, rgba(255, 255, 255, 0.5) 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 38% 12%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.9px),
    radial-gradient(circle at 46% 84%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.7px),
    radial-gradient(circle at 57% 22%, rgba(255, 255, 255, 0.5) 0 0.8px, transparent 1.55px),
    radial-gradient(circle at 68% 68%, rgba(255, 255, 255, 0.34) 0 1px, transparent 1.8px),
    radial-gradient(circle at 76% 14%, rgba(255, 255, 255, 0.76) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 48%, rgba(255, 255, 255, 0.48) 0 0.9px, transparent 1.7px),
    radial-gradient(circle at 92% 77%, rgba(255, 255, 255, 0.56) 0 1px, transparent 1.9px),
    radial-gradient(circle at 70% 92%, rgba(255, 255, 255, 0.32) 0 0.8px, transparent 1.5px),
    radial-gradient(circle at 5% 55%, rgba(255, 255, 255, 0.28) 0 0.7px, transparent 1.4px);
  opacity: 0.8;
}

.space::after {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  width: min(96vw, 1280px);
  height: 70vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.026), transparent 66%);
  filter: blur(12px);
}

.cursor-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(
    circle 320px at var(--mx) var(--my),
    rgba(255, 255, 255, 0.055) 0%,
    rgba(255, 255, 255, 0.028) 32%,
    transparent 72%
  );
  transition: opacity 0.5s ease;
}

.grid-reveal {
  position: absolute;
  inset: -1px;
  z-index: 2;
  opacity: 0;
  background-image:
    linear-gradient(to right, rgba(242, 239, 232, 0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(242, 239, 232, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(
    circle 280px at var(--mx) var(--my),
    #000 0%,
    rgba(0, 0, 0, 0.88) 34%,
    rgba(0, 0, 0, 0.42) 62%,
    transparent 79%
  );
  mask-image: radial-gradient(
    circle 280px at var(--mx) var(--my),
    #000 0%,
    rgba(0, 0, 0, 0.88) 34%,
    rgba(0, 0, 0, 0.42) 62%,
    transparent 79%
  );
  transition: opacity 0.35s ease;
}

.is-grid-active .cursor-glow,
.is-grid-active .grid-reveal {
  opacity: 1;
}

.is-grid-active .grid-reveal {
  opacity: 0.8;
}

.space-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(ellipse 72% 64% at 50% 46%, transparent 46%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.34));
}

/* ---------- centred landing ---------- */

.landing {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(104px, 15vh, 160px) 24px clamp(92px, 13vh, 132px);
}

.hero {
  display: flex;
  width: 100%;
  max-width: 1100px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 30px);
}

.brand-logo {
  display: block;
  width: clamp(64px, 6.4vw, 92px);
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.18));
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(52px, 5.6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1;
  white-space: nowrap;
}

.brand-name span {
  display: inline-block;
  margin-left: 0.28em;
  color: rgba(242, 239, 232, 0.7);
  font-family: inherit;
  font-size: 1em;
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.008em;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name {
    background-image: linear-gradient(150deg, #ffffff 0%, #f0eee8 30%, #c3c4c7 68%, #96979b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.24));
  }

  .brand-name span {
    background-image: linear-gradient(150deg, #e8e7e3 0%, #c8c8ca 36%, #9c9da1 74%, #7f8084 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.tagline {
  max-width: 940px;
  margin: clamp(34px, 4.9vh, 52px) 0 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: clamp(14px, 1.13vw, 17px);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.7;
  text-wrap: balance;
}

.downloads {
  display: grid;
  width: min(100%, 676px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(38px, 5.4vh, 56px);
}

.download-btn {
  position: relative;
  display: flex;
  width: auto;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 11px 14px 11px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.016)),
    rgba(9, 9, 9, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 18px 50px rgba(0, 0, 0, 0.18);
  color: var(--ink);
  text-decoration: none;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition:
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    color 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.platform-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease);
}

.platform-icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.download-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
}

.download-copy strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}

.download-copy small {
  color: var(--ink-dim);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: color 0.3s var(--ease);
}

.download-arrow {
  display: grid;
  width: 26px;
  height: 26px;
  margin-left: auto;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid rgba(242, 239, 232, 0.14);
  border-radius: 50%;
  color: var(--ink-dim);
  transition:
    border-color 0.3s var(--ease),
    color 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.download-arrow svg {
  width: 14px;
  height: 14px;
}

.download-btn--docs {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.012)),
    rgba(9, 9, 9, 0.46);
}

.docs-icon svg {
  width: 20px;
  height: 20px;
}

.download-arrow--external {
  transform: translateY(-1px);
}

.download-btn:focus-visible,
.contact-dock__btn:focus-visible,
.qr-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.download-note {
  margin: 17px 0 0;
  color: rgba(242, 239, 232, 0.34);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.download-note span {
  margin: 0 7px;
  color: rgba(242, 239, 232, 0.2);
}

.download-note strong {
  color: rgba(242, 239, 232, 0.62);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(22px, 3.1vw, 44px);
  color: rgba(242, 239, 232, 0.25);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.15em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(242, 239, 232, 0.33);
}

.footer-mark::before {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(242, 239, 232, 0.42);
}

/* ---------- contact dock ---------- */

.contact-dock {
  position: fixed;
  top: 50%;
  right: clamp(14px, 2.2vw, 30px);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transform: translateY(-50%);
}

.contact-dock__btn {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 9px;
  border: 1px solid rgba(242, 239, 232, 0.12);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.008)),
    rgba(8, 8, 8, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 12px 36px rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: inherit;
  text-align: left;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition:
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.contact-dock__icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid rgba(242, 239, 232, 0.1);
  border-radius: 9px;
  background: rgba(242, 239, 232, 0.035);
  color: var(--ink-soft);
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease);
}

.contact-dock__icon svg {
  display: block;
  width: 17px;
  height: 17px;
}

.contact-dock__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.contact-dock__text strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.contact-dock__text small {
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

/* ---------- QR dialog ---------- */

.qr-dialog {
  width: min(92vw, 392px);
  max-width: none;
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(242, 239, 232, 0.15);
  border-radius: 22px;
  background: #0b0b0b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 40px 120px rgba(0, 0, 0, 0.7);
  color: var(--ink);
  overflow: auto;
}

.qr-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.qr-dialog[open] {
  animation: dialog-in 0.32s var(--ease);
}

.qr-dialog[open]::backdrop {
  animation: backdrop-in 0.32s ease;
}

.qr-card {
  position: relative;
  padding: 26px 26px 22px;
}

.qr-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(242, 239, 232, 0.14);
  border-radius: 50%;
  background: rgba(242, 239, 232, 0.035);
  color: var(--ink-soft);
  cursor: pointer;
  place-items: center;
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease);
}

.qr-close svg {
  width: 13px;
  height: 13px;
}

.qr-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.qr-eyebrow span:first-child {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(242, 239, 232, 0.4);
}

.qr-title {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.qr-desc {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.qr-frame {
  margin-top: 20px;
  padding: 9px;
  border-radius: 14px;
  background: #f4f2ed;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.qr-frame img {
  display: block;
  width: 100%;
  max-height: 49svh;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.qr-footnote {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  line-height: 1.65;
  text-align: center;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- motion ---------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.js .brand-lockup {
  opacity: 0;
  animation: rise-in 1.05s 0.08s var(--ease) forwards;
}

.js .tagline {
  opacity: 0;
  animation: rise-in 1s 0.24s var(--ease) forwards;
}

.js .downloads {
  opacity: 0;
  animation: rise-in 1s 0.4s var(--ease) forwards;
}

.js .download-note {
  opacity: 0;
  animation: rise-in 0.9s 0.54s var(--ease) forwards;
}

.js .space-vignette {
  opacity: 0;
  animation: space-in 1.8s 0.1s ease forwards;
}

@keyframes space-in {
  to {
    opacity: 1;
  }
}

@media (hover: hover) and (pointer: fine) {
  .download-btn:hover {
    border-color: rgba(242, 239, 232, 0.92);
    background: var(--ink);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 22px 70px rgba(0, 0, 0, 0.42);
    color: #080808;
    transform: translateY(-2px);
  }

  .download-btn:hover .platform-icon {
    color: #080808;
  }

  .download-btn:hover .download-copy small {
    color: rgba(8, 8, 8, 0.52);
  }

  .download-btn:hover .download-arrow {
    border-color: rgba(8, 8, 8, 0.2);
    color: #080808;
    transform: translateY(2px);
  }

  .download-btn--docs:hover .download-arrow {
    transform: translate(2px, -2px);
  }

  .contact-dock__btn:hover {
    border-color: rgba(242, 239, 232, 0.32);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02)),
      rgba(8, 8, 8, 0.8);
    transform: translateX(-2px);
  }

  .contact-dock__btn:hover .contact-dock__icon {
    background: rgba(242, 239, 232, 0.09);
    color: var(--ink);
  }

  .qr-close:hover {
    border-color: rgba(242, 239, 232, 0.42);
    background: rgba(242, 239, 232, 0.09);
    color: var(--ink);
  }
}

@media (max-width: 1279px) {
  .contact-dock__btn {
    width: 46px;
    min-height: 46px;
    justify-content: center;
    padding: 0;
    border-radius: 14px;
  }

  .contact-dock__text {
    display: none;
  }
}

@media (max-width: 900px) {
  .tagline {
    max-width: 640px;
  }

  .downloads {
    width: min(100%, 660px);
    gap: 10px;
  }

  .download-btn {
    width: auto;
  }

  .contact-dock {
    top: auto;
    right: 14px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    gap: 8px;
    transform: none;
  }

  .contact-dock__btn {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }
}

@media (max-width: 760px) {
  .downloads {
    width: min(100%, 430px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-btn--docs {
    min-height: 54px;
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .landing {
    padding: 92px 22px 94px;
  }

  .brand-lockup {
    gap: 13px;
  }

  .brand-logo {
    width: clamp(52px, 13.5vw, 62px);
  }

  .brand-name {
    font-size: clamp(43px, 12.4vw, 62px);
    letter-spacing: -0.012em;
  }

  .brand-name span {
    margin-left: 0.16em;
  }

  .tagline {
    max-width: 430px;
    margin-top: 26px;
    font-size: 14px;
    line-height: 1.75;
  }

  .downloads {
    width: 100%;
    max-width: 430px;
    margin-top: 34px;
  }

  .download-btn {
    width: auto;
    min-width: 0;
    min-height: 60px;
    flex: 1 1 0;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .platform-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }

  .platform-icon svg {
    width: 18px;
    height: 18px;
  }

  .download-copy strong {
    font-size: 13px;
  }

  .download-copy small {
    font-size: 9px;
  }

  .download-arrow {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .download-note {
    margin-top: 16px;
    font-size: 9.5px;
    letter-spacing: 0.02em;
  }

  .site-footer {
    padding: 18px 22px;
    font-size: 7.5px;
    letter-spacing: 0.12em;
  }

  .footer-mark {
    display: none;
  }
}

@media (max-width: 480px) {
  .qr-dialog {
    width: calc(100vw - 28px);
  }

  .qr-card {
    padding: 22px 20px 18px;
  }

  .qr-title {
    font-size: 26px;
  }

  .qr-frame {
    margin-top: 16px;
    padding: 7px;
  }

  .qr-frame img {
    max-height: 43svh;
  }
}

@media (max-width: 370px) {
  .downloads {
    max-width: 276px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .download-btn {
    width: 100%;
    min-height: 58px;
  }

  .download-btn--docs {
    grid-column: auto;
  }

  .download-note {
    font-size: 8.5px;
  }

  .contact-dock {
    right: 12px;
    bottom: calc(62px + env(safe-area-inset-bottom));
  }
}

@media (max-height: 700px) and (min-width: 621px) {
  .landing {
    padding-top: 84px;
    padding-bottom: 80px;
  }

  .tagline {
    margin-top: 24px;
  }

  .downloads {
    margin-top: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }

  .js .brand-lockup,
  .js .tagline,
  .js .downloads,
  .js .download-note,
  .js .space-vignette {
    opacity: 1;
  }
}
