/* ============================================================
   GearGate — style.css
   Mobile-first responsive design. No frameworks.
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #1B4332;
  --color-primary-light: #2D6A4F;
  --color-primary-dark: #143728;
  --color-bg: #FAF8F5;
  --color-accent: #D97706;
  --color-accent-hover: #B45309;
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #ddd;
  --color-card-bg: #fff;
  --color-star-filled: #D97706;
  --color-star-empty: #ccc;
  --font-heading: system-ui, -apple-system, Georgia, serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); margin-bottom: 0.4em; }

p { margin-bottom: 1em; }

ul, ol { margin-bottom: 1em; padding-left: 1.5em; }
li { margin-bottom: 0.3em; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3rem 0;
}

.section--alt {
  background: var(--color-primary);
  color: #fff;
}
.section--alt h2,
.section--alt h3 { color: #fff; }
.section--alt a { color: var(--color-accent); }
.section--alt a:hover { color: #F59E0B; }

/* --- Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-wordmark {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-wordmark:hover { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--color-accent); }

.nav-coffee {
  background: var(--color-accent);
  color: #fff !important;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.85rem !important;
  white-space: nowrap;
}
.nav-coffee:hover {
  background: var(--color-accent-hover);
  color: #fff !important;
}

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
  border-radius: 2px;
}

/* Mobile nav */
@media (max-width: 768px) {
  .hamburger { display: block; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: var(--color-primary-dark);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1.5rem 2rem;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 16px rgba(0,0,0,0.2);
  }

  .nav-links a { font-size: 1.1rem; }

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

  body.nav-open .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  body.nav-open .hamburger span:nth-child(2) {
    opacity: 0;
  }
  body.nav-open .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Overlay */
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.25rem);
  max-width: 800px;
  margin: 0 auto 0.75rem;
}

.hero p {
  color: rgba(255,255,255,0.85);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

@media (min-width: 768px) {
  .hero { padding: 5rem 0; }
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }

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

.btn--secondary {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn--secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn--outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.6);
}
.btn--outline-white:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* --- Card Grids --- */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 600px) {
  .hobby-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .hobby-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
  .hobby-grid { grid-template-columns: repeat(5, 1fr); }
}

.hobby-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
}
.hobby-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: var(--color-text);
}

.hobby-card__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.hobby-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  flex: 1;
}

.hobby-card__cost {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* Guide cards */
.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .guide-grid { grid-template-columns: repeat(3, 1fr); }
}

.guide-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--color-text);
}
.guide-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: var(--color-text);
}

.guide-card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.guide-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --- Star Widgets --- */
.stars {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.star {
  font-size: 1.2rem;
  line-height: 1;
}

.star--filled { color: var(--color-star-filled); }
.star--empty  { color: var(--color-star-empty); }

/* Interactive star picker */
.star-picker {
  display: inline-flex;
  gap: 4px;
  cursor: pointer;
  direction: rtl; /* trick for hover highlight */
}

.star-picker input { display: none; }

.star-picker label {
  font-size: 1.8rem;
  color: var(--color-star-empty);
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}

.star-picker label:hover,
.star-picker label:hover ~ label,
.star-picker input:checked ~ label {
  color: var(--color-star-filled);
}

/* --- Review Cards --- */
.review-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.review-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.review-card__hobby-tag {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: capitalize;
}

.review-card__time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

.review-card__comment {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* Aggregate rating display */
.aggregate-rating {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.aggregate-rating__number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.aggregate-rating__meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --- Tables (Gear Tier Lists) --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
}

.gear-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 500px;
}

.gear-table thead {
  background: var(--color-primary);
  color: #fff;
}

.gear-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.gear-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.gear-table tbody tr:hover {
  background: rgba(27,67,50,0.04);
}

.gear-table a {
  color: var(--color-accent);
  font-weight: 600;
}
.gear-table a:hover { text-decoration: underline; }

.tier-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.tier-badge--budget { background: #22C55E; color: #fff; }
.tier-badge--sweet  { background: #EAB308; color: #1a1a1a; }
.tier-badge--allin  { background: #EF4444; color: #fff; }

/* --- Quiz UI --- */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
}

.quiz-question {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  display: none;
}
.quiz-question.active { display: block; }

.quiz-question h3 {
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color var(--transition), background var(--transition);
  text-align: left;
  font-family: var(--font-body);
}
.quiz-option:hover {
  border-color: var(--color-primary);
  background: rgba(27,67,50,0.05);
}
.quiz-option.selected {
  border-color: var(--color-primary);
  background: rgba(27,67,50,0.1);
  font-weight: 600;
}

.quiz-progress {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.quiz-progress__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background var(--transition);
}
.quiz-progress__dot.done { background: var(--color-primary); }
.quiz-progress__dot.current { background: var(--color-accent); }

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.quiz-results {
  display: none;
}
.quiz-results.visible { display: block; }

.result-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  border-left: 4px solid var(--color-accent);
}

.result-card__rank {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.result-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.result-card__desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.result-card__cost {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* --- CTA Strip --- */
.cta-strip {
  background: linear-gradient(135deg, var(--color-accent) 0%, #B45309 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1rem;
}

.cta-strip h2 { color: #fff; margin-bottom: 0.5rem; }
.cta-strip p { color: rgba(255,255,255,0.9); margin-bottom: 1.5rem; }

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.char-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.form-message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.form-message--success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}
.form-message--error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-bar label {
  font-weight: 600;
  font-size: 0.9rem;
}

.filter-bar select {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
}

/* --- Stats Dashboard --- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card__number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-card__label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.chart-container {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.chart-container h3 {
  margin-bottom: 1rem;
}

.chart-container canvas {
  max-height: 350px;
}

/* --- About Page --- */
.about-content {
  max-width: 720px;
  margin: 0 auto;
}

.about-content h2 {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.about-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.disclosure-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.75);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-inner p { margin-bottom: 0.4rem; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.footer-links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}
.footer-links a:hover { color: var(--color-accent); }

.footer-links li + li::before {
  content: '\00B7';
  margin-right: 1rem;
  color: rgba(255,255,255,0.4);
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Print Styles --- */
@media print {
  .site-nav,
  .site-footer,
  .hamburger,
  .cta-strip,
  .btn,
  .quiz-container,
  .star-picker,
  form {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }

  .hero {
    background: none;
    color: #000;
    padding: 1rem 0;
  }
  .hero h1 { color: #000; }
  .hero p { color: #333; }

  .gear-table { min-width: 0; }
}
