/* MinuteGate static site tokens (from spec §5.3) */
:root {
  --ink: #1e1a24;
  --paper: #faf7f2;
  --coral: #d04b0a;
  --coral-deep: #b03d08;
  --magenta: #c5167a;
  --citron: #c2ec3a;
  --border: rgba(30, 26, 36, 0.14);
  --focus: var(--coral);
  --focus-ring: 2px solid var(--focus);
  --r-sm: 10px;
  --w-read: 40rem;
  --w-content: 65rem;
  --w-wide: 75rem;
  --section-y: 4rem;
  --d-fast: 140ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", "Roboto Mono",
    monospace;
}

@media (min-width: 1280px) {
  :root {
    --section-y: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--coral-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

a:hover {
  color: var(--coral);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.skip-link:focus-visible {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__inner .wordmark {
  min-width: 0;
  flex-shrink: 1;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--coral);
}

.wordmark[aria-current="page"] {
  color: var(--ink);
}

.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-disclosure {
  position: relative;
}

.nav-disclosure__toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out);
}

.nav-disclosure__toggle::-webkit-details-marker {
  display: none;
}

.nav-disclosure__toggle::marker {
  content: "";
}

.nav-disclosure__toggle:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
}

.nav-disclosure__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  min-width: 12rem;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(30, 26, 36, 0.12);
}

.nav-disclosure:not([open]) .nav-disclosure__panel {
  display: none;
}

.nav-disclosure__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--r-sm) - 2px);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.nav-disclosure__link:hover {
  background: rgba(208, 75, 10, 0.08);
  color: var(--coral-deep);
}

.nav-disclosure__link[aria-current="page"],
.nav-disclosure__link[aria-current="location"] {
  background: rgba(208, 75, 10, 0.1);
  color: var(--coral-deep);
}

.nav-actions {
  display: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .nav-disclosure {
    display: none;
  }

  .nav-actions {
    display: flex;
    gap: 0.75rem;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .nav-actions .btn {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
    font-size: 0.9375rem;
  }
}

@media (min-width: 1280px) {
  .nav-actions .btn {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    font-size: 1rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}

.btn--primary {
  background: var(--coral-deep);
  color: #fff;
}

.btn--primary:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
}

.section {
  padding: var(--section-y) 1.25rem;
}

.section--ink {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.section--ink::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background: linear-gradient(
    12deg,
    transparent 40%,
    rgba(197, 22, 122, 0.12) 48%,
    rgba(197, 22, 122, 0.08) 52%,
    transparent 60%
  );
  pointer-events: none;
}

.section--ink > * {
  position: relative;
  z-index: 1;
}

.section--band {
  background: var(--paper);
  background-image: linear-gradient(
    12deg,
    rgba(208, 75, 10, 0.08) 0%,
    transparent 35%,
    transparent 65%,
    rgba(194, 236, 58, 0.15) 100%
  );
}

.container {
  max-width: var(--w-content);
  margin: 0 auto;
}

.container--narrow {
  max-width: var(--w-read);
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--coral);
}

.section--ink .eyebrow {
  color: var(--citron);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.625rem, 3.5vw, 2.25rem);
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 38rem;
}

.section--ink .lead {
  color: rgba(250, 247, 242, 0.92);
}

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

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 1.1fr;
  }
}

.hero-media picture,
.hero-media .img-slot,
.hero-media .site-img {
  width: 100%;
}

.site-img {
  display: block;
  max-width: 100%;
  height: auto;
  width: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
}

figure > .site-img {
  min-width: 0;
}

.img-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 26, 36, 0.06);
  border: 2px dashed rgba(30, 26, 36, 0.28);
  border-radius: var(--r-sm);
  color: rgba(30, 26, 36, 0.55);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  padding: 1rem;
}

.section--ink .img-slot {
  background: rgba(250, 247, 242, 0.06);
  border-color: rgba(250, 247, 242, 0.35);
  color: rgba(250, 247, 242, 0.65);
}

.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.ratio-9-16 {
  aspect-ratio: 9 / 16;
}

.ratio-2-3 {
  aspect-ratio: 2 / 3;
}

.ratio-1-1 {
  aspect-ratio: 1 / 1;
}

.hero-mobile {
  display: block;
}

.hero-desktop {
  display: none;
}

@media (min-width: 768px) {
  .hero-mobile {
    display: none;
  }

  .hero-desktop {
    display: block;
  }
}

.img-caption {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: rgba(30, 26, 36, 0.75);
}

.section--ink .img-caption {
  color: rgba(250, 247, 242, 0.7);
}

.split--spaced-top {
  margin-top: 2.5rem;
}

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--paper);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-sm);
  background: var(--citron);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.split {
  display: grid;
  gap: 2rem;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.split > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.meter-demo {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--paper);
}

.meter-demo__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.meter {
  height: 0.75rem;
  border-radius: 999px;
  background: rgba(30, 26, 36, 0.1);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--citron));
}

@media (prefers-reduced-motion: no-preference) {
  .meter__fill {
    animation: meter-pulse var(--d-fast) var(--ease-out) infinite alternate;
  }

  @keyframes meter-pulse {
    from {
      width: 40%;
    }
    to {
      width: 55%;
    }
  }
}

.code-block {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-block code {
  display: block;
}

.code-block .dim {
  color: rgba(250, 247, 242, 0.55);
}

.doc-page .doc-article {
  max-width: var(--w-read);
}

.doc-mirror {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.875rem;
  color: rgba(30, 26, 36, 0.75);
}

.doc-article h2 {
  margin-top: 2.5rem;
}

.doc-article h3 {
  margin-top: 1.75rem;
  font-size: 1.125rem;
}

.doc-article ul:not(.link-grid):not(.app-grid) {
  padding-left: 1.25rem;
}

.doc-article .link-grid > li + li,
.doc-article .app-grid > li + li {
  margin-top: 0;
}

.doc-article code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.doc-article li + li {
  margin-top: 0.5rem;
}

.doc-article p + p {
  margin-top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.code-block-wrap {
  margin-top: 1rem;
  position: relative;
}

.code-block-wrap__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.code-copy {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.code-copy:hover {
  border-color: var(--coral-deep);
  color: var(--coral-deep);
}

.code-copy[hidden] {
  display: none;
}

.code-copy:not([hidden]) {
  display: inline-flex;
}

.file-block-label {
  margin: 1rem 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.code-block--env-file {
  margin-top: 0;
}

@media (min-width: 1280px) {
  .doc-article {
    font-size: 1.0625rem;
  }

  .code-block {
    font-size: 0.875rem;
  }
}

.site-footer {
  background: var(--ink);
  color: rgba(250, 247, 242, 0.85);
  padding: 3rem 1.25rem;
}

.site-footer a {
  color: var(--citron);
}

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

.site-footer__inner {
  max-width: var(--w-content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.site-footer__brand {
  color: var(--paper);
  margin: 0;
}

.footer-nav {
  width: 100%;
}

.footer-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.footer-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.375rem 0;
  text-decoration: underline;
}

.footer-nav__link:hover {
  color: var(--paper);
}

.footer-meta {
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

.footer-legal {
  color: rgba(250, 247, 242, 0.85);
}

.footer-trademark {
  color: rgba(250, 247, 242, 0.75);
  font-size: 0.8125rem;
  max-width: 36rem;
}

@media (min-width: 768px) {
  .footer-nav__list {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1.5rem;
    row-gap: 0.25rem;
  }
}

.link-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 600px) {
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.link-grid > li {
  display: flex;
  min-height: 0;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  width: 100%;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  transition: border-color var(--d-fast) var(--ease-out);
}

.link-card:hover {
  border-color: var(--coral);
  color: var(--ink);
}

.link-card__title {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--coral-deep);
}

.link-card__desc {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
  color: rgba(30, 26, 36, 0.82);
}

.app-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 600px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.app-card {
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--paper);
}

.app-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.app-card h2 a {
  text-decoration: none;
  color: var(--ink);
}

.app-card h2 a:hover {
  color: var(--coral);
}

.app-card p {
  margin: 0;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

.api-table th,
.api-table td {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}

.api-table th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(30, 26, 36, 0.7);
}

.api-table code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  word-break: normal;
}

.api-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.nav-actions--wrap {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .nav-actions--wrap .btn {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
    font-size: 0.8125rem;
  }
}

@media (min-width: 1280px) {
  .site-footer__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
  }

  .footer-nav {
    flex: 1 1 auto;
    width: auto;
  }

  .footer-nav__list {
    justify-content: center;
  }

  .footer-legal {
    flex: 0 0 auto;
    text-align: right;
  }
}
