@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f8f2e8;
  --bg-strong: #ede0c9;
  --paper: #fff9ef;
  --paper-glass: rgba(255, 251, 245, 0.8);
  --ink: #1f2521;
  --muted: #5c645d;
  --line: rgba(31, 37, 33, 0.12);
  --border: rgba(31, 37, 33, 0.08);
  --primary: #0f766e;
  --secondary: #d97706;
  --accent: #1d4ed8;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-soft: 0 14px 32px rgba(31, 37, 33, 0.12);
  --shadow-card: 0 10px 24px rgba(31, 37, 33, 0.08);
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --container: min(1080px, 92vw);
}

body[data-theme='sand'] {
  --bg: #f8f2e8;
  --bg-strong: #ede0c9;
  --paper: #fff9ef;
  --paper-glass: rgba(255, 251, 245, 0.8);
  --ink: #1f2521;
  --muted: #5c645d;
  --line: rgba(31, 37, 33, 0.12);
  --primary: #0f766e;
  --secondary: #d97706;
  --accent: #1d4ed8;
}

body[data-theme='graphite'] {
  --bg: #e9edf1;
  --bg-strong: #cfd6de;
  --paper: #f9fbff;
  --paper-glass: rgba(248, 251, 255, 0.82);
  --ink: #1e2730;
  --muted: #596775;
  --line: rgba(30, 39, 48, 0.16);
  --primary: #0f4c81;
  --secondary: #ea580c;
  --accent: #1d4ed8;
}

body[data-theme='cyan'] {
  --bg: #ecf8f8;
  --bg-strong: #d1efec;
  --paper: #f7fffd;
  --paper-glass: rgba(245, 255, 252, 0.78);
  --ink: #123338;
  --muted: #3f6668;
  --line: rgba(18, 51, 56, 0.16);
  --primary: #0f766e;
  --secondary: #0ea5a5;
  --accent: #0f4c81;
}

body[data-theme='night'] {
  --bg: #0f172a;
  --bg-strong: #1e293b;
  --paper: #111827;
  --paper-glass: rgba(17, 24, 39, 0.82);
  --ink: #e5edf8;
  --muted: #9fb0c6;
  --line: rgba(159, 176, 198, 0.22);
  --primary: #22c55e;
  --secondary: #38bdf8;
  --accent: #60a5fa;
  --shadow-soft: 0 16px 36px rgba(2, 6, 23, 0.45);
  --shadow-card: 0 10px 24px rgba(2, 6, 23, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  line-height: 1.6;
}

body,
.card,
.nav-wrap,
.nav-link,
.btn,
.badge,
.theme-switch,
.theme-switch-track,
.search-input {
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.page-ready {
  opacity: 1;
  transform: none;
}

body.page-exit {
  opacity: 0;
  transform: translateY(8px);
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(15, 118, 110, 0.24);
  color: #10231f;
}

img {
  max-width: 100%;
  display: block;
}

main {
  width: var(--container);
  margin: 0 auto;
  padding: 6rem 0 3rem;
}

section {
  margin-bottom: 2.5rem;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 600;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  margin-bottom: 0.8rem;
  margin-top: 1.2rem;
}

h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  margin-bottom: 0.4rem;
  margin-top: 0.6rem;
}

h3:first-child {
  margin-top: 0;
}

p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: var(--paper);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(31, 37, 33, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.1);
}

.btn-primary:hover {
  background: #0d5d57;
}

.btn-secondary {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  background: rgba(15, 118, 110, 0.06);
  border-color: var(--primary);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.footer {
  width: var(--container);
  margin: 0 auto;
  padding: 0 0 2rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.86rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer-text {
  margin: 0;
}

.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 0.25rem;
}

.social-link:hover {
  color: var(--text);
  transform: scale(1.1);
}

.social-link svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.cursor {
  display: none;
}

@media (max-width: 860px) {
  main {
    padding-top: 5.6rem;
  }

  .cursor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .card,
  .nav-wrap,
  .nav-link,
  .btn,
  .badge,
  .theme-switch,
  .theme-switch-track,
  .search-input {
    transition: none;
  }
}
