/* Stipli site. Colours and type come from design/tokens.json (light and dark). No build step. */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ground: #F4F7F5;
  --surface: #FFFFFF;
  --raised: #EDF2EF;
  --hairline: #DCE5E0;
  --ink: #10231F;
  --ink-muted: #4E625C;
  --primary: #0F7B6C;
  --primary-pressed: #0B5F54;
  --on-primary: #FFFFFF;
  --primary-tint: #E2F2EF;
  --primary-ink: #0B5F54;
  --apricot: #FF8A5B;
  --apricot-ink: #B4471C;
  --apricot-tint: #FFEBE1;
  --control-border: #AFC0B9;
  --shadow: 0 1px 2px rgba(16, 35, 31, 0.06), 0 8px 24px rgba(16, 35, 31, 0.07);
  --radius: 24px;
  --radius-small: 12px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0C1513;
    --surface: #14211E;
    --raised: #1B2B27;
    --hairline: #26403A;
    --ink: #E9F2EF;
    --ink-muted: #9DB3AC;
    --primary: #3CCBB4;
    --primary-pressed: #2FA893;
    --on-primary: #06231E;
    --primary-tint: #173A34;
    --primary-ink: #3CCBB4;
    --apricot: #FF9D75;
    --apricot-ink: #FF9D75;
    --apricot-tint: #3D261C;
    --control-border: #3D5A53;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

a {
  color: var(--primary-ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-small);
  z-index: 10;
}

.skip-link:focus {
  top: var(--gutter);
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.prose-wrap {
  max-width: 760px;
}

/* Header */

.site-header {
  padding-top: 20px;
  padding-bottom: 12px;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.wordmark {
  display: inline-flex;
  color: var(--ink);
  line-height: 0;
}

.wordmark svg {
  height: 32px;
  width: auto;
}

.wordmark .wordmark-letters {
  fill: currentColor;
}

.wordmark .wordmark-dots {
  fill: var(--apricot);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: inline-block;
  padding: 10px 0;
  min-height: 44px;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

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

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 0.12em;
}

/* Typography */

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.4rem;
}

.dot {
  color: var(--apricot);
}

.lead {
  font-size: 1.25rem;
  color: var(--ink-muted);
  max-width: 34rem;
}

.overline {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apricot-ink);
  margin: 0 0 0.75rem;
}

/* Landing */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 32px;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero-art {
  display: none;
}

.hero-art img {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.5rem;
}

.badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 8px 20px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
  border: 2px solid var(--ink);
}

.badge:hover {
  color: var(--ink);
  border-color: var(--primary);
}

.badge small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.badge strong {
  font-size: 1.0625rem;
  font-weight: 700;
}

.badge .soon {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apricot-ink);
}

.headlines {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.headline-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin: 0;
}

.headline-card h2 {
  font-size: 1.1875rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
}

.headline-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.promise {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.9375rem;
}

.promise li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.promise li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex: none;
}

/* Content pages */

main {
  flex: 1 0 auto;
}

.page-title {
  padding-top: 24px;
}

.page-title .updated {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin: 0.75rem 0 0;
}

.language-switch {
  margin-top: 1rem;
}

.language-switch p {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.language-switch ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}

.language-switch li {
  margin: 0;
}

.language-switch a {
  display: inline-block;
  padding: 10px 10px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink-muted);
}

.language-switch a:hover {
  color: var(--primary-ink);
}

.language-switch a[aria-current="true"] {
  background: var(--primary-tint);
  color: var(--primary-ink);
}

.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 1.5rem 0 0;
  box-shadow: var(--shadow);
}

.toc h2 {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.4rem;
  columns: 1;
}

.toc li {
  margin: 0;
  break-inside: avoid;
}

.toc a {
  display: inline-block;
  padding: 6px 0;
  text-decoration: none;
}

.prose {
  padding-top: 1.5rem;
  padding-bottom: 48px;
}

.prose section {
  scroll-margin-top: 16px;
}

.prose h2:first-child {
  margin-top: 2rem;
}

.callout {
  background: var(--apricot-tint);
  border-radius: var(--radius-small);
  padding: 16px 20px;
  margin: 1.5rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

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

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 0.9rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  font-size: 0.9375rem;
  display: grid;
  place-items: center;
}

details {
  background: var(--surface);
  border-radius: var(--radius-small);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

summary {
  cursor: pointer;
  padding: 14px 20px;
  min-height: 48px;
  font-weight: 700;
  list-style-position: inside;
}

details > :not(summary) {
  margin-left: 20px;
  margin-right: 20px;
}

details > p:last-child,
details > ul:last-child {
  margin-bottom: 0;
  padding-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-small);
  overflow: hidden;
  margin: 1rem 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}

th {
  background: var(--raised);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 719px) {
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    border-bottom: 8px solid var(--ground);
  }

  td {
    border-bottom: 1px solid var(--hairline);
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 2px;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  padding-bottom: 32px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.site-footer .footer-links li {
  margin: 0;
}

.site-footer .footer-links a {
  display: inline-block;
  padding: 10px 0;
  min-height: 44px;
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }

  .toc ol {
    columns: 2;
    column-gap: 32px;
  }

  .headlines {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    padding-top: 40px;
  }

  .hero-art {
    display: block;
    justify-self: center;
    width: 100%;
    max-width: 280px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  .badge {
    transition: color 120ms ease;
  }
}
