/* ============================================================
   sig/sig.css — "The Most Popular Signature on the Internet"
   Showcase page. Extends the site tokens in /css/style.css.
   No new colors outside the token set.
   ============================================================ */

.sig-page {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.sig-page__back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.sig-page__back:hover {
  color: var(--accent-cyan);
}

.sig-page__title {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 4.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin: 1.75rem 0 0.4rem;
  text-shadow: var(--glow-cyan);
}

.sig-page__subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-amber);
  margin-bottom: 2.5rem;
}

/* ── Hero stage: the live sign ──────────────────────────────── */
.sig-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 200px;
  padding: 2rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.sig-stage__frame {
  position: relative;
  display: inline-block;
  padding: 0.75rem;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 149, 0, 0.03) 0 6px,
    transparent 6px 12px
  );
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
}

/* The sign itself — keep the pixels hard, never smooth them. */
.sig-image {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.sig-live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}
.sig-live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  animation: sigPulse 1.6s ease-in-out infinite;
}
.sig-live[hidden] {
  display: none;
}

.sig-stage__caption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  max-width: 42ch;
}
.sig-stage__caption strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Controls: re-roll + variant toggle ─────────────────────── */
.sig-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.sig-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}
.sig-btn:hover {
  border-color: var(--border-glow);
  color: var(--accent-cyan);
}

.sig-toggle {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}
.sig-toggle__opt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
}
.sig-toggle__opt + .sig-toggle__opt {
  border-left: 1px solid var(--border-subtle);
}
.sig-toggle__opt[aria-pressed="true"] {
  color: var(--bg-base);
  background: var(--accent-cyan);
}

.sig-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-align: center;
  margin: 0.25rem 0 0;
  min-height: 1rem;
}

/* ── Embed kit ──────────────────────────────────────────────── */
.sig-embed {
  margin-top: 3rem;
}
.sig-embed__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.sig-embed__row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.sig-embed__kind {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sig-embed__field {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
  overflow-x: auto;
}
.sig-embed__field:focus-visible {
  outline: none;
  border-color: var(--border-glow);
}
.sig-copy {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}
.sig-copy:hover {
  border-color: var(--border-glow);
}
.sig-copy.is-copied {
  color: var(--accent-amber);
  border-color: rgba(0, 255, 213, 0.45);
}

/* ── Story ──────────────────────────────────────────────────── */
.sig-story {
  margin-top: 3.5rem;
}
.sig-story__heading {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sig-story__text {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.sig-story__text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.sig-story__text a {
  color: var(--accent-cyan);
  text-decoration: none;
}
.sig-story__text a:hover {
  text-decoration: underline;
}

/* ── Screen-reader-only live region ─────────────────────────── */
.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;
}

/* ── Focus-visible (page-local; global CSS is thin here) ────── */
.sig-page a:focus-visible,
.sig-btn:focus-visible,
.sig-toggle__opt:focus-visible,
.sig-copy:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* ── Motion ─────────────────────────────────────────────────── */
@keyframes sigPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sig-live__dot {
    animation: none;
  }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sig-embed__row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "kind kind"
      "field copy";
  }
  .sig-embed__kind {
    grid-area: kind;
  }
  .sig-embed__field {
    grid-area: field;
  }
  .sig-copy {
    grid-area: copy;
  }
}
