/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Dark theme colors */
  --color-bg: #0d0d0d;
  --color-bg-elevated: #1a1a1a;
  --color-bg-hover: #252525;
  --color-text: #e5e5e5;
  --color-text-muted: #888;
  --color-accent: #3b82f6;
  --color-accent-hover: #60a5fa;
  --color-border: #333;

  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Layout */
  --container-max: 1200px;
  --border-radius: 8px;
  --border-radius-sm: 4px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ==========================================================================
   Base styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color: var(--color-text);
  font-size: 1em;
  line-height: 1.6;
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-system);
  font-size: var(--text-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/*
 * Remove text-shadow in selection highlight
 */

::-moz-selection {
  background: var(--color-accent);
  color: #fff;
  text-shadow: none;
}

::selection {
  background: var(--color-accent);
  color: #fff;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-md) 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-sm) 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin: 0 0 var(--space-sm) 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

ul, ol {
  margin: 0 0 var(--space-sm) 0;
  padding-left: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-bg-elevated);
  padding: 0.2em 0.4em;
  border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.section {
  padding: var(--space-lg) 0;
}

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

/* ==========================================================================
   Header & Navigation (Mobile-First)
   ========================================================================== */

.site-header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.logo:hover {
  color: var(--color-accent);
}

/* Mobile nav toggle button */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Hamburger animation when open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile navigation menu */
.nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg);
  padding: var(--space-md);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
}

.nav.is-open {
  transform: translateX(0);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0;
}

.nav-list a {
  display: block;
  padding: var(--space-sm) 0;
  font-size: var(--text-lg);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.nav-list a:hover,
.nav-list a.is-active {
  color: var(--color-accent);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.card-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.card-title a {
  color: var(--color-text);
}

.card-title a:hover {
  color: var(--color-accent);
}

.card-description {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.card-link {
  margin-top: auto;
}

/* Cards grid - mobile first (single column) */
.cards-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

/* ==========================================================================
   Badges / Pills
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
}

.badge-accent {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Status badges */
.badge-status {
  background-color: transparent;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-status-complete {
  color: #22c55e;
  border-color: #22c55e;
}

.badge-status-progress {
  color: #eab308;
  border-color: #eab308;
}

.badge-status-planned {
  color: #6b7280;
  border-color: #6b7280;
}

.badge-status-concept {
  color: #8b5cf6;
  border-color: #8b5cf6;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: var(--space-xl) 0;
  text-align: center;
}

.hero-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  margin-top: auto;
}

.site-footer .container {
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

.invisible {
  visibility: hidden;
}

/* Text utilities */
.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   Responsive Breakpoints (Desktop Enhancement)
   ========================================================================== */

/* Tablet and up (768px) */
@media only screen and (min-width: 768px) {
  /* Hide mobile nav toggle on desktop */
  .nav-toggle {
    display: none;
  }

  /* Desktop navigation */
  .nav {
    position: static;
    transform: none;
    padding: 0;
    background: none;
    overflow: visible;
  }

  .nav-list {
    display: flex;
    gap: var(--space-md);
  }

  .nav-list a {
    padding: var(--space-xs) 0;
    font-size: var(--text-base);
    border-bottom: none;
  }

  /* Hero enhancements */
  .hero {
    padding: var(--space-xl) 0;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }

  /* Cards grid - 2 columns on tablet */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (1024px) */
@media only screen and (min-width: 1024px) {
  .container {
    padding: 0 var(--space-md);
  }

  /* Cards grid - 3 columns on desktop */
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
