/* ------------------------------------------------------------------
   Self-hosted Geist (variable weight 400–700), latin + latin-ext.
   ------------------------------------------------------------------ */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------
   Design tokens (shadcn "zinc" palette). Dark mode follows the OS.
   ------------------------------------------------------------------ */
:root {
  --background: #ffffff;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --ring: #a1a1aa;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #09090b;
    --foreground: #fafafa;
    --card: #101012;
    --card-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --primary: #fafafa;
    --primary-foreground: #18181b;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --ring: #52525b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 4px);
}

::selection {
  background: var(--foreground);
  color: var(--background);
}

.container {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@media (max-width: 640px) {
  .container {
    padding-inline: 1rem;
  }
}

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

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: -0.75rem;
}

.site-nav a {
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--foreground);
  background: var(--muted);
}

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

.site-header .btn {
  margin-right: -0.25rem;
}

/* ------------------------------------------------------------------
   Buttons (shadcn variants)
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 90%, var(--background));
}

.btn-outline {
  background: var(--background);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--muted);
}

.btn-ghost {
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  color: var(--foreground);
  background: var(--muted);
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
}

/* ------------------------------------------------------------------
   Badge / pill
   ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
}

.badge .dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding: 5.5rem 0 4rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 3rem 3rem;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 100%);
}

.hero h1 {
  margin: 1.25rem auto 1rem;
  max-width: 44rem;
  font-size: clamp(2.25rem, 1.2rem + 4.5vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero p {
  margin: 0 auto 2rem;
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.section {
  padding: 3.5rem 0;
  scroll-margin-top: 4rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0 0 0.375rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-header p {
  margin: 0;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------------
   App cards
   ------------------------------------------------------------------ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

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

@media (max-width: 600px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--border) 40%, var(--muted-foreground));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 1.5rem;
  flex: 1;
}

.card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  padding: 0 1.5rem 1.5rem;
}

.app-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 0.875rem;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), var(--shadow-sm);
}

.card h3 {
  margin: 1.25rem 0 0.125rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card .tagline {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.card .platforms {
  display: flex;
  gap: 0.375rem;
  margin: 0 0 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.feature-list li {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  line-height: 1.45;
}

.feature-list svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  margin-top: 0.2rem;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------------
   Support strip
   ------------------------------------------------------------------ */
.support {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.support h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.support p {
  margin: 0;
  color: var(--muted-foreground);
  max-width: 34rem;
  text-wrap: pretty;
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------
   Legal / long-form pages
   ------------------------------------------------------------------ */
.prose {
  max-width: 42rem;
  margin-inline: auto;
  padding: 3.5rem 0 4rem;
}

.prose header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.prose h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.prose .meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
  color: color-mix(in srgb, var(--foreground) 88%, var(--muted-foreground));
  text-wrap: pretty;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.375rem;
}

.prose li::marker {
  color: var(--muted-foreground);
}

.prose a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--foreground) 35%, transparent);
  transition: text-decoration-color 0.15s ease;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose .apps-covered {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}

.prose .apps-covered .badge {
  color: var(--foreground);
}

/* ------------------------------------------------------------------
   Error page
   ------------------------------------------------------------------ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 4rem 0;
}

.error-page .code {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.error-page h1 {
  margin: 0.75rem 0 0.75rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.error-page p {
  margin: 0 0 2rem;
  max-width: 28rem;
  color: var(--muted-foreground);
}
