/* Cropmark marketing pages. Loaded after the editor's stylesheet, whose reset
   (Tailwind preflight) strips list markers, heading sizes and link colours —
   so everything the pages need is declared here explicitly.
   Tokens come from the editor stylesheet: --color-ink, --color-press, … */

:root {
  --measure: 68ch;
  --page-gutter: clamp(16px, 4vw, 40px);
  --wide: 1240px;
}

html {
  scroll-padding-top: 16px;
}

body.site {
  background: var(--color-sheet);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
}

/* Page typography stops at the tool frame: the embedded editor is styled by
   its own utilities, and an unlayered rule here would override them. The
   exclusion sits in :where() so it adds no specificity — .site-nav a and the
   other component rules below must still win over this default. */
.site a:where(:not(.tool-frame *)) {
  color: var(--color-press);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.site a:where(:not(.tool-frame *)):hover {
  color: var(--color-press-dark);
}

/* Off screen until focused. Moved by its own height, not a fixed offset: a
   fixed -40px left the bottom edge of the pill showing over the control strip. */
.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 8px 12px;
  background: var(--color-ink);
  color: #fff !important;
  border-radius: 6px;
  z-index: 50;
  transform: translateY(calc(-100% - 16px));
}

.skip-link:focus {
  transform: none;
}

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--color-rule);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-ink) !important;
  text-decoration: none !important;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.brand svg {
  width: 26px;
  height: 26px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  font-size: 15px;
}

.site-nav a {
  color: var(--color-ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--color-press);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  background: var(--color-press);
  color: #fff !important;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
  white-space: nowrap;
}

.button:hover {
  background: var(--color-press-dark);
}

.button.secondary {
  background: transparent;
  color: var(--color-ink) !important;
  box-shadow: inset 0 0 0 1px var(--color-rule);
}

.button.secondary:hover {
  background: var(--color-desk);
}

.lang-switch {
  font-size: 14px;
  color: var(--color-graphite) !important;
}

@media (max-width: 760px) {
  .site-nav .optional {
    display: none;
  }
}

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

.hero {
  padding-block: clamp(28px, 5vw, 56px) clamp(20px, 3vw, 32px);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--color-graphite);
}

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

.crumbs a {
  color: var(--color-graphite) !important;
  text-decoration: none !important;
}

.hero h1 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.9rem);
  line-height: 1.02;
  font-weight: 750;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero .lead {
  margin: 20px 0 0;
  max-width: var(--measure);
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
  line-height: 1.55;
  color: #343a41;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ---------------------------------------------------------------- the tool */

/* The one bold element: the live editor, framed by crop marks — the trim
   corners of a printed sheet. */
.tool {
  position: relative;
  margin-block: 8px clamp(48px, 7vw, 88px);
}

.tool-frame {
  position: relative;
  border: 1px solid var(--color-rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-sheet);
  box-shadow: 0 30px 60px -40px rgba(29, 33, 37, 0.45);
  /* The editor was designed at the browser's default size, not the page's 17px. */
  font-size: 16px;
  line-height: 1.5;
}

.tool-frame #editor-root {
  height: clamp(540px, 78vh, 820px);
}

.crop {
  position: absolute;
  inset: -14px;
  pointer-events: none;
}

.crop i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--color-ink);
  border-style: solid;
  border-width: 0;
}

.crop i:nth-child(1) { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
.crop i:nth-child(2) { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
.crop i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.crop i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }

.tool-caption {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--color-graphite);
}

.noscript-note {
  padding: 24px;
  font-size: 15px;
}

/* ---------------------------------------------------------------- sections */

.section {
  padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--color-rule);
}

.section h2 {
  margin: 0 0 20px;
  max-width: 28ch;
  font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.3rem);
  line-height: 1.1;
  font-weight: 700;
  font-stretch: 108%;
  letter-spacing: -0.02em;
}

.section .intro {
  margin: -6px 0 24px;
  max-width: var(--measure);
  color: #343a41;
}

.prose p {
  margin: 0 0 16px;
  max-width: var(--measure);
}

.prose h3 {
  margin: 28px 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.site code:where(:not(.tool-frame *)) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-desk);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

/* Claims with their proof: a two-column list, not a grid of cards. */
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 28px 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points li {
  max-width: 46ch;
}

.points h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 700;
}

.points p {
  margin: 0;
  color: #343a41;
}

/* A real sequence, so it is numbered. */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 28px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 44px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 750;
  font-stretch: 112%;
  color: var(--color-press);
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: #343a41;
  max-width: 40ch;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15.5px;
}

/* Comparison tables keep their columns readable and scroll sideways on a
   phone; two- and three-column tables simply wrap. */
.table-wrap table.wide {
  min-width: 680px;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-rule);
}

.table-wrap thead th {
  font-weight: 650;
  background: var(--color-desk);
}

.table-wrap tbody th {
  font-weight: 600;
}

.note {
  margin: 14px 0 0;
  font-size: 14.5px;
  color: var(--color-graphite);
  max-width: var(--measure);
}

.codeblock {
  margin: 0;
  padding: 16px 18px;
  border-radius: 8px;
  background: #1f2328;
  color: #e6edf3;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  max-width: 100%;
}

.codeblock code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

.code {
  margin: 0;
}

.code-label {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--color-graphite);
}

.stack > * + * {
  margin-top: 22px;
}

/* ---------------------------------------------------------------- templates */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery a {
  display: block;
  color: var(--color-ink) !important;
  text-decoration: none !important;
}

.gallery .sheet {
  display: block;
  aspect-ratio: 210 / 297;
  background: var(--color-desk);
  padding: 14px;
  border-radius: 6px;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  background: #fff;
  box-shadow: 0 1px 2px rgba(29, 33, 37, 0.12), 0 10px 24px -12px rgba(29, 33, 37, 0.35);
}

.gallery a:hover .sheet {
  background: #dce0e5;
}

.gallery .name {
  display: block;
  margin-top: 10px;
  font-weight: 650;
}

.gallery .desc {
  display: block;
  font-size: 14.5px;
  color: var(--color-graphite);
}

/* ---------------------------------------------------------------- FAQ */

.faq {
  max-width: 78ch;
}

.faq details {
  border-bottom: 1px solid var(--color-rule);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 32px 16px 0;
  position: relative;
  font-weight: 650;
}

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

.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 12px;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-graphite);
}

.faq details[open] summary::after {
  content: '−';
}

.faq .answer {
  padding: 0 0 18px;
  color: #343a41;
  max-width: var(--measure);
}

.faq .answer p {
  margin: 0 0 10px;
}

/* ---------------------------------------------------------------- related */

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--color-rule);
  color: var(--color-ink) !important;
  text-decoration: none !important;
  font-size: 15px;
}

.related a:hover {
  background: var(--color-desk);
}

.updated {
  margin: 0;
  padding-block: 24px 8px;
  border-top: 1px solid var(--color-rule);
  font-size: 14px;
  color: var(--color-graphite);
}

.cta .button {
  margin-top: 4px;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: 24px;
  padding-block: 40px 32px;
  background: var(--color-desk);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 28px;
}

.footer-grid h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.footer-tagline {
  margin: 10px 0 0;
  max-width: 30ch;
  color: var(--color-graphite);
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li {
  margin: 4px 0;
}

.footer-grid a {
  color: var(--color-ink) !important;
  text-decoration: none !important;
}

.footer-grid a:hover {
  color: var(--color-press) !important;
}

.footer-fine {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--color-rule);
  font-size: 13.5px;
  color: var(--color-graphite);
}

.footer-fine p {
  margin: 4px 0;
  max-width: none;
}

/* ---------------------------------------------------------------- misc */

.not-found {
  padding-block: 80px;
}

.not-found .related {
  margin-top: 28px;
}

@media print {
  .site-header,
  .site-footer,
  .tool {
    display: none;
  }
}
