/* ==========================================================================
   Cunavo — Base / Reset / Typography
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--color-bg);
  background-image: var(--color-bg-tint);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--color-text-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-text-secondary);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 1.5px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection {
  background: var(--color-border-strong);
  color: var(--color-text-primary);
}

/* --- Type scale -------------------------------------------------------- */

.display,
.h1,
.h2,
.h3 {
  overflow-wrap: break-word;
}

.display {
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}

.h1 {
  font-size: var(--fs-h1);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 400;
  line-height: 1.34;
  letter-spacing: -0.008em;
  text-wrap: balance;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: 0;
}

.body-lg {
  font-size: var(--fs-body-lg);
  line-height: 1.9;
  letter-spacing: 0.012em;
  color: var(--color-text-secondary);
  text-wrap: pretty;
}

.body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0.012em;
  color: var(--color-text-secondary);
  text-wrap: pretty;
}

.eyebrow {
  display: block;
  font-size: var(--fs-eyebrow);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

strong,
b {
  font-weight: 600;
  color: var(--color-text-primary);
}

/* 被描繪的 App 畫面固定用淺色底的墨階，不能落到網站的 primary。
   零特異性，讓 --ink-over / --ink-3 之類的刻意例外仍然勝出。 */
:is(.screen, .crop, .mock, .note, .cyc, .widget, .swap__card) :where(strong, b) {
  color: inherit;
}

/* --- Layout ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--v-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-button);
  color: var(--color-button-text);
  font-size: var(--fs-nav);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
  color: var(--color-button-text);
}

/* --- Section reveal ---------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

  .reveal,
  .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
