@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,700;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');
@import url('/css/mobile.css');

:root {
  --paper: #f3efe6;
  --paper-deep: #e8e2d6;
  --ink: #1a1814;
  --ink-soft: #3c3832;
  --ink-muted: #5a534b;
  --line: #d4cdc2;
  --accent: #c44b16;
  --accent-hover: #a33d10;
  --accent-soft: rgba(196, 75, 22, 0.1);
  --surface: #faf8f4;
  --surface-raised: #ffffff;
  --shadow: 0 1px 0 rgba(26, 24, 20, 0.06), 0 12px 40px -20px rgba(26, 24, 20, 0.12);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --max: 680px;
  --max-wide: 72rem;
  --nav-h: 4.25rem;
  --nav-bg: rgba(243, 239, 230, 0.9);
}

html.dark-theme {
  --paper: #1a1814;
  --paper-deep: #242019;
  --ink: #f3efe6;
  --ink-soft: #ddd7cc;
  --ink-muted: #b5aea3;
  --line: #3d3830;
  --accent: #e8652a;
  --accent-hover: #f07840;
  --accent-soft: rgba(232, 101, 42, 0.12);
  --surface: #221f1a;
  --surface-raised: #2a2620;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  --nav-bg: rgba(26, 24, 20, 0.92);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

a { color: inherit; }

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle-track {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.2s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 1px 3px rgba(26, 24, 20, 0.18);
  transition: transform 0.2s ease;
}

.theme-toggle input:focus-visible + .theme-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle input:checked + .theme-toggle-track {
  background: var(--accent);
}

.theme-toggle input:checked + .theme-toggle-track .theme-toggle-thumb {
  transform: translateX(22px);
}

html.dark-theme .theme-toggle-track {
  background: #3d3830;
}

html.dark-theme .theme-toggle-thumb {
  background: #f3efe6;
}

.nav-theme-wrap {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
}

.mobile-theme-label {
  color: var(--ink-muted) !important;
}

@media (max-width: 767px) {
  .theme-toggle-track {
    width: 42px;
    height: 24px;
  }

  .theme-toggle-thumb {
    width: 18px;
    height: 18px;
  }

  .theme-toggle input:checked + .theme-toggle-track .theme-toggle-thumb {
    transform: translateX(18px);
  }
}

nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line) !important;
}

nav .max-w-7xl {
  max-width: var(--max-wide);
}

nav a.text-xl,
nav .font-bold.text-white,
nav span.text-xl {
  font-family: var(--font-display) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

nav a.bg-bitcoin-orange,
nav a[href*="book-session"],
nav a[href*="cal.com/bitcoinnotcrypto"] {
  border-radius: 999px !important;
  font-weight: 600 !important;
}

footer {
  background: var(--paper-deep) !important;
  border-top: 1px solid var(--line) !important;
}

footer .text-gray-400,
footer p {
  color: var(--ink-muted) !important;
}

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details summary svg { transition: transform 0.2s ease; }
details[open] summary svg { transform: rotate(180deg); }

#contact-modal.hidden { display: none !important; }
#contact-modal.flex { display: flex !important; }

#contact-modal > div:last-child {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}

#contact-modal code {
  color: var(--accent) !important;
  background: var(--paper) !important;
  border-color: var(--line) !important;
}

#contact-modal-backdrop {
  background: rgba(26, 24, 20, 0.45) !important;
}

html.dark-theme #contact-modal-backdrop {
  background: rgba(0, 0, 0, 0.6) !important;
}

#floating-cta {
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow) !important;
}

article h1, article h2, article h3 {
  font-family: var(--font-display);
}

article a:not(.bg-bitcoin-orange):not([class*="rounded-lg bg-bitcoin"]) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
}

.ai-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
}

.ai-footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.ai-footer-link {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ai-footer-link:hover { color: var(--accent); }

.ai-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}
