/* ================================================================== */
/* marble content pages: /features/ and /guides/                        */
/* Loaded after /styles.css. Uses only its tokens (--ink, --muted,     */
/* --line, --surface ...) so light and dark mode follow data-theme.    */
/* ================================================================== */

/* hero ---------------------------------------------------------------- */

.page-hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 6vw, 64px);
}

.page-hero h1 {
  max-width: 20ch;
  font-size: clamp(2rem, 5.2vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.page-kicker {
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-lede {
  max-width: 58ch;
  margin-top: 20px;
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--muted);
}

/* breadcrumbs --------------------------------------------------------- */

.crumbs {
  margin-bottom: clamp(28px, 4vw, 40px);
  font-size: 0.82rem;
  color: var(--muted);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line);
}

.crumbs a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .crumbs a:hover {
    color: var(--ink);
  }
}

/* in-page nav --------------------------------------------------------- */

.page-toc {
  margin-top: clamp(28px, 4vw, 40px);
}

.page-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.page-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) {
  .page-toc a:hover {
    color: var(--ink);
    border-color: var(--ink);
  }
}

/* features: groups ---------------------------------------------------- */

.feature-group {
  scroll-margin-top: 72px;
}

.feature-group-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.feature-group-head {
  position: sticky;
  top: 96px;
}

.feature-group-head h2 {
  max-width: 16ch;
}

.feature-group-head > p:not(.page-kicker) {
  margin-top: 14px;
  max-width: 42ch;
  color: var(--muted);
}

.feature-group-shot {
  max-width: 280px;
  margin-top: 32px;
}

.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 40px);
}

.feature-item {
  padding: 20px 0 22px;
  border-top: 1px solid var(--line-soft);
}

.feature-item h3 {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.feature-item p {
  margin-top: 6px;
  font-size: 0.93rem;
  color: var(--muted);
}

/* inline code shared by features and guides */

.feature-item code,
.prose code,
.guide-answer code,
.page-faq-item code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 1px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}

/* guides: layout -------------------------------------------------------- */

.guide-container {
  max-width: 1040px;
}

.guide-answer {
  max-width: 62ch;
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1.04rem;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
  padding-bottom: clamp(56px, 8vw, 96px);
}

.guide-shot {
  position: sticky;
  top: 96px;
}

.guide-shot figcaption,
.feature-group-shot figcaption {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* guides: prose --------------------------------------------------------- */

.prose {
  max-width: 68ch;
}

.prose > * + * {
  margin-top: 16px;
}

.prose h2 {
  margin-top: 48px;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
}

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

.prose h3 {
  margin-top: 28px;
  font-size: 1.05rem;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 12px;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose strong,
.prose em {
  color: var(--ink);
}

.prose em {
  font-style: normal;
  font-weight: 500;
}

.prose ul {
  padding-left: 1.2em;
}

.prose ul li + li {
  margin-top: 8px;
}

.prose ul li::marker {
  color: var(--line);
}

/* numbered steps */

.steps {
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  counter-increment: step;
  padding: 14px 0 14px 44px;
  border-top: 1px solid var(--line-soft);
}

.steps li:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* format examples */

.format-example {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}

.format-example code {
  font: inherit;
  white-space: pre;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.format-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.format-table th,
.format-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.format-table th {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.format-table td {
  color: var(--muted);
}

.format-table td:first-child {
  width: 55%;
}

/* faq ------------------------------------------------------------------- */

.page-faq h2,
.related-guides h2 {
  margin-bottom: clamp(24px, 4vw, 36px);
}

.page-faq-list {
  max-width: 720px;
}

.page-faq-item {
  border-top: 1px solid var(--line-soft);
}

.page-faq-item:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.page-faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  font-weight: 500;
}

.page-faq-item summary::-webkit-details-marker {
  display: none;
}

.page-faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.page-faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.page-faq-item > p {
  max-width: 62ch;
  padding: 0 4px 22px;
  color: var(--muted);
}

/* guide lists (index + related) ------------------------------------------ */

.guide-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-list a {
  display: block;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.guide-list strong {
  display: block;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.guide-list span {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.guide-list a:active {
  transform: scale(0.99);
}

@media (hover: hover) {
  .guide-list a:hover {
    border-color: var(--ink);
  }
}

.guide-list-large a {
  padding: 24px;
}

.guide-list-large strong {
  font-size: 1.1rem;
}

.guides-index {
  border-top: 0;
  padding-top: 0;
}

/* cta -------------------------------------------------------------------- */

.page-cta {
  text-align: center;
}

.page-cta h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.page-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

/* responsive -------------------------------------------------------------- */

@media (max-width: 860px) {
  .feature-group-grid,
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-group-head,
  .guide-shot {
    position: static;
  }

  .feature-group-shot,
  .guide-shot {
    max-width: 240px;
  }

  .guide-shot {
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .feature-list,
  .guide-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-item code,
  .prose code,
  .guide-answer code,
  .page-faq-item code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .format-table td:first-child {
    width: auto;
  }

  .guide-answer {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-toc a,
  .guide-list a,
  .page-faq-item summary::after {
    transition: none;
  }
}
