/* Design tokens */
:root {
  --bg: #ffffff;
  --fg: #0b0f16;
  --muted: #5b6472;
  --accent: #2563eb;
  --card: #f4f6f8;
  --ring: rgba(37, 99, 235, 0.25);
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

/* Explicit theme tokens controlled by [data-theme] */
:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0b0f16;
  --muted: #5b6472;
  --accent: #2563eb;
  --card: #f4f6f8;
  --ring: rgba(37, 99, 235, 0.25);
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}
:root[data-theme="dark"] {
  --bg: #0b0f16;
  --fg: #e8eefc;
  --muted: #a4adbd;
  --accent: #7aa2ff;
  --card: #121826;
  --ring: rgba(122, 162, 255, 0.3);
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

/* Keep respecting system preference when no explicit theme chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b0f16;
    --fg: #e8eefc;
    --muted: #a4adbd;
    --accent: #7aa2ff;
    --card: #121826;
    --ring: rgba(122, 162, 255, 0.3);
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  }
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  margin: 0;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg), transparent 5%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in oklab, var(--fg), transparent 90%);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-logo .logo-bg {
  fill: var(--accent);
}

.brand-logo .logo-text {
  font-size: 10px;
  font-weight: 800;
  fill: white;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
  border-radius: 12px;
  padding: 6px 8px;
}

.nav-menu {
  display: flex;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav-menu a:focus, .nav-menu a:hover {
  background: color-mix(in oklab, var(--fg), transparent 92%);
  outline: none;
}

.theme-toggle {
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--fg);
}

.hero {
  padding: 72px 0 36px;
  background: radial-gradient(1000px 400px at 20% -10%, color-mix(in oklab, var(--accent), transparent 85%), transparent 60%), linear-gradient(180deg, transparent, transparent 70%);
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 60ch;
}

.cta {
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  box-shadow: var(--shadow);
}

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

.socials {
  display: flex;
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
/* Ensure social icons inherit theme color */
.socials a { color: var(--fg); }
.socials a svg { display: block; }
.socials a svg, .socials a svg path, .socials a svg circle, .socials a svg rect, .socials a svg polygon, .socials a svg line, .socials a svg polyline {
  fill: currentColor;
}
/* Preserve icons that intentionally have no fill */
.socials a svg [fill="none"] { fill: none !important; }

.section {
  padding: 44px 0;
  border-top: 1px solid color-mix(in oklab, var(--fg), transparent 90%);
}

.tags {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  flex-wrap: wrap;
}

.tags li {
  background: var(--card);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
}

.meta {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 10px 0;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

.list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.link:hover, .link:focus {
  text-decoration: underline;
  outline: none;
}

.contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.site-footer {
  padding: 30px 0 60px;
  color: var(--muted);
}

.tiny {
  font-size: 0.9rem;
}

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

@media (max-width: 640px) {
  .header-inner {
    grid-template-columns: 1fr auto auto;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav-menu {
    display: none;
    position: absolute;
    right: 20px;
    top: 54px;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
    border-radius: 14px;
    padding: 10px;
    box-shadow: var(--shadow);
  }
  .nav-menu.open {
    display: flex;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Focus styles */
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Utilities */
.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;
}

/* Theme overrides controlled by data-theme (appended to override earlier tokens) */
:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0b0f16;
  --muted: #5b6472;
  --accent: #2563eb;
  --card: #f4f6f8;
  --ring: rgba(37, 99, 235, 0.25);
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}
:root[data-theme="dark"] {
  --bg: #0b0f16;
  --fg: #e8eefc;
  --muted: #a4adbd;
  --accent: #7aa2ff;
  --card: #121826;
  --ring: rgba(122, 162, 255, 0.3);
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

/* Print tuning */
@media print {
  .nav, .theme-toggle, .cta, .socials, .contact-actions { display: none !important; }
  .section { break-inside: avoid; }
}
