/* Subpage layouts aligned with affix-io.com homepage */

.page-hero {
  position: relative;
  padding: clamp(2.5rem, 7vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, var(--glow-cyan), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 80%, var(--glow-blue), transparent 50%),
    var(--bg1);
}

.page-hero > .container {
  position: relative;
  z-index: 1;
}

.page-breadcrumb {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
  margin-bottom: 1rem;
}

.page-breadcrumb a {
  color: var(--muted);
}

.page-hero h1 {
  font-size: clamp(1.65rem, 4.5vw + 0.35rem, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 20ch;
  margin-bottom: 1rem;
}

.page-lead {
  font-size: clamp(1.05rem, 2.2vw, 1.15rem);
  line-height: 1.65;
  color: var(--muted);
  max-width: 42rem;
  margin-bottom: 1.25rem;
}

.page-hero .hero-actions {
  margin-top: 1.25rem;
}

.page-hero .hero-outcome {
  margin-top: 1rem;
}

.prose {
  max-width: 40rem;
}

.prose-wide {
  max-width: 52rem;
}

.prose h2 {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  margin: 2.25rem 0 0.65rem;
  padding-top: 0.5rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.5rem;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.prose ul,
.prose ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.code-panel {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  overflow-x: auto;
  line-height: 1.6;
  color: #c8d6e8;
}

.code-panel .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-bottom: 0.5rem;
}

.code-panel .cmt { color: var(--dim); }
.code-panel .key { color: #93c5fd; }
.code-panel .str { color: #86efac; }

.flow-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.flow-inline .node {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line2);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}

.flow-inline .arr {
  color: var(--dim);
  font-family: var(--mono);
}

.doc-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .doc-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
  }
}

.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.doc-toc h2 {
  font-family: var(--mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 0.65rem;
}

.doc-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-toc a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}

.doc-toc a:hover {
  color: var(--cyan);
}

.doc-section {
  scroll-margin-top: calc(var(--header-h) + 1rem);
  margin-bottom: 2.75rem;
}

.doc-section > h2 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.assumption-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
}

.assumption-card strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.assumption-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.arch-diagram-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  background: rgba(0, 0, 0, 0.25);
  overflow: auto;
}

.arch-diagram-wrap svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.arch-diagram-wrap .caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  text-align: center;
  margin-top: 0.75rem;
}

.swatch-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  margin-top: 1.25rem;
}

.swatch {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.swatch-color {
  height: 64px;
}

.swatch-info {
  padding: 0.6rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.swatch-info strong {
  display: block;
  color: var(--text);
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.type-row {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.type-row .section-label {
  margin-bottom: 0.5rem;
}

.type-sample {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.25rem 0;
}

.type-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
}

.stat-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 1.25rem 0;
}

.stat-box {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.stat-box strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: -0.02em;
}

.stat-box span {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.link-grid {
  margin-top: 1.25rem;
}

.related-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related-links h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.related-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-links li {
  margin-bottom: 0.5rem;
}

.profile-card {
  max-width: 32rem;
  margin: 2rem auto 0;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-grad);
  border-color: rgba(34, 211, 238, 0.25);
}

.profile-card .section-label {
  margin-bottom: 0.5rem;
}

.profile-card h3 {
  margin-bottom: 0.35rem;
}

.profile-byline {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.hero-orbit-panel {
  border-radius: 16px;
  border: 1px solid var(--line2);
  background: var(--panel-grad);
  padding: 1.25rem;
  min-height: 180px;
}

.hero-orbit-panel .hero-orbit-core {
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.75rem;
}

.hero-orbit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--dim);
  text-align: center;
}

.hero-orbit-stats strong {
  display: block;
  color: var(--cyan);
  font-size: 0.9rem;
}

.page-hero-split {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 960px) {
  .page-hero-split {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.wordmark-panel {
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.wordmark-panel .affix-wordmark {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
}
