@import url('./tokens.css');

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--glow);
  color: var(--ink);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Typography utilities ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: var(--btn);
  color: #F8F8F8;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0),
    0 2px 4px rgba(0, 0, 0, 0),
    0 18px 40px -10px rgba(0, 0, 0, 0);
  transition:
    transform 0.22s var(--ease-out),
    box-shadow 0.42s var(--ease-out);
}

.btn svg {
  flex: none;
  opacity: 0.8;
}

.btn:hover {
  transform: scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.16),
    0 18px 40px -10px rgba(0, 0, 0, 0.34);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  box-shadow: none;
  background: var(--fill);
  color: var(--ink);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  transition: background var(--dur-hover);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.09);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--dur-reveal) var(--ease-swoop),
    transform var(--dur-reveal) var(--ease-swoop);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* data-delay 的毫秒值由 main.js 写入 style.transitionDelay（CSS attr() 无法产出 time 类型） */

/* ---------- Link underline ---------- */
.link-line {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left calc(100% - 1px);
  background-size: 0% 1px;
  transition: background-size 250ms var(--ease-out);
}

.link-line:hover {
  background-size: 100% 1px;
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  :root {
    --section-pad: 72px;
  }
}
