/* ============================================
   Stet — docs stylesheet
   ============================================ */

:root {
  --color-teal: #2D6A6A;
  --color-teal-light: #3A8585;
  --color-teal-faint: #E8F0F0;
  --color-bg: #FAF8F5;
  --color-text: #2C2C2C;
  --color-text-secondary: #5A5A5A;
  --color-border: #E2DED8;
  --color-code-bg: #F0EDE8;
  --color-surface: rgba(255, 255, 255, 0.72);
  --color-surface-strong: #FFFFFF;
  --color-header-bg: rgba(250, 248, 245, 0.82);
  --color-panel-bg: rgba(255, 255, 255, 0.9);
  --color-shadow: rgba(20, 20, 20, 0.12);
  --color-shadow-strong: rgba(20, 20, 20, 0.22);
  --color-overlay: rgba(20, 20, 20, 0.3);
  --color-accent-weak: rgba(45, 106, 106, 0.08);
  --color-error: #A14D3A;
  --font-heading: "New York", Georgia, "Times New Roman", serif;
  --font-body: "SF Pro Text", "SF Pro", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  --content-width: 42rem;
  --nav-height: 3.5rem;
  color-scheme: light;
}

/* ---- Reset ---- */

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

/* ---- Base ---- */

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

:root[data-theme="dark"] {
  --color-teal-faint: rgba(45, 106, 106, 0.12);
  --color-bg: #1C1C1E;
  --color-text: #E5E5E7;
  --color-text-secondary: #A1A1A6;
  --color-border: #38383A;
  --color-code-bg: #2C2C2E;
  --color-surface: rgba(44, 44, 46, 0.82);
  --color-surface-strong: #2C2C2E;
  --color-header-bg: rgba(28, 28, 30, 0.82);
  --color-panel-bg: rgba(44, 44, 46, 0.94);
  --color-shadow: rgba(0, 0, 0, 0.34);
  --color-shadow-strong: rgba(0, 0, 0, 0.5);
  --color-overlay: rgba(0, 0, 0, 0.58);
  --color-accent-weak: rgba(45, 106, 106, 0.18);
  --color-error: #FF8E7A;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
}

/* ---- Site header / nav ---- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-header-inner {
  width: min(72rem, calc(100vw - 3rem));
  margin: 0 auto;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header-left {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.site-header-right {
  display: flex;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
}

.site-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.site-logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: 0 12px 28px var(--color-shadow);
}

.theme-toggle-button {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.theme-toggle-button:hover {
  color: var(--color-text);
}

.theme-toggle-button.is-active {
  background: var(--color-surface-strong);
  color: var(--color-text);
  box-shadow: 0 2px 8px var(--color-shadow);
}

.site-docs-menu {
  position: relative;
}

.site-docs-trigger {
  list-style: none;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.site-docs-trigger::-webkit-details-marker {
  display: none;
}

.site-docs-trigger span {
  width: 0.9rem;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.site-docs-menu[open] .site-docs-trigger,
.site-docs-trigger:hover {
  color: var(--color-teal);
  border-color: rgba(45, 106, 106, 0.25);
  background: var(--color-accent-weak);
}

.site-docs-panel {
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 0;
  width: min(21rem, calc(100vw - 2.5rem));
  max-height: min(70vh, 32rem);
  overflow: auto;
  padding: 1rem 1rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-panel-bg);
  box-shadow: 0 22px 60px var(--color-shadow-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.site-docs-panel-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
}

.site-docs-group + .site-docs-group {
  margin-top: 0.9rem;
}

.site-docs-group-label {
  margin-bottom: 0.45rem;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-docs-tree {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.95rem;
  border-left: 1px solid var(--color-border);
}

.site-docs-tree li {
  position: relative;
  margin: 0;
  max-width: none;
}

.site-docs-tree li::before {
  content: "";
  position: absolute;
  left: -0.95rem;
  top: 1rem;
  width: 0.7rem;
  height: 1px;
  background: var(--color-border);
}

.site-docs-tree a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.3rem;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.93rem;
  text-decoration: none;
}

.site-docs-tree a:hover {
  color: var(--color-teal);
}

.site-docs-tree a[aria-current="page"] {
  color: var(--color-teal);
  background: rgba(45, 106, 106, 0.07);
  font-weight: 600;
}

/* ---- Main content ---- */

.doc-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--color-teal);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
}

.home-hero {
  padding-top: 2rem;
  width: min(54rem, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

.home-hero h1 {
  max-width: 14em;
}

.home-hero .lede {
  max-width: 42rem;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button-link {
  display: inline-block;
  background: var(--color-teal);
  color: var(--color-bg) !important;
  text-decoration: none !important;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.button-link:hover {
  background: var(--color-teal-light);
  transform: translateY(-1px);
}

.button-link-secondary {
  background: transparent;
  color: var(--color-text) !important;
  border-color: var(--color-border);
}

.button-link-secondary:hover {
  background: var(--color-surface);
  color: var(--color-text) !important;
}


.home-hero-figure {
  margin-top: 2.5rem;
}

.full-width-shell {
  width: min(72rem, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

.home-grid {
  display: grid;
  width: min(58rem, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.home-card {
  padding: 1.35rem 1.4rem;
  min-height: 10.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 18px 40px var(--color-shadow);
}

.home-card h2 {
  margin: 0 0 0.4rem;
  padding: 0;
  border: 0;
  font-size: 1.15rem;
}

.home-card p {
  margin: 0;
  color: var(--color-text-secondary);
  max-width: none;
}

.home-feature-stack {
  display: grid;
  gap: 5rem;
  margin-top: 5rem;
}

.home-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 2.5rem;
  align-items: center;
}

.home-feature-reverse .home-feature-copy {
  order: 2;
}

.home-feature-reverse .home-feature-media {
  order: 1;
}

.feature-eyebrow {
  margin-bottom: 0.8rem;
  max-width: none;
  color: var(--color-teal);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-feature-copy h2,
.home-export h2 {
  margin: 0 0 0.9rem;
  padding: 0;
  border: 0;
  font-size: 2rem;
}

.home-feature-copy p:not(.feature-eyebrow),
.home-export > p:not(.feature-eyebrow) {
  color: var(--color-text-secondary);
  font-size: 1.03rem;
}

.home-feature-media {
  margin: 0;
}

.feature-list {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
}

.feature-list li {
  position: relative;
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  max-width: none;
  color: var(--color-text-secondary);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--color-teal);
}

.home-export {
  margin-top: 5rem;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.export-card {
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 18px 40px var(--color-shadow);
}

.export-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.export-card p {
  margin: 0;
  max-width: none;
  color: var(--color-text-secondary);
  font-size: 0.94rem;
}

.home-testimonial {
  margin-top: 5rem;
}

.home-testimonial-card {
  padding: 2.3rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: 0 24px 60px var(--color-shadow-strong);
}

.home-testimonial-quote {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-testimonial-quote p {
  margin: 0;
  max-width: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.28;
}

.home-testimonial-attribution {
  margin-top: 1.1rem;
  max-width: none;
  color: var(--color-text-secondary);
}

.home-privacy {
  margin-top: 3rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(45, 106, 106, 0.18);
  border-radius: 18px;
  background: var(--color-teal-faint);
}

.home-privacy p {
  margin: 0;
  max-width: none;
  text-align: center;
}

.support-shell {
  display: grid;
  gap: 2rem;
}

.support-card {
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: 0 24px 60px var(--color-shadow);
}

.support-form {
  display: grid;
  gap: 1.1rem;
}

.support-field label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
}

.support-field input,
.support-field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-strong);
  color: var(--color-text);
  font: inherit;
  line-height: 1.5;
  padding: 0.85rem 0.95rem;
}

.support-field textarea {
  min-height: 11rem;
  resize: vertical;
}

.support-field input:focus,
.support-field textarea:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 4px rgba(45, 106, 106, 0.12);
}

.support-form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.support-secondary-link {
  color: var(--color-text-secondary);
  font-weight: 500;
  text-decoration: none;
}

.support-secondary-link:hover {
  color: var(--color-teal);
}

.support-form-status {
  min-height: 1.4rem;
  margin: 0;
  max-width: none;
  font-size: 0.92rem;
}

.support-form-status.is-success {
  color: var(--color-teal);
}

.support-form-status.is-error {
  color: var(--color-error);
}

.support-form-note {
  margin: 0.15rem 0 0;
  max-width: none;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

.support-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.doc-figure {
  margin: 1.75rem 0 2.5rem;
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 50px var(--color-shadow);
  background: var(--color-surface-strong);
}

.doc-figure:not(.wide-figure) img {
  cursor: zoom-in;
}

.doc-figure figcaption {
  margin-top: 0.85rem;
  max-width: 65ch;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

.doc-figure figcaption strong {
  color: var(--color-text);
}

.wide-figure {
  width: min(72rem, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

.wide-figure img {
  border-radius: 22px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.image-lightbox.active {
  pointer-events: auto;
  visibility: visible;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  opacity: 0;
  transition: opacity 0.44s cubic-bezier(0.32, 0.72, 0, 1);
}

.image-lightbox.active .image-lightbox-backdrop {
  opacity: 1;
}

.image-lightbox-image {
  position: relative;
  max-width: min(88vw, 72rem);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px var(--color-shadow-strong);
  will-change: transform;
}

/* ---- Typography ---- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* First h2 after h1 doesn't need the top border */
h1 + hr + h2,
h1 + h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  max-width: 65ch;
}

/* ---- Links ---- */

.doc-content a {
  color: var(--color-teal);
  text-decoration: underline;
  text-decoration-color: var(--color-teal-light);
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.doc-content a:hover {
  color: var(--color-teal-light);
}

/* ---- Lists ---- */

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.35rem;
  max-width: 65ch;
}

li::marker {
  color: var(--color-teal);
}

/* ---- Blockquotes ---- */

blockquote {
  border-left: 3px solid var(--color-teal);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--color-teal-faint);
  border-radius: 0 6px 6px 0;
}

blockquote p {
  margin-bottom: 0;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

blockquote strong {
  color: var(--color-text);
}

/* ---- Inline code ---- */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--color-teal);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ---- Keyboard shortcuts ---- */

kbd {
  font-family: var(--font-body);
  font-size: 0.82em;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.15em 0.45em;
  color: var(--color-text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

/* ---- Tables ---- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.92rem;
}

thead {
  text-align: left;
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  padding: 0.6rem 1rem 0.6rem 0;
}

td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 1rem 0.6rem 0;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* ---- Horizontal rules ---- */
/* Used as section dividers in the doc — hide them since h2 has its own border */

hr {
  display: none;
}

/* ---- Strong / em ---- */

strong {
  font-weight: 600;
}

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

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 6rem;
  padding: 2rem 1.5rem;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  background: var(--color-surface);
}

.site-footer-inner {
  width: min(72rem, calc(100vw - 3rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: center;
}

.site-footer-brand {
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
}

.site-footer-note {
  margin: 0;
  max-width: none;
  text-align: center;
}

.site-footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--color-teal);
}

:root[data-theme="dark"] .button-link-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}
}

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

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .doc-content {
    padding: 2rem 1.25rem 4rem;
  }

  .home-hero {
    padding-top: 0.5rem;
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .home-hero .lede {
    max-width: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }


  .wide-figure {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .full-width-shell {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .home-grid {
    width: 100%;
    margin-left: 0;
    transform: none;
    grid-template-columns: 1fr;
  }

  .site-header-inner {
    width: calc(100vw - 2.5rem);
  }

  .site-header-left {
    gap: 0.8rem;
  }

  .theme-toggle-button {
    padding: 0.42rem 0.62rem;
  }

  table {
    font-size: 0.85rem;
  }

  .home-feature-copy h2,
  .home-export h2 {
    font-size: 1.55rem;
  }

  .home-testimonial-card {
    padding: 1.7rem 1.35rem;
  }

  .home-testimonial-quote p {
    font-size: 1.45rem;
  }

  .home-privacy p {
    text-align: left;
  }

  .support-card {
    padding: 1.35rem;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer-links {
    justify-content: center;
  }

  .export-grid {
    grid-template-columns: 1fr;
  }

  .support-form-actions {
    align-items: stretch;
  }

  .support-form-actions .button-link {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-feature {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .home-feature-copy {
    order: 2;
  }

  .home-feature-media {
    order: 1;
  }

  .export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
