/* ==========================================================================
   Sigline - sigline.app
   Hand-written CSS. No build step, no framework.
   Light palette lives on :root; dark mode only overrides the tokens.
   ========================================================================== */

:root {
  --bg: #fcfcfd;
  --bg-tint: rgba(250, 250, 250, 0.3);
  --surface: rgba(250, 250, 250, 0.5);
  --surface-hover: rgba(245, 245, 245, 0.5);

  --heading: #171717;
  --text: #404040;
  --muted: #525252;
  --subtle: #737373;
  --faint: #a3a3a3;

  --border: #e5e5e5;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;

  --badge-bg: #dbeafe;
  --badge-fg: #1e40af;

  --code-bg: #171717;
  --code-fg: #f5f5f5;
  --code-border: #262626;
  --code-inline-bg: #f5f5f5;
  --code-inline-fg: #171717;

  --nav-bg: rgba(255, 255, 255, 0.8);

  --invert-bg: #171717;
  --invert-fg: #ffffff;
  --invert-bg-hover: #262626;

  --container: 80rem;
  --measure: 48rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-tint: rgba(23, 23, 23, 0.1);
    --surface: rgba(23, 23, 23, 0.2);
    --surface-hover: rgba(23, 23, 23, 0.3);

    --heading: #f5f5f5;
    --text: #d4d4d4;
    --muted: #a3a3a3;
    --subtle: #737373;
    --faint: #525252;

    --border: #262626;

    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-contrast: #ffffff;

    --badge-bg: rgba(30, 58, 138, 0.3);
    --badge-fg: #93c5fd;

    --code-bg: #0a0a0a;
    --code-fg: #f5f5f5;
    --code-border: #262626;
    --code-inline-bg: #262626;
    --code-inline-fg: #f5f5f5;

    --nav-bg: rgba(10, 10, 10, 0.8);

    --invert-bg: #f5f5f5;
    --invert-fg: #171717;
    --invert-bg-hover: #e5e5e5;
  }
}

/* --------------------------------------------------------- reset + base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

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

h1,
h2,
h3 {
  color: var(--heading);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* Skip link, for keyboard users. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--heading);
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 0;
}

/* ------------------------------------------------------------- layout */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 2.5rem;
  }
}

.measure {
  max-width: var(--measure);
  margin-inline: auto;
}

.section {
  padding-block: 5rem;
}

.section--divided {
  border-top: 1px solid var(--border);
}

.section--tint {
  background: var(--bg-tint);
  padding-block: 8rem;
}

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nav.is-scrolled {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled .nav__inner {
  border-bottom-color: var(--border);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--heading);
  font-size: 1.125rem;
  font-weight: 600;
}

.nav__brand img {
  border-radius: 0.5rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__link {
  color: var(--muted);
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

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

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn--outline {
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  background: var(--surface-hover);
  color: var(--heading);
}

.btn--invert {
  background: var(--invert-bg);
  color: var(--invert-fg);
}

.btn--invert:hover {
  background: var(--invert-bg-hover);
  color: var(--invert-fg);
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
}

.btn--md {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.hero {
  padding-block: 5rem;
}

@media (min-width: 768px) {
  .hero {
    padding-block: 8rem;
  }
}

.hero__grid {
  display: grid;
  gap: 4rem;
  align-items: center;
}

/* Grid and flex children default to min-width:auto, which means a wide enough
   child can refuse to shrink and push the page past the viewport. Nothing here
   does that today - this is a guard so it stays that way when something wider
   gets added later. */
.hero__grid > *,
.features > *,
.nav__inner > *,
.post-card__head > * {
  min-width: 0;
}

.hero__shot {
  width: 100%;
}

@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: 38% 62%;
  }
}

.hero__icon {
  border-radius: 22px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .hero__title {
    font-size: 3.75rem;
  }
}

.hero__lead {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.hero__note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* ----------------------------------------------------------- features */

.features {
  display: grid;
  gap: 3rem;
  max-width: 56rem;
  margin-inline: auto;
}

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

.feature__icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--heading);
  margin-bottom: 1rem;
}

.feature h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.875rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--badge-bg);
  color: var(--badge-fg);
}

/* -------------------------------------------------------------- panel */

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
}

.panel h2,
.panel h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.panel p {
  color: var(--muted);
  max-width: 42rem;
  margin-inline: auto;
  margin-bottom: 2rem;
  line-height: 1.625;
}

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

.cta {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

.cta h2 {
  font-size: 1.875rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .cta h2 {
    font-size: 2.25rem;
  }
}

.cta p {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.625;
}

.cta__note {
  font-size: 0.875rem;
  color: var(--subtle);
  margin-top: 1.25rem;
}

/* --------------------------------------------------------- page heads */

.page {
  padding-block: 5rem;
}

.page__title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.page__lead {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 3rem;
  line-height: 1.625;
}

.page__meta {
  color: var(--muted);
  margin-bottom: 3rem;
}

/* ---------------------------------------------------------- blog list */

.post-card {
  display: block;
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1.5rem;
  color: inherit;
  transition: background-color 0.15s ease;
}

.post-card + .post-card {
  margin-top: 1rem;
}

.post-card:hover {
  background: var(--surface-hover);
  color: inherit;
}

.post-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.post-card__head h2 {
  font-size: 1.25rem;
  transition: color 0.15s ease;
}

.post-card:hover .post-card__head h2 {
  color: var(--accent);
}

.post-card__arrow {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: var(--faint);
  transition: color 0.15s ease;
}

.post-card:hover .post-card__arrow {
  color: var(--accent);
}

.post-card p {
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.625;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--subtle);
}

/* ------------------------------------------------------------ article */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--heading);
}

.back-link svg {
  width: 1rem;
  height: 1rem;
}

.article__header {
  margin-bottom: 3rem;
}

.article__header h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .article__header h1 {
    font-size: 3rem;
  }
}

/* Long-form body copy. Rhythm is handled here so the markup stays clean. */
.prose > * + * {
  margin-top: 1.5rem;
}

.prose p {
  color: var(--text);
  line-height: 1.625;
}

.prose .lead {
  font-size: 1.125rem;
  color: var(--muted);
  line-height: 1.625;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* Only the bottom margin is zeroed here. Zeroing margin-block too would beat
   the `.prose > * + *` flow rule on specificity and jam lists against the
   paragraph above them. */
.prose ul,
.prose ol {
  color: var(--text);
  padding-left: 1.5rem;
  margin-bottom: 0;
  line-height: 1.625;
}

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

.prose strong {
  color: var(--heading);
  font-weight: 600;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: 3rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.figure {
  margin-block: 2rem;
}

.figure img {
  width: 100%;
}

.figure figcaption {
  font-size: 0.875rem;
  color: var(--subtle);
  text-align: center;
  margin-top: 0.25rem;
}

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

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0;
}

pre code {
  color: var(--code-fg);
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
}

:not(pre) > code {
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

.article__cta {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

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

.footer {
  border-top: 1px solid var(--border);
  margin-top: 6rem;
  padding-block: 3rem;
}

.footer__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer__row {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer__copy {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer__links a:hover {
  color: var(--heading);
}

.footer__disclaimer {
  font-size: 0.75rem;
  color: var(--subtle);
  text-align: center;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .footer__disclaimer {
    text-align: left;
  }
}

/* ------------------------------------------------------------ utility */

.stack-sm > * + * {
  margin-top: 1rem;
}

.stack > * + * {
  margin-top: 1.5rem;
}

.address {
  color: var(--text);
  font-style: normal;
  line-height: 1.625;
}

.strong-line {
  color: var(--heading);
  font-weight: 600;
}
