/*
Theme Name: Not Here To Fuck Spiders
Theme URI: https://notheretofuckspiders.art
Author: Wei Zang
Author URI: https://notheretofuckspiders.art
Description: A high-assurance, Google Antigravity-inspired block theme featuring Tokyo cyber noir aesthetics, dark and light mode architecture, and strict WCAG 2.2 Level AA accessibility compliance.
Version: 2.0.0
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: notheretofuckspiders
Tags: block-theme, full-site-editing, accessibility-ready, custom-colors, custom-typography
*/

/* Antigravity Micro-Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
  background-color: var(--wp--preset--color--base, #0b0d13);
  color-scheme: dark light;
}

body {
  margin: 0;
  line-height: 1.65;
  background-color: var(--wp--preset--color--base, #0b0d13);
  color: var(--wp--preset--color--contrast, #f4f5f8);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================================================================
   Dark / Light Mode Dynamic Variable Inversion
   ========================================================================== */

/* Light Mode: Automatic via OS preference when not explicitly dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --wp--preset--color--base: #f8f9fc;
    --wp--preset--color--surface: #ffffff;
    --wp--preset--color--surface-elevated: #eff2f7;
    --wp--preset--color--surface-highest: #e1e6ec;
    --wp--preset--color--divider: rgba(0, 0, 0, 0.08);
    --wp--preset--color--contrast: #18191d;
    --wp--preset--color--contrast-secondary: #45474d;
    --wp--preset--color--muted: #5f6368;
    --wp--preset--color--cyan: #007c8a;
    --wp--preset--color--neon-pink: #c20059;
    --wp--preset--color--amber: #b59b00;
  }
}

/* Explicit Light Mode Override */
:root[data-theme="light"] {
  --wp--preset--color--base: #f8f9fc;
  --wp--preset--color--surface: #ffffff;
  --wp--preset--color--surface-elevated: #eff2f7;
  --wp--preset--color--surface-highest: #e1e6ec;
  --wp--preset--color--divider: rgba(0, 0, 0, 0.08);
  --wp--preset--color--contrast: #18191d;
  --wp--preset--color--contrast-secondary: #45474d;
  --wp--preset--color--muted: #5f6368;
  --wp--preset--color--cyan: #007c8a;
  --wp--preset--color--neon-pink: #c20059;
  --wp--preset--color--amber: #b59b00;
}

/* Explicit Dark Mode Override */
:root[data-theme="dark"] {
  --wp--preset--color--base: #0b0d13;
  --wp--preset--color--surface: #141722;
  --wp--preset--color--surface-elevated: #1e2230;
  --wp--preset--color--surface-highest: #262b3a;
  --wp--preset--color--divider: rgba(255, 255, 255, 0.08);
  --wp--preset--color--contrast: #f4f5f8;
  --wp--preset--color--contrast-secondary: #9aa0a6;
  --wp--preset--color--muted: #6e7681;
  --wp--preset--color--cyan: #00f0ff;
  --wp--preset--color--neon-pink: #ff007f;
  --wp--preset--color--amber: #f9e300;
}

/* Link Aesthetics */
a {
  color: var(--wp--preset--color--cyan, #00f0ff);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: var(--wp--preset--color--neon-pink, #ff007f);
  text-decoration: none;
}

/* WCAG 2.2 AA High-Visibility Focus Ring */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--wp--preset--color--cyan, #00f0ff) !important;
  outline-offset: 3px !important;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 1.5rem;
  z-index: 100000;
  padding: 0.75rem 1.5rem;
  background: var(--wp--preset--color--surface-elevated, #1e2230);
  color: var(--wp--preset--color--contrast, #f4f5f8);
  border: 1px solid var(--wp--preset--color--cyan, #00f0ff);
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.skip-link:focus {
  top: 1.5rem;
}

/* Antigravity Frosted Glass Header */
.site-header-frosted {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(11, 13, 19, 0.82) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--wp--preset--color--divider, rgba(255, 255, 255, 0.08));
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

:root[data-theme="light"] .site-header-frosted {
  background: rgba(255, 255, 255, 0.85) !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-header-frosted {
    background: rgba(255, 255, 255, 0.85) !important;
  }
}

/* Antigravity Card Grid Matrix */
.antigravity-card {
  background: var(--wp--preset--color--surface, #141722) !important;
  border: 1px solid var(--wp--preset--color--divider, rgba(255, 255, 255, 0.08)) !important;
  border-radius: 16px !important;
  padding: 1.75rem !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
  display: flex;
  flex-direction: column;
  justifyContent: space-between;
}

.antigravity-card:hover {
  transform: translateY(-2px);
  border-color: var(--wp--preset--color--cyan, #00f0ff) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 0 20px rgba(0, 240, 255, 0.15);
}

:root[data-theme="light"] .antigravity-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .antigravity-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
}

/* Pill Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wp--preset--color--cyan, #00f0ff);
  width: fit-content;
}

:root[data-theme="light"] .badge-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #007c8a;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .badge-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #007c8a;
  }
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Modern Outline Pill Button */
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 1px solid var(--wp--preset--color--divider, rgba(255, 255, 255, 0.16)) !important;
  color: var(--wp--preset--color--contrast, #f4f5f8) !important;
  background-color: transparent !important;
  border-radius: 9999px !important;
  transition: all 0.2s ease !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--cyan, #00f0ff) !important;
  color: var(--wp--preset--color--cyan, #00f0ff) !important;
}

/* Theme Toggle Button (WCAG 44x44px Touch Target) */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--wp--preset--color--contrast, #f4f5f8);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--wp--preset--color--cyan, #00f0ff);
}

:root[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #18191d;
}

:root[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: #007c8a;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #18191d;
  }
  :root:not([data-theme="dark"]) .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: #007c8a;
  }
}

/* Code Snippet Polish */
pre.wp-block-code {
  background: var(--wp--preset--color--surface, #141722) !important;
  border: 1px solid var(--wp--preset--color--divider, rgba(255, 255, 255, 0.08)) !important;
  border-radius: 12px !important;
}

:root[data-theme="light"] pre.wp-block-code {
  background: #eff2f7 !important;
  color: #1e293b !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) pre.wp-block-code {
    background: #eff2f7 !important;
    color: #1e293b !important;
  }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
