/* ReactJS Beginner Projects — workshop design system */

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --line: #e2e8f0;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-soft: #ccfbf1;
  --beginner: #047857;
  --beginner-bg: #d1fae5;
  --intermediate: #b45309;
  --intermediate-bg: #fef3c7;
  --shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 8px 24px rgb(15 23 42 / 6%);
  --radius: 12px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-mono: "ui-monospace", "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1120px;
  --narrow: 720px;
  --header-h: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 100;
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2rem, var(--narrow));
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgb(247 248 250 / 88%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  animation: fade-down 0.6s ease both;
}

.site-header__nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.site-header__mark {
  color: var(--accent);
  flex-shrink: 0;
}

.site-header__links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-header__links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-header__links a:hover {
  color: var(--accent-dark);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgb(13 148 136 / 18%), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 80%, rgb(15 23 42 / 8%), transparent 50%),
    linear-gradient(160deg, #e8eef2 0%, var(--paper) 45%, #e6f4f2 100%);
}

.hero__atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(15 23 42 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(15 23 42 / 4%) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.hero__inner {
  width: min(100% - 2rem, 820px);
  text-align: center;
  padding-block: 4rem 5rem;
}

.hero__brand {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  animation: rise 0.7s ease both;
}

.hero__headline {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  font-weight: 600;
  color: var(--ink-soft);
  animation: rise 0.7s ease 0.08s both;
}

.hero__lede {
  margin: 0 auto 2rem;
  max-width: 36rem;
  font-size: 1.125rem;
  color: var(--muted);
  animation: rise 0.7s ease 0.16s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  animation: rise 0.7s ease 0.24s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn--primary:hover {
  background: var(--accent-dark);
  color: white;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

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

/* Sections */
.section {
  padding-block: 4.5rem;
}

.section__header {
  margin-bottom: 2rem;
}

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

.section__header h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.section__lede {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filters__search {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
}

.filters__search:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.filters__levels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.filters__count {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

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

/* Project grid */
.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  animation: rise 0.55s ease both;
  animation-delay: calc(var(--i, 0) * 0.02s);
}

.project-card.is-hidden {
  display: none;
}

.project-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card__link:hover {
  transform: translateY(-3px);
  border-color: rgb(13 148 136 / 45%);
  box-shadow: 0 12px 28px rgb(15 23 42 / 10%);
  color: inherit;
}

.project-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-card__title {
  margin: 0;
  font-size: 1.2rem;
}

.project-card__summary {
  margin: 0 0 1.25rem;
  color: var(--muted);
  flex: 1;
  font-size: 0.98rem;
}

.project-card__cta {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent-dark);
}

.badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
}

.badge--beginner {
  background: var(--beginner-bg);
  color: var(--beginner);
}

.badge--intermediate {
  background: var(--intermediate-bg);
  color: var(--intermediate);
}

/* FAQ */
.faq {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq__item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25rem 1.1rem;
  background: var(--paper);
}

.faq__item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem 0;
  list-style: none;
}

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

.faq__item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 700;
}

.faq__item[open] summary::after {
  content: "–";
}

.faq__item p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
}

/* Project page */
.project-page {
  padding-block: 2.5rem 4.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-weight: 600;
  text-decoration: none;
}

.project-page__header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.project-page__brand {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-dark);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.project-page__title {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.project-page__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.prose h2 {
  margin: 2.25rem 0 0.85rem;
  font-size: 1.45rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.prose ul {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.prose li {
  margin-bottom: 0.45rem;
}

/* Getting started */
.getting-started {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.getting-started h2 {
  margin: 0 0 0.65rem;
  font-size: 1.45rem;
}

.getting-started > p {
  color: var(--ink-soft);
}

.tabs {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.tabs__list {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.tabs__tab {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.9rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs__tab.is-active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  background: var(--surface);
}

.tabs__panel {
  padding: 1rem;
}

.tabs__panel[hidden] {
  display: none;
}

.tabs__panel pre {
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.tabs__panel code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink);
}

.getting-started__note {
  margin-top: 1rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding-block: 3.5rem 0;
  margin-top: auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.site-footer__title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: white;
}

.site-footer__text {
  margin: 0;
  color: #94a3b8;
  max-width: 22rem;
}

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

.site-footer__links a,
.site-footer__social {
  color: #94a3b8;
  text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__social:hover {
  color: white;
}

.site-footer__links li + li {
  margin-top: 0.45rem;
}

.site-footer__legal {
  border-top: 1px solid #1e293b;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
  color: #64748b;
}

.site-footer__legal p {
  margin: 0;
}

/* Motion */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .site-header__links a:nth-child(3) {
    display: none;
  }

  .hero__inner {
    padding-block: 3rem 4rem;
  }
}
