:root {
  --bg: #f8f8f6;
  --card: #fff;
  --text: #202a35;
  --muted: #5d6874;
  --accent: #a34f32;
  --accent-deep: #783a26;
  --line: #e3e6e8;
  --shadow: rgba(25, 35, 45, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  min-height: 100vh;
}

.container {
  width: min(1080px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.site-header {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: var(--text);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.brand-name {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
}

.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.hero-copy h1,
.section-heading h2,
.site-cta h2 {
  margin: 0;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.05em;
  line-height: 1.05;
  font-weight: 700;
}

.hero-copy h1 {
  max-width: 680px;
  font-size: clamp(2.75rem, 5.5vw, 4.6rem);
  letter-spacing: -0.06em;
}

.lead {
  max-width: 580px;
  margin: 1.25rem 0 0;
  font-size: 1rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button:hover,
.button:focus-visible {
  background: var(--accent-deep);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(163, 79, 50, 0.35);
  outline-offset: 3px;
}

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

.button-secondary {
  border: 1px solid var(--line);
  background: transparent;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff;
}

.hero-image-wrap {
  position: relative;
}

.hero-image-wrap img {
  width: 100%;
  height: clamp(300px, 38vw, 420px);
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 18px 42px var(--shadow);
}

.story,
.highlights {
  padding: 3.5rem 0 1.5rem;
}

.section-heading {
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 4vw, 3rem);
}

.story p,
.highlights .fact-list,
.info-card li {
  color: var(--muted);
}

.story p {
  max-width: 760px;
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
}

.info-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.info-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.5rem;
}

.info-card p:not(.card-kicker) {
  margin: 0;
  color: var(--muted);
}

.info-card ul,
.fact-list {
  margin: 0;
  padding-left: 1.2rem;
}

.info-card li,
.fact-list li {
  margin-bottom: 0.5rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.practice-section {
  margin-top: 3rem;
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f0f2f3;
}

.practice-intro {
  max-width: 700px;
}

.practice-intro > p:last-child {
  margin: 1rem 0 0;
  color: var(--muted);
}

.lesson-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.lesson-card h3 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1.2;
  font-weight: 700;
}

.lesson-card .card-description {
  margin-bottom: 0;
}

.lesson-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 1.25rem;
  border-radius: 6px;
  background: #202a35;
  color: #fff7ed;
  font-size: 0.9rem;
  line-height: 1.6;
}

.lesson-card pre code {
  color: inherit;
}

.lesson-tips {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.lesson-tips li {
  position: relative;
  padding-left: 1.4rem;
}

.lesson-tips li::before {
  position: absolute;
  left: 0;
  color: var(--accent);
  content: "✓";
  font-weight: 700;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  align-items: start;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.project-card h3 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1.2;
  font-weight: 700;
}

.project-card ol {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--muted);
}

.project-card li {
  padding: 0.15rem 0 0.45rem 0.25rem;
}

.practice-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.card-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 700;
}

.practice-card h3 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1.2;
  font-weight: 700;
}

.card-description {
  margin: 0.6rem 0 1.4rem;
  color: var(--muted);
}

.quiz-question {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.quiz-question legend {
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.quiz-question label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.4rem 0;
  color: var(--muted);
  cursor: pointer;
}

.quiz-question input {
  margin-top: 0.35rem;
  accent-color: var(--accent);
}

.practice-card code {
  color: var(--accent-deep);
  font-size: 0.95em;
}

.practice-card form > label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 600;
}

.practice-card input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.practice-card input[type="text"]:focus-visible {
  outline: 3px solid rgba(168, 95, 66, 0.22);
  border-color: var(--accent);
}

.practice-card form > .button {
  margin-top: 1.1rem;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.form-feedback {
  min-height: 1.7em;
  margin: 0.75rem 0 0;
  color: var(--accent-deep);
  font-weight: 600;
}

.profile-result {
  margin-top: 1.4rem;
  padding: 1.2rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.profile-result[hidden] {
  display: none;
}

.profile-result h4 {
  margin: 0 0 0.4rem;
  font-family: "Inter", sans-serif;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.profile-result p {
  margin: 0.3rem 0;
  color: var(--muted);
}

.site-cta {
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.site-cta h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.site-footer {
  padding: 2.75rem 0 1.25rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(130px, 1fr) minmax(190px, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-brand p {
  max-width: 340px;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links h2,
.footer-contact h2 {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .nav,
  .hero,
  .info-grid,
  .lesson-card,
  .practice-grid,
  .project-card,
  .footer-inner {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem 1rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav {
    display: flex;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
  }

  .hero {
    gap: 2rem;
    padding-top: 3rem;
  }

  .lesson-tips {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 4rem;
  }

  .hero-image-wrap img {
    height: 320px;
  }

  .button {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .container {
    width: min(100% - 2rem, 1080px);
  }

  .hero-copy h1 {
    font-size: clamp(2.1rem, 11vw, 2.65rem);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
