/* Colors adapted from Tairiki (https://github.com/deparr/tairiki.nvim) — lua/tairiki/palette/light.lua & dark.lua */

:root {
  /* tairiki-light */
  --bg: #ffffff;
  --surface: #f0f0f8;
  --text: #001070;
  --text-secondary: #698989;
  --text-tertiary: #797979;
  --line: #d8d8d0;
  --line-strong: #c8c8c0;
  --accent: #0070c1;
  --accent-hover: #005c9e;
  --on-accent: #ffffff;
  --focus: #0070c1;
  --link: #0070c1;
  --link-hover: #df5926;
  /* CTA = Tairiki light.lua M.purple & M.light_purple (see github.com/deparr/tairiki.nvim) */
  --cta: #7929c8;
  --cta-hover: #693988;
  --on-cta: #ffffff;
  --shadow-1: rgba(0, 16, 112, 0.06);
  --shadow-2: rgba(0, 16, 112, 0.12);
  --purple: #7929c8;
  /* system-ui first per CSS Fonts Module; fallbacks for older engines */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Monaco, Consolas, monospace;
  --radius: 10px;
  --radius-pill: 999px;
  --max: 56rem;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* tairiki-dark */
    --bg: #151515;
    --surface: #1d1f21;
    --text: #c5c8c6;
    --text-secondary: #afb2b0;
    --text-tertiary: #969896;
    --line: #2c2f36;
    --line-strong: #3b3f4c;
    --accent: #81a2be;
    --accent-hover: #95b3d4;
    --on-accent: #151515;
    --focus: #7eada7;
    --link: #81a2be;
    --link-hover: #de935f;
    /* Same M.purple / M.light_purple — Tairiki dark.lua pastels are for text on bg, not solid fills + white */
    --cta: #7929c8;
    --cta-hover: #693988;
    --on-cta: #ffffff;
    --shadow-1: rgba(0, 0, 0, 0.25);
    --shadow-2: rgba(0, 0, 0, 0.45);
    --purple: #b294bb;
  }
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding-block: 0.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.025em;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  transition: background 0.18s var(--ease);
}

.brand:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.brand:active {
  opacity: 0.92;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 0.65rem;
}

.nav a {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.nav a:hover {
  color: var(--link-hover);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  box-shadow:
    0 1px 2px var(--shadow-1),
    0 2px 8px -2px var(--shadow-2);
}

.nav a:active {
  box-shadow: none;
  opacity: 0.92;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav__icon {
  font-size: 1rem;
  opacity: 0.88;
}

.nav a:hover .nav__icon {
  opacity: 1;
}

/* Hero */
.hero {
  padding: 3.5rem 1.5rem 2.75rem;
  text-align: center;
}

@media (min-width: 640px) {
  .hero {
    padding-top: 4.5rem;
    padding-bottom: 3.25rem;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.pill span {
  opacity: 0.5;
}

.hero h1 {
  margin: 0 auto 1rem;
  max-width: min(100%, 28rem);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.lede {
  margin: 0 auto 1.75rem;
  max-width: min(100%, 42rem);
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.62;
  text-wrap: pretty;
}

.lede strong {
  color: var(--text);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  padding: 0.35rem 0 0.5rem;
  margin-bottom: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 0.65rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    opacity 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
  text-decoration: none;
  font-family: inherit;
}

/* Primary CTA — Tairiki orange */
.button__icon {
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1;
}

.button--ghost .button__icon {
  opacity: 0.85;
}

.button--ghost:hover .button__icon {
  opacity: 1;
  color: var(--link);
}

.button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.button--primary:focus-visible {
  outline-color: var(--cta);
}

.button--primary {
  font-weight: 700;
  letter-spacing: -0.022em;
  background: var(--cta);
  color: var(--on-cta);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.12),
    inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.button--primary:hover {
  background: var(--cta-hover);
  text-decoration: none;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.14),
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    0 1px 3px var(--shadow-1);
}

.button--ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.button--ghost:hover {
  color: var(--link);
  text-decoration: none;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  box-shadow:
    inset 0 0 0 1px var(--link),
    0 2px 10px -4px var(--shadow-2),
    0 1px 3px var(--shadow-1);
}

.button--primary:active {
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.2);
  transition-duration: 0.08s;
}

.button--ghost:active {
  transition-duration: 0.08s;
  opacity: 0.92;
}

.hint {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: 0;
  padding: 0 0.5rem;
}

.download-footnote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  max-width: min(100%, 22rem);
  margin: 1.25rem auto 0;
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-tertiary);
  text-align: center;
}

.download-footnote__lead {
  margin: 0;
  display: block;
}

@media (min-width: 480px) {
  .download-footnote {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 0.75rem;
    row-gap: 0.5rem;
    max-width: 40rem;
  }
}

.inline-github-link {
  font-weight: 600;
  color: var(--link);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.inline-github-link:hover {
  color: var(--link-hover);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  box-shadow: 0 2px 8px -2px var(--shadow-2);
}

.inline-github-link:active {
  opacity: 0.92;
}

.inline-github-link .ph {
  font-size: 1.05em;
  opacity: 0.86;
}

.inline-github-link:hover .ph {
  opacity: 1;
}

/* Screenshot */
.shot {
  padding: 0 1.5rem 3rem;
}

.shot__frame {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow:
    0 1px 2px var(--shadow-1),
    0 24px 48px -12px var(--shadow-2);
}

.shot__frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Points — Yaak-style short value props */
.points {
  display: grid;
  gap: 0;
  padding: 0 1.5rem 3rem;
  border-top: 1px solid var(--line);
}

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

.point {
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .point {
    padding: 2rem 1.75rem;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }

  .point:last-child {
    border-right: none;
  }
}

.point h2 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--purple);
}

.point p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Detail list */
.detail {
  padding: 2.5rem 1.5rem 3.5rem;
}

.detail h2 {
  margin: 0 0 1.5rem;
  font-size: 0.6875rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

@media (min-width: 560px) {
  .detail-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
  }
}

.detail-list li {
  padding: 0.85rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
}

/* Callout */
.callout {
  margin: 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.callout-wrap {
  padding-bottom: 3.5rem;
}

.callout strong {
  color: var(--text);
  font-weight: 700;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem 2.5rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  row-gap: 1.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.site-footer .container > span:first-child {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.site-footer .container > span:last-child {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.site-footer a {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

.site-footer a:hover {
  color: var(--link-hover);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  box-shadow: 0 2px 8px -3px var(--shadow-2);
}

.site-footer a:active {
  opacity: 0.92;
}

.footer__source {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer__source .ph {
  font-size: 0.95em;
  opacity: 0.88;
}

.site-footer .footer__source:hover .ph {
  opacity: 1;
}

/* Pricing / simple pages */
.simple-main {
  padding: 3rem 1.5rem 4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.simple-main h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.032em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.simple-main .lede {
  font-weight: 500;
}

.simple-main .back {
  display: inline-flex;
  align-items: center;
  margin-top: 2.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

.simple-main .back:hover {
  color: var(--link-hover);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  box-shadow:
    inset 0 0 0 1px var(--link),
    0 2px 10px -4px var(--shadow-2),
    0 1px 3px var(--shadow-1);
}

.simple-main .back:active {
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .nav a,
  .button,
  .site-footer a,
  .inline-github-link,
  .simple-main .back {
    transition-duration: 0.01ms;
  }
}
