/* ---------- Design tokens ---------- */
:root {
  --bg: #0b0f1a;
  --bg-raised: #111827;
  --bg-card: #0f1524;
  --border: #1f2937;
  --text: #e5e9f0;
  --text-dim: #9aa5b5;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-ink: #04211d;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-dim: #475569;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-ink: #ffffff;
  --shadow: 0 10px 30px rgb(15 23 42 / 0.08);
  color-scheme: light;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-sub.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

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

.container {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.8rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  margin-right: auto;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  min-height: 24px;
}
.nav-links a:hover { color: var(--text); background: var(--bg-raised); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(3rem, 6vw, 5rem);
}
.hero-kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin-bottom: 1.25rem;
}
.hero-sub {
  max-width: 46rem;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 3.5rem; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  min-height: 24px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.1rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}
.stat dd {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat dt {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  order: 2;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-dim);
  max-width: 44rem;
  margin-bottom: 2.2rem;
}
.section-note {
  color: var(--text-dim);
  margin-top: 1.8rem;
  font-size: 0.95rem;
}

/* ---------- App cards ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.3rem;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
}
.app-head { display: flex; align-items: center; gap: 1rem; }
.app-head img { border-radius: 16px; flex-shrink: 0; }
.app-card h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
.app-tag { color: var(--text-dim); font-size: 0.9rem; }
.app-card > p { color: var(--text-dim); font-size: 0.97rem; }

.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips li {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.chips-lg li { font-size: 0.92rem; padding: 0.4rem 0.95rem; }

.store-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: auto; }
.store-links a {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.store-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Site cards ---------- */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.3rem;
}
.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
}
.site-card a {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.site-card img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.site-card h3 {
  font-size: 1.05rem;
  padding: 1rem 1.2rem 0.15rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.site-card .domain {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}
.site-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0 1.2rem 1.2rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
}
.about-grid p { color: var(--text-dim); margin-bottom: 1rem; }
.about-grid h2 { margin-bottom: 1rem; }
.about-links { display: flex; gap: 1.2rem; }
.about-links a { font-weight: 600; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section-sub { margin-inline: auto; }
.contact-alt { color: var(--text-dim); margin-top: 1.4rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.6rem;
  margin-top: 2rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- Error page ---------- */
.error-page {
  padding-block: 20vh;
  text-align: center;
}
.error-page h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.02em;
}
.error-page p {
  color: var(--text-dim);
  margin: 1rem 0 2rem;
}

/* ---------- Reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.visible { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  /* Hidden visually but kept for assistive tech — it is the link's accessible name. */
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .nav { gap: 0.4rem; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 0.45rem 0.55rem; font-size: 0.92rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-row { justify-content: center; text-align: center; }
}
@media (min-width: 1800px) {
  .container { width: min(1320px, 100% - 4rem); }
  body { font-size: 1.125rem; }
}

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