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

body {
  font-family: '0xProto', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.95rem;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #3b82f6;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  font-size: 0.9rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

main {
  max-width: 800px;
  width: 100%;
}

header {
  margin-bottom: 2.5rem;
  text-align: center;
}

h1 {
  font-family: 'Permanent Marker', cursive;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.tagline {
  color: #999;
  margin-top: 0.25rem;
  font-size: 1rem;
}

/* About callout */
.about-callout {
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  color: #bbb;
  line-height: 1.6;
}

.about-callout p + p {
  margin-top: 0.5rem;
}

.about-callout strong {
  color: #fff;
}

.about-callout a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.85rem;
}

.about-callout a:hover {
  text-decoration: underline;
}

/* Challenge card */
.challenge-card {
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 1.75rem;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.challenge-date {
  color: #999;
  font-size: 0.85rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.badge.easy {
  background: #0d3b1e;
  color: #4ade80;
}

.badge.medium {
  background: #3b2e0d;
  color: #facc15;
}

.badge.hard {
  background: #3b0d0d;
  color: #f87171;
}

.challenge-card h2 {
  font-size: 1.35rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.challenge-card p {
  color: #bbb;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* Code block — IDE style */
.code-block {
  background: #1a1a2e;
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.code-block-header {
  background: #16162a;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid #2a2a3e;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-block-title {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #999;
}

.code-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  background: #1a1a2e !important;
  margin: 0;
}

.code-block code {
  font-family: '0xProto', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  background: none !important;
  white-space: pre;
}

/* Goals */
.challenge-goals {
  margin-bottom: 1.25rem;
}

.challenge-goals h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.5rem;
}

.challenge-goals ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.challenge-goals li {
  font-size: 0.9rem;
  line-height: 1.4;
  padding-left: 1rem;
  position: relative;
  color: #ccc;
}

.challenge-goals li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: #4ade80;
}

/* Hints — collapsible */
.challenge-hints-details {
  margin-bottom: 1.25rem;
}

.challenge-hints-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  padding: 0.5rem 0;
  list-style: none;
}

.challenge-hints-details summary::-webkit-details-marker {
  display: none;
}

.challenge-hints-details summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.65rem;
  transition: transform 0.15s;
  color: #facc15;
}

.challenge-hints-details[open] summary::before {
  transform: rotate(90deg);
}

.challenge-hints {
  margin-top: 0.5rem;
}

.challenge-hints ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.challenge-hints li {
  font-size: 0.9rem;
  line-height: 1.4;
  padding-left: 1rem;
  position: relative;
  color: #aaa;
}

.challenge-hints li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #facc15;
}

/* Docs */
.challenge-docs {
  margin-bottom: 1.25rem;
}

.challenge-docs h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.5rem;
}

.challenge-docs ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.challenge-docs li {
  font-size: 0.9rem;
  line-height: 1.4;
  padding-left: 1rem;
  position: relative;
}

.challenge-docs li::before {
  content: "\2197";
  position: absolute;
  left: 0;
  color: #3b82f6;
}

.challenge-docs a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
}

.challenge-docs a:hover {
  text-decoration: underline;
}

/* CTA buttons row */
.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #151515;
  color: #e0e0e0;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: 1px solid #333;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s;
  flex: 1;
  justify-content: center;
  min-width: 200px;
}

.cta-button:hover {
  background: #1a1a1a;
  border-color: #999;
}

.cta-primary {
  border-color: #3b82f6;
}

.cta-primary:hover {
  border-color: #60a5fa;
}

.cta-button .csb-icon,
.cta-button .sb-icon {
  height: 1.2em;
  width: auto;
}

/* Clone section */
.clone-section {
  margin-top: 0.25rem;
}

.clone-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.5rem;
}

.clone-box {
  display: flex;
  align-items: center;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}

.clone-box code {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-family: '0xProto', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  color: #ccc;
  white-space: nowrap;
  overflow-x: auto;
  user-select: all;
}

.clone-copy-btn {
  background: none;
  border: none;
  border-left: 1px solid #2a2a2a;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  color: #999;
  font-size: 0.85rem;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-family: inherit;
}

.clone-copy-btn:hover {
  color: #e0e0e0;
  background: #1a1a1a;
}

.clone-copy-btn.copied {
  color: #4ade80;
}

/* Focus styles for accessibility */
a:focus-visible,
summary:focus-visible,
.cta-button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Archive table */
.archive-table {
  width: 100%;
  border-collapse: collapse;
}

.archive-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #333;
}

.archive-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: #ccc;
  border-bottom: 1px solid #1a1a1a;
  vertical-align: top;
}

.archive-table a {
  color: #3b82f6;
  text-decoration: none;
}

.archive-table a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  margin-top: 2.5rem;
  text-align: center;
}

footer p {
  color: #999;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

footer a {
  color: #3b82f6;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-note {
  font-size: 0.75rem;
  color: #666;
  max-width: 480px;
  margin: 0.5rem auto 0;
  line-height: 1.5;
}

.flag-icon {
  height: 1.15em;
  width: auto;
  vertical-align: middle;
  border-radius: 2px;
}

.inline-icon {
  height: 1em;
  width: auto;
  vertical-align: middle;
}

.heart-icon {
  color: #e25555;
}

/* Responsive */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .challenge-card { padding: 1.25rem; }
  .code-block code { font-size: 0.8rem; }
  .archive-table { font-size: 0.8rem; }
  .cta-row { flex-direction: column; }
  .cta-button { min-width: unset; }
  .clone-box code { font-size: 0.7rem; }
}
