/* =============================================================================
   KOKIRI COLORSCHEME THEME
   -------------------------------------------------------------------------
   WHAT: CSS custom properties for Kokiri brand colors across light/dark modes
   WHY:  Centralized color management ensures consistency with HYPERfix.nvim
   HOW:  CSS variables defined in :root and [data-theme="light"] selectors
   ============================================================================= */
:root {
  /* Dark theme (Kokiri primary) */
  --bg-color: #071524;
  --text-color: #a2faa2;
  --card-bg: #122030;
  --header-bg: #2f3e4f;
  --header-text: #a1ceff;
  --accent: #a8c5ff;
  --accent-hover: #93e5ff;
  --secondary: #e8bfff;
  --secondary-hover: #ffbca1;
  --logo-color: #a8c5ff;
  --footer-bg: #2f3e4f;
  --footer-text: #a1ceff;
  --comment-color: #5cb25e;
  --constant-color: #e8bfff;
  --string-color: #c5f19c;
  --keyword-color: #a2faa2;
  --special-color: #7ffbdd;
}

/* Light theme (Kokiri inverted for readability) */
[data-theme="light"] {
  --bg-color: #f0f1f5;
  --text-color: #122030;
  --card-bg: #f7f8fb;
  --header-bg: #e8ecf5;
  --header-text: #122030;
  --accent: #5a7eb5;
  --accent-hover: #4a6a9f;
  --secondary: #9a6df0;
  --secondary-hover: #ffbca1;
  --logo-color: #5a7eb5;
  --footer-bg: #e8ecf5;
  --footer-text: #122030;
  --comment-color: #5cb25e;
  --constant-color: #9a6df0;
  --string-color: #2d6938;
  --keyword-color: #2d6938;
  --special-color: #0f8ea0;
}

/* =============================================================================
   GLOBAL STYLES & BOX SIZING
   -------------------------------------------------------------------------
   WHAT: Base document styles, typography, and responsive box model
   WHY:  Establish consistent baseline and prevent layout overflow on mobile
   HOW:  box-sizing: border-box on all elements; body color/transition vars
   ============================================================================= */
* {
  box-sizing: border-box;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition:
    background 0.5s ease,
    color 0.5s ease;
}

/* =============================================================================
   HEADER & NAVIGATION
   -------------------------------------------------------------------------
   WHAT: Top-level header with theme toggle, banner, name, tagline, buttons
   WHY:  Introduction section with quick-access navigation and branding
   HOW:  Flex layout for buttons; absolute positioning for theme toggle
   ============================================================================= */
header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

h1,
h2 {
  margin-top: 0;
  color: var(--text-color);
}

h2 {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.3rem;
}

#banner-img,
.banner {
  display: block;
  margin: 0 auto;
  max-width: 1000px;
  width: 100%;
  height: auto;
}

/* =============================================================================
   THEME TOGGLE BUTTON
   -------------------------------------------------------------------------
   WHAT: Fixed circular button for light/dark mode switching (top-right)
   WHY:  Quick-access theme switcher without disrupting layout flow
   HOW:  position: absolute; border matches accent; hover inverts colors
   ============================================================================= */
#theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  background: var(--card-bg);
  color: var(--accent);
  transition:
    background 0.5s ease,
    transform 0.5s ease,
    color 0.5s ease;
}

#theme-toggle:hover {
  background: var(--accent);
  color: var(--bg-color);
  transform: scale(1.1);
}

/* =============================================================================
   BUTTONS & NAVIGATION
   -------------------------------------------------------------------------
   WHAT: Flex layout for horizontally-aligned button groups (badges, links)
   WHY:  Reusable container for navigation and action buttons
   HOW:  Flex with gap; .card variant left-aligns for card context
   ============================================================================= */
.buttons {
  margin-top: 1rem;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.buttons.card {
  justify-content: left;
}

.buttons a {
  display: flex;
  align-items: center;
}

/* =============================================================================
   MAIN CONTENT CARDS
   -------------------------------------------------------------------------
   WHAT: Project/content card containers with background, shadow, padding
   WHY:  Visual separation and grouping of content sections
   HOW:  Fixed max-width 900px, centered with margin auto, smooth transitions
   ============================================================================= */
.project-card {
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 2rem auto;
  max-width: 900px;
  transition:
    background 0.5s ease,
    color 0.5s ease;
}

.project-card.sub {
  background: var(--header-bg);
}

/* Semantic class for featured/spotlight project (inherits project-card style) */
.project-card.spotlight {
  /* NOTE: No additional styles; uses base .project-card styling */
}

.project-card ul {
  margin-top: 0.5rem;
}

/* =============================================================================
   CODE & TYPOGRAPHY
   -------------------------------------------------------------------------
   WHAT: Styling for code blocks, pre blocks, and semantic text elements
   WHY:  Visual distinction for technical content and code examples
   HOW:  monospace font, accent color borders, background contrast
   ============================================================================= */
pre {
  display: inline-block;
  overflow-x: auto;
  background: var(--header-bg);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

code {
  background: var(--header-bg);
  color: var(--string-color);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

.ascii-logo {
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.1;
  white-space: pre;
  color: var(--logo-color);
  text-align: center;
  margin: 1rem 0;
  display: block;
}

/* =============================================================================
   SEMANTIC COLOR CLASSES
   -------------------------------------------------------------------------
   WHAT: Utility classes for syntax-highlighting and content semantics
   WHY:  Reusable styling aligned with Kokiri code highlighting palette
   HOW:  Apply color variables to .comment, .string, .keyword, etc.
   ============================================================================= */
.comment {
  color: var(--comment-color);
}

.string {
  color: var(--string-color);
}

.keyword {
  color: var(--keyword-color);
  font-weight: bold;
}

.constant {
  color: var(--constant-color);
}

.special {
  color: var(--special-color);
}

/* =============================================================================
   IMAGE CONTAINERS
   -------------------------------------------------------------------------
   WHAT: Styling for preview containers and images within project cards
   WHY:  Flexible image layout with consistent borders and spacing
   HOW:  Flex layout for preview; images scale responsively
   ============================================================================= */
.preview {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.preview img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--accent);
  border-radius: 2px;
}

/* Responsive images in project cards (not within grid) */
.project-card > img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

/* =============================================================================
   MEDIA GALLERY & GRID LAYOUT
   -------------------------------------------------------------------------
   WHAT: Responsive grid for project screenshots and image galleries
   WHY:  Display project media (screenshots, demos) in organized layouts
   HOW:  CSS Grid with auto columns; responsive images with borders
   ============================================================================= */
.media-gallery {
  margin-top: 1.5rem;
  width: 100%;
}

.media-gallery h4,
.video-container h4 {
  color: var(--accent);
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--accent);
  border-radius: 6px;
  margin-top: 10px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.gallery-grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   VIDEO CONTAINER
   -------------------------------------------------------------------------
   WHAT: Responsive video player styling with border and spacing
   WHY:  Consistent video presentation matching image gallery design
   HOW:  width: 100%, border styling, rounded corners, margin offset
   ============================================================================= */
.video-container {
  margin-top: 1.5rem;
}

.video-container video {
	width: 100%;
	height: auto;
	max-width: 100%;
	border: 1px solid var(--accent);
	border-radius: 8px;
	margin-top: 10px;
}

/* Responsive videos in project cards (not within video-container) */
.project-card > video {
	width: 100%;
	max-width: 600px;
	height: auto;
	display: block;
	border-radius: 8px;
	margin: 0 auto;
}

/* =============================================================================
   FOOTER
   -------------------------------------------------------------------------
   WHAT: Bottom page section with background, padding, and metadata text
   WHY:  Separate visual and semantic footer from main content
   HOW:  Footer element uses footer-bg colors; small centered text
   ============================================================================= */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  margin-top: 2rem;
}
