/* 夜航纸页
   carbon #16161A · paper #F3EEE6 · dim #C9C2B6
   amber #E2A23A · amber-text #F0C36A · ink #1A1408
   标题 Noto Sans SC，界面 Outfit，航迹条 IBM Plex Mono
   间距 8px，控件圆角 4px，色块不描阴影
*/

:root {
  --carbon: #16161a;
  --field: #1c1c22;
  --paper: #f3eee6;
  --dim: #c9c2b6;
  --amber: #e2a23a;
  --amber-text: #f0c36a;
  --ink: #1a1408;
  --line: #4a4030;
  --font: "Noto Sans SC", "PingFang SC", sans-serif;
  --ui: Outfit, "Noto Sans SC", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --space: 8px;
}

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

html {
  color-scheme: dark;
  scroll-padding-top: 1.25rem;
}

body {
  margin: 0;
  background: var(--carbon);
  color: var(--paper);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}

img {
  max-width: 100%;
}

h1,
h2,
.role,
.step h3,
.cap h3 {
  text-wrap: pretty;
}

p,
dd {
  text-wrap: pretty;
}

a {
  color: var(--paper);
  text-underline-offset: 0.22em;
}

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

:focus-visible {
  outline: 2px solid var(--amber-text);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 5;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  text-decoration: none;
}

.skip:focus {
  top: calc(0.75rem + env(safe-area-inset-top));
}

.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;
}

.wrap {
  width: min(1120px, calc(100% - max(2.5rem, env(safe-area-inset-left) + env(safe-area-inset-right))));
  margin-inline: auto;
}

.site-header {
  padding-top: env(safe-area-inset-top);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  min-height: 4.5rem;
  padding-block: 0.5rem;
}

.wordmark {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav a {
  font-family: var(--ui);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.hero {
  position: relative;
  min-height: calc(100svh - 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(1.5rem, 4vw, 3.5rem);
}

.hero-title {
  margin: 0;
  font-size: clamp(4.5rem, 13vw, 10.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-kerning: none;
  white-space: nowrap;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-top: 1.25rem;
}

.role {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.deck {
  margin: 0.9rem 0 0;
  max-width: 36rem;
  color: var(--dim);
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.strip-bay {
  position: relative;
  width: 100%;
  height: 12.5rem;
}

.strip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 16.5rem);
  background: var(--amber);
  color: var(--ink);
  border-radius: 4px;
  padding: 0.85rem 1rem 1rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.strip:active {
  cursor: grabbing;
}

.strip dl {
  margin: 0;
}

.strip dl > div {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.35rem 0.6rem;
  padding-block: 0.28rem;
}

.strip dt,
.strip dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.strip dt {
  font-weight: 500;
}

.hint {
  margin: 0;
  color: var(--dim);
  font-size: 0.95rem;
  max-width: 18rem;
}

.section {
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
}

.section h2,
.method h2,
.contact h2 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  scroll-margin-top: 1.25rem;
}

.section-lead {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  color: var(--dim);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-head .section-lead {
  margin-bottom: 0;
}

button,
.submit {
  font-family: var(--ui);
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ghost,
.layout-toggle {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
}

.ghost:hover,
.layout-toggle:hover {
  border-color: var(--amber);
  color: var(--amber-text);
}

.ghost:active,
.layout-toggle:active,
.submit:active {
  transform: translateY(1px);
}

.board {
  position: relative;
}

.board[data-layout="mosaic"] {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: 0.25rem;
  align-items: start;
}

.board[data-layout="mosaic"] .cap:first-child {
  grid-row: 1 / span 3;
  padding-top: 0;
}

.board[data-layout="mosaic"] .cap:first-child h3 {
  font-size: clamp(2.4rem, 4.6vw, 4.25rem);
}

.cap {
  min-width: 0;
  padding-block: 1.15rem;
}

.cap h3 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--paper);
  transition: color 0.2s ease;
}

.cap:hover h3 {
  color: var(--amber-text);
}

.cap p {
  margin: 0.55rem 0 0;
  color: var(--dim);
  max-width: 38rem;
}

.board[data-layout="strip"] {
  display: flex;
  flex-direction: column;
}

.board[data-layout="strip"] .cap {
  display: grid;
  grid-template-columns: minmax(8.5rem, 14rem) minmax(0, 1fr);
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  padding-block: 1rem;
}

.board[data-layout="strip"] .cap h3 {
  font-size: 1.25rem;
}

.board[data-layout="strip"] .cap p {
  margin: 0;
}

.method-pin {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding-block: 2rem;
}

.steps-wrap {
  position: relative;
  padding-left: 1.75rem;
  min-width: 0;
}

.playhead {
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--amber);
  border-radius: 1px;
  will-change: transform;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.35rem;
}

.step h3 {
  margin: 0;
  font-size: clamp(1.7rem, 3.3vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--dim);
  transform-origin: 0% 50%;
}

.step:first-child h3 {
  color: var(--paper);
}

.step p {
  margin: 0.35rem 0 0;
  color: var(--dim);
  max-width: 34rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

form {
  display: grid;
  gap: 1rem;
}

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

label {
  font-family: var(--ui);
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  min-height: 48px;
  touch-action: manipulation;
}

textarea {
  min-height: 9rem;
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

input:hover,
textarea:hover {
  border-color: #6d5b38;
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--amber-text);
}

.error {
  margin: 0;
  color: var(--amber-text);
  font-size: 0.95rem;
}

.error:empty {
  display: none;
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--paper);
  caret-color: var(--paper);
  box-shadow: 0 0 0 1000px var(--field) inset;
}

.submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--amber);
  color: var(--ink);
  border: 0;
  padding: 0.7rem 1.15rem;
  min-height: 48px;
}

.submit:hover {
  background: #f0b14a;
}

.submit:disabled {
  cursor: progress;
}

.spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner[hidden] {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status {
  margin: 0;
  min-height: 1.5rem;
  color: var(--paper);
}

.site-footer {
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

.site-footer p {
  margin: 0;
  color: var(--dim);
}

@media (max-width: 800px) {
  .hero-title {
    white-space: normal;
    font-size: clamp(3.6rem, 20vw, 5.5rem);
  }

  .hero-grid,
  .board[data-layout="mosaic"],
  .method-pin,
  .contact-grid,
  .fields-row,
  .board[data-layout="strip"] .cap {
    grid-template-columns: 1fr;
  }

  .board[data-layout="mosaic"] .cap:first-child {
    grid-row: auto;
  }

  .board[data-layout="strip"] .cap p {
    margin: 0;
  }

  .section-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .method-pin {
    min-height: 100svh;
    align-content: center;
  }

  .step h3 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }
}

@media (max-width: 420px) {
  .strip-bay {
    height: 10.5rem;
  }

  .hero {
    min-height: calc(100svh - 6.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cap h3,
  .ghost,
  .layout-toggle,
  .submit {
    transition: none;
  }

  .spinner {
    animation: none;
    border-right-color: var(--ink);
  }

  .playhead {
    display: none;
  }

  .steps-wrap {
    padding-left: 0;
  }

  .step h3,
  .step:first-child h3 {
    color: var(--paper);
  }
}
