/* ============================================================
   StoryForge How It Works — Codex Identity
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100dvh;
}

/* --- Page layout ------------------------------------------ */

.how-page {
  min-height: 100dvh;
}

/* --- Topbar ----------------------------------------------- */

.how-topbar {
  border-bottom: 0.5px solid var(--hairline);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.how-wordmark {
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

@media (hover: hover) and (pointer: fine) {
  .how-wordmark:hover {
    color: var(--fg);
  }
}

.how-wordmark:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.how-back-link {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.15s;
  padding: 12px 8px;
  margin: -12px -8px;
}

@media (hover: hover) and (pointer: fine) {
  .how-back-link:hover {
    color: var(--gold);
  }
}

.how-back-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Surface ---------------------------------------------- */

.how-surface {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* --- Diamond anchor --------------------------------------- */

.how-anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 0 48px;
}

.how-anchor-line {
  height: 0.5px;
  width: 80px;
  background: var(--fg-faint);
}

.how-anchor-diamond {
  height: 5px;
  width: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* --- Header ----------------------------------------------- */

.how-header {
  text-align: center;
  margin-bottom: 56px;
}

.how-header-label {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--fg-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.how-title {
  font-family: var(--font-body);
  font-size: 32px;
  color: var(--fg);
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 400;
}

.how-subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  font-style: italic;
  color: var(--fg-muted);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Sections --------------------------------------------- */

.how-section {
  margin-bottom: 24px;
}

.how-section-container {
  background: var(--container-bg);
  border: 0.5px solid var(--container-border);
  border-radius: 2px;
  padding: 36px 32px 28px;
  position: relative;
}

.how-section-label {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--fg-dim);
  white-space: nowrap;
  text-transform: uppercase;
}

.how-section-body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--fg);
  line-height: 1.7;
}

.how-section-body p {
  margin: 0 0 14px;
}

.how-section-body p:last-child {
  margin-bottom: 0;
}

.how-section-body strong {
  color: var(--gold);
  font-weight: 600;
}

.how-section-body em {
  font-style: italic;
  color: var(--fg-muted);
}

/* --- Footer ----------------------------------------------- */

.how-footer {
  text-align: center;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 0.5px solid var(--hairline);
}

.how-back-button {
  display: inline-block;
  padding: 14px 28px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 2px;
  transition: filter 0.15s;
}

@media (hover: hover) and (pointer: fine) {
  .how-back-button:hover {
    filter: brightness(1.1);
  }
}

.how-back-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Responsive ------------------------------------------- */

@media (max-width: 600px) {
  .how-topbar {
    padding: 16px 20px;
  }

  .how-wordmark {
    font-size: 18px;
  }

  .how-surface {
    padding: 32px 20px 64px;
  }

  .how-anchor {
    padding-bottom: 32px;
  }

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

  .how-subtitle {
    font-size: 14px;
  }

  .how-section-container {
    padding: 32px 24px 24px;
  }
}

/* SF-VISUAL-01 carry-through (presentation-only; reversible) */
.how-back-button { background: var(--lit-metal); color: var(--bg); border-radius: var(--btn-radius); box-shadow: var(--lit-metal-sheen); }
@media (hover: hover) and (pointer: fine) {
  .how-back-button:hover { background: var(--lit-metal); filter: brightness(1.06); }
}
