:root {
  --red: #EB0A1E;
  --dark: #1C1C1C;
  --green: #4CAF50;
  --bg: #F2F2F2;
  --white: #FFFFFF;
  --border: #E0E0E0;
  --text: #333;
  --muted: #666;
  --radius: 6px;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER ── */
header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: white;
  text-decoration: none;
}

.logo span { color: var(--red); }

nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

nav ul a {
  color: #bbb;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
  text-decoration: none;
}

nav ul a:hover { color: white; }

nav ul a.fork-btn {
  color: var(--red);
  font-weight: 700;
  border: 1px solid rgba(235,10,30,0.4);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius);
}

nav ul a.fork-btn:hover { background: rgba(235,10,30,0.1); }

/* ── HERO ── */
.hero {
  background: var(--red);
  color: white;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 25px,
    rgba(0,0,0,0.04) 25px,
    rgba(0,0,0,0.04) 50px
  );
}

.hero > * { position: relative; }

.hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: 580px;
  margin: 0 auto 2rem;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── MAIN ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

section { margin-bottom: 3.5rem; }

h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.3em;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

p { margin-bottom: 0.75rem; color: var(--text); }

/* ── CARDS ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  text-decoration: none;
}

.card-icon { font-size: 1.8rem; margin-bottom: 0.6rem; }

.card h3 { font-size: 1rem; margin-bottom: 0.3rem; }

.card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.tag {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tag.hard { background: #FFEBEE; color: #B71C1C; }
.tag.medium { background: #FFF8E1; color: #E65100; }
.tag.easy { background: #E8F5E9; color: #2E7D32; }

/* ── STORY BOX ── */
.story-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--red);
}

.story-box p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #444;
}

/* ── NOTICE BOXES ── */
.notice {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.notice.tip { background: #E8F5E9; border-left: 4px solid #43A047; color: #1B5E20; }
.notice.warning { background: #FFF8E1; border-left: 4px solid #FFA000; color: #E65100; }
.notice.danger { background: #FFEBEE; border-left: 4px solid var(--red); color: #B71C1C; }
.notice strong { font-weight: 700; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.9rem;
}

thead { background: var(--dark); color: white; }

th, td {
  padding: 0.8rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { font-weight: 700; font-size: 0.8rem; letter-spacing: 0.5px; text-transform: uppercase; }

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FFF5F5; }

/* ── REPAIR PAGE ── */
.repair-header {
  background: var(--dark);
  color: white;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.repair-header h1 {
  font-size: 2.1rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.repair-header p {
  opacity: 0.75;
  font-size: 0.95rem;
  margin: 0;
}

.meta-tags {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.meta-tag {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red); }

.repair-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.repair-content h2 { margin-top: 2.25rem; margin-bottom: 1rem; }
.repair-content h3 { margin-top: 1.25rem; }

.repair-content ul, .repair-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.repair-content li { margin-bottom: 0.4rem; font-size: 0.95rem; }

.cost-table { margin: 1rem 0; }

/* ── CONTRIBUTE BANNER ── */
.contribute-banner {
  background: var(--dark);
  color: white;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  text-align: center;
}

.contribute-banner h2 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.contribute-banner h2::before { display: none; }

.contribute-banner p {
  color: #bbb;
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  transition: opacity 0.15s;
  text-decoration: none;
}

.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-red { background: var(--red); color: white; }
.btn-outline { border: 2px solid rgba(255,255,255,0.35); color: white; margin-left: 0.6rem; }

/* ── FOOTER ── */
footer {
  background: var(--dark);
  color: #888;
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.82rem;
  margin-top: 3rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a { color: #888; }
.footer-links a:hover { color: white; text-decoration: none; }

footer p { margin: 0.25rem 0; }
footer a { color: var(--red); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  nav ul li:nth-child(n+4):not(:last-child) { display: none; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  nav ul { gap: 0.75rem; }
  nav ul li:nth-child(n+3):not(:last-child) { display: none; }
  main { padding: 2rem 1rem; }
}
