/* HELLBONES / Project 0 — Core Styles */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1e1e1e;
  --text-primary: #d4d4d4;
  --text-secondary: #888888;
  --text-dim: #444444;
  --accent: #8b0000;
  --accent-hover: #a00000;
  --accent-forest: #1a3a1a;
  --link: #cc4444;
  --link-hover: #ee6666;
  --border: #2a2a2a;
  --warning-bg: rgba(0, 0, 0, 0.85);
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-base);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Custom cursor — swap in Felis's bone cursor when ready */
  /* cursor: url('../img/cursor.png') 0 0, auto; */
}

body.dyslexia-font,
body.dyslexia-font * {
  font-family: 'OpenDyslexic', sans-serif !important;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Tab Navigation */
.site-tabs {
  display: flex;
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.site-tab {
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  transition: color 0.2s, background 0.2s;
}

.site-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.site-tab.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-color: var(--border);
  border-bottom: 1px solid var(--bg-secondary);
  margin-bottom: -1px;
}

/* Settings toggle — floats near comic */
.settings-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 2.4rem;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s, border-color 0.2s;
  position: absolute;
  top: 5rem;
  right: -9rem;
  z-index: 10;
}

.settings-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-dim);
}

/* Main content */
main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Footer */
.site-footer {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Settings panel */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.settings-panel.open {
  transform: translateX(0);
}

.settings-panel h3 {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.setting {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.setting:hover {
  color: var(--text-primary);
}

.setting input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-close {
  margin-top: 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  width: 100%;
}

.settings-close:hover {
  color: var(--text-primary);
  border-color: var(--text-dim);
}

/* Settings overlay */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  display: none;
}

.settings-overlay.open {
  display: block;
}

/* Visual snow / static overlay */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  animation: static-noise 0.15s steps(4) infinite;
}

@keyframes static-noise {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-10px, -15px); }
  50%  { transform: translate(5px, 10px); }
  75%  { transform: translate(-5px, -5px); }
  100% { transform: translate(10px, 5px); }
}

/* Disable static in reduce motion */
body.reduce-motion::after {
  animation: none;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
    opacity: 0;
  }
}

/* Utility */
.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;
}

/* Mobile */
@media (max-width: 640px) {
  .site-tab {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  main {
    padding: 1rem;
  }

  .settings-panel {
    width: 100%;
  }
}
