/* The features page (docs/features-page.md). Shared look: release-4.css and release-site.css. */
.features-page { overflow-x: hidden; }
.features-page main { display: block; }
.features-page .nav-links a[aria-current="page"] { color: var(--text-primary); }
.features-page .nav-actions [data-theme-toggle] { display: inline-flex; }
.features-page .nav-actions [data-theme-toggle]:empty { display: none; }
.features-page section { padding: 92px 0; }

/* Cover */
.features-cover {
  position: relative;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(120% 140% at 85% 30%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--bg-main);
}
.cover-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; align-items: center; padding: 64px 0 58px; }
.features-cover h1 { margin: 0 0 18px; font-size: clamp(44px, 6.2vw, 78px); line-height: 1; font-weight: 550; letter-spacing: -.05em; }
.cover-meta { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 22px; font: 13px/1.5 Consolas, monospace; color: var(--text-muted); }
.cover-meta span + span { border-left: 1px solid var(--border-strong); margin-left: 12px; padding-left: 12px; }
.feature-jumps { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.feature-jump { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text-secondary); padding: 4px 0; }
.feature-jump:hover { color: var(--accent-text); }
.cover-art { width: 100%; height: auto; display: block; }
.cover-grid path { stroke: color-mix(in srgb, var(--border-strong) 60%, transparent); stroke-width: 1; }
.cover-notes rect { fill: var(--accent); opacity: .9; }
.cover-notes rect.alt { fill: var(--purple, #b8b5ec); }
.cover-wave rect { fill: color-mix(in srgb, var(--accent) 55%, var(--text-muted)); opacity: .75; }
.cover-playhead { stroke: var(--accent); stroke-width: 1.5; opacity: .8; }

/* Directory: the list on the left, one card on the right */
.feature-directory { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 48px; align-items: start; padding: 56px 0 24px; }
.feature-index {
  position: sticky; top: 20px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 14px 14px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.index-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 12px; }
.index-heading h2 { margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; }
.feature-count, .index-toggle-count { font: 12px/1 Consolas, monospace; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 4px; padding: 4px 6px; }
.index-toggle { display: none; }
.feature-choices { display: flex; flex-direction: column; min-height: 0; }
.index-search { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0 10px; height: 38px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-tint, var(--bg-main)); color: var(--text-muted); }
.index-search:focus-within { border-color: var(--accent-border); }
.index-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 0 !important; outline: none; color: var(--text-primary); font-size: 14px; height: 100%; }
.index-search input::-webkit-search-cancel-button { filter: grayscale(1); }
.feature-links { overflow-y: auto; min-height: 0; padding-right: 2px; scrollbar-width: thin; }
.feature-group + .feature-group { margin-top: 12px; }
.feature-group h3 { margin: 0 0 4px; padding: 0 8px; font: 11px/1.8 Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.feature-links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 14px; line-height: 1.35; color: var(--text-secondary); }
.feature-links a svg { flex: none; opacity: 0; transition: opacity .15s; }
.feature-links a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.feature-links a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-border); }
.feature-links a[aria-current="true"] svg { opacity: 1; }
.feature-links a[hidden], .feature-group[hidden] { display: none; }
.index-empty { margin: 6px 8px; font-size: 13px; color: var(--text-muted); }

/* A card */
.feature-sheet { scroll-margin-top: 24px; }
.has-js .feature-sheet:not(.is-active) { display: none; }
html:not(.has-js) .feature-sheet + .feature-sheet { margin-top: 72px; }
.sheet-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.sheet-category { font: 12px/1.5 Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.sheet-guide { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.sheet-guide:hover { color: var(--accent-text); }
.feature-sheet h2 { margin: 0 0 16px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.04em; font-weight: 550; }
.sheet-lead { margin: 0 0 30px; max-width: 760px; font-size: 18px; line-height: 1.6; color: var(--text-secondary); }
.feature-example { margin: 0 0 26px; }
.feature-shot { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-card); cursor: zoom-in; }
.feature-shot img { display: block; width: 100%; height: auto; }
.shot-zoom { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text-primary); border: 1px solid var(--border); opacity: 0; transition: opacity .18s; }
.feature-shot:hover .shot-zoom, .feature-shot:focus-visible .shot-zoom { opacity: 1; }
.feature-example figcaption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.feature-properties { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-properties summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 2px; cursor: pointer; list-style: none; font-weight: 600; font-size: 15px; }
.feature-properties summary::-webkit-details-marker { display: none; }
.feature-properties summary::after { content: ''; width: 8px; height: 8px; border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s; }
.feature-properties[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.feature-properties ul { margin: 0; padding: 0 0 18px; list-style: none; display: grid; gap: 10px; }
.feature-properties li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.55; color: var(--text-secondary); }
.feature-properties li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }

/* Examples of work */
.feature-workflows { border-top: 1px solid var(--border); margin-top: 64px; }
.feature-workflows h2, .feature-formats h2 { margin-bottom: 40px; }
.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.workflow { border-top: 1px solid var(--border-strong); padding-top: 22px; display: flex; flex-direction: column; }
.workflow-icon { color: var(--accent-text); display: inline-flex; margin-bottom: 14px; }
.workflow h3 { font-size: 21px; }
.workflow ol { margin: 0 0 20px; padding-left: 20px; display: grid; gap: 9px; color: var(--text-secondary); font-size: 14.5px; line-height: 1.55; }
.workflow ol li::marker { color: var(--text-muted); font: 12px Consolas, monospace; }
.workflow .text-link { margin-top: auto; }

/* Signal path */
.signal-route { background: var(--bg-main); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.route-layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 56px; align-items: center; }
.route-copy h2 { margin-bottom: 18px; }
.route-caption { margin: 0 0 24px; color: var(--text-secondary); font-size: 16px; line-height: 1.6; min-height: 3.2em; }
.route-switch { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.route-switch button { border: 0; background: transparent; color: var(--text-secondary); font: 600 13px/1 Inter, sans-serif; padding: 9px 14px; border-radius: 6px; cursor: pointer; }
.route-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.route-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: stage; }
.route-path li { position: relative; counter-increment: stage; }
.route-path li + li::before { content: ''; position: absolute; left: -18px; top: 50%; width: 18px; height: 1px; background: linear-gradient(90deg, var(--border-strong), var(--accent)); }
.route-path a { display: flex; flex-direction: column; gap: 6px; min-height: 128px; padding: 18px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); transition: border-color .18s, transform .18s; }
.route-path a::before { content: counter(stage, decimal-leading-zero); font: 11px/1 Consolas, monospace; color: var(--accent-text); letter-spacing: .1em; margin-bottom: 8px; }
.route-path a:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.route-stage-name { font-weight: 600; font-size: 16px; color: var(--text-primary); }
.route-stage-note { font-size: 13px; line-height: 1.45; color: var(--text-muted); }

/* Formats */
.formats-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.feature-formats table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.feature-formats th, .feature-formats td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.feature-formats thead th { font: 11px/1.5 Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); background: var(--bg-main); }
.feature-formats tbody th { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.feature-formats td { color: var(--text-secondary); }
.feature-formats tbody tr:last-child > * { border-bottom: 0; }

/* Call to try */
.features-page .feature-cta { padding: 0 0 92px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 40px 44px; border: 1px solid var(--accent-border); border-radius: 12px; background: linear-gradient(120deg, var(--accent-soft), transparent 70%), var(--bg-card); }
.cta-inner h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 8px; }
.cta-inner p { margin: 0; color: var(--text-secondary); }
.features-page .footer .fine { margin-top: 15px; }

/* Picture full size */
.shot-dialog { width: min(1400px, 96vw); }
.shot-dialog img { max-height: 84vh; background: var(--bg); }
.shot-dialog .dialog-note:empty { display: none; }

@media (max-width: 1100px) {
  .route-layout { grid-template-columns: 1fr; gap: 34px; }
}
@media (max-width: 960px) {
  .cover-layout { grid-template-columns: 1fr; gap: 28px; padding: 44px 0 40px; }
  .cover-art { max-width: 440px; }
  .feature-directory { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .feature-index { position: static; max-height: none; padding: 0; background: none; border: 0; }
  .index-heading { display: none; }
  .index-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); color: var(--text-primary); font: 600 15px Inter, sans-serif; cursor: pointer; }
  .index-toggle-label { flex: 1; text-align: left; }
  .index-toggle svg:last-child { transition: transform .18s; }
  .index-toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
  .has-js .feature-choices { display: none; }
  .has-js .index-toggle[aria-expanded="true"] + .feature-choices { display: flex; margin-top: 10px; padding: 14px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
  .workflow-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  .cover-art { display: none; }
  .index-toggle { scroll-margin-top: 12px; }
  .features-page section { padding: 60px 0; }
  .route-path { grid-template-columns: 1fr 1fr; }
  .route-path li:nth-child(odd)::before { display: none; }
  .route-path a { min-height: 112px; }
  .sheet-lead { font-size: 16px; }
  .feature-sheet h2 { font-size: 30px; }
  .cta-inner { flex-direction: column; align-items: flex-start; padding: 28px 22px; }
  .features-page .feature-cta { padding-bottom: 60px; }
  .feature-formats th, .feature-formats td { padding: 12px 12px; font-size: 13.5px; }
  .feature-formats tbody th { white-space: normal; }
}
@media (max-width: 420px) {
  .route-path { grid-template-columns: 1fr; }
  .route-path li::before { display: none; }
  .features-cover h1 { font-size: 40px; }
}
