
/* ------------------------------
   Theme variables
--------------------------------*/

:root {
  --bg: #ffffff;
  --text: #333333;
  --muted-bg: #f9f9f9;
  --border: #eeeeee;
  --primary: #0077ff;
  --secondary: #555555;
  --hamburger-color: #000;

  /* layout */
  --content-width: 1100px;
  /* --content-width: 1400px; */
  --page-padding: 1.25rem;

  /* typography */
  --font-ui: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --text: #e6e6e6;
  --muted-bg: #1a1d24;
  --border: #2a2e39;
  --primary: #4c9aff;
  --secondary: #888888;
  --hamburger-color: #ffffff;
}

/* ------------------------------
   Global reset
--------------------------------*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ------------------------------
   Base typography
--------------------------------*/

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

/* ------------------------------
   Global typography system
--------------------------------*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-ui);
  letter-spacing: 0.015em;
  color: var(--text);
}

h1 {
  font-size: 2.2rem;
  font-weight: 300;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.6rem;
  font-weight: 400;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

section h1:first-child,
section h2:first-child,
section h3:first-child {
  margin-top: 0;
}

p {
  max-width: 90ch;
  line-height: 1.65;
  opacity: 0.9;
  margin-bottom: 1.25rem;
}

h1 + p,
h2 + p,
h3 + p {
  margin-top: 0;
}

p + p {
  margin-top: 0.5rem;
}

/* ------------------------------
   Layout container
--------------------------------*/

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

/* ------------------------------
   UI font utility
--------------------------------*/

.font-ui {
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

/* ------------------------------
   Navbar
--------------------------------*/

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.navbar-row {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.6rem var(--page-padding);
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo */

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
}

.logo-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transform: translateY(3px);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.01em;
}

/* Desktop nav */

.right-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-ui);
  font-weight: 400;
}

.nav a {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.nav a:hover {
  opacity: 1;
}

/* ------------------------------
   Theme toggle (toggles.dev)
--------------------------------*/

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: opacity 0.2s ease;
  transform: none;
}

/* Prevent mobile :active / focus glitches */
.theme-toggle:active svg,
.theme-toggle:focus svg {
  transform: none;
}

/* ------------------------------
   Mobile actions
--------------------------------*/

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ------------------------------
   Hamburger
--------------------------------*/

.hamburger {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--hamburger-color);
}

.hamburger svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

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

.nav-mobile {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem var(--page-padding);
  font-family: var(--font-ui);
  font-weight: 400;
}

.nav-mobile a {
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0;
}

/* ------------------------------
   Hero
--------------------------------*/

.hero-title {
  margin-top: 0;
}

.hero-subtitle {
  margin-top: 0.75rem;
  max-width: 520px;
  opacity: 0.8;
}

/* ------------------------------
   Sections
--------------------------------*/

section {
  padding: 3.5rem 0;
}

/* ------------------------------
   Responsive
--------------------------------*/

@media (min-width: 768px) {
  .hamburger,
  .nav-mobile {
    display: none;
  }
}

