:root {
  --accent: #f57c00;
  --navy: #101d2d;
  --hero: #172b40;
  --ink: #101d2d;
  --muted: #526477;
  --line: #d5dde6;
  --paper: #f5f6f8;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.6 "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button, .cta {
  background: var(--accent);
  color: var(--navy);
  border: 0;
  border-radius: 5px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary { background: #e2e7ed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header, .site-footer { background: var(--navy); color: white; padding: 18px 6%; }
.site-header { position: sticky; top: 0; z-index: 5; }
nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { color: var(--accent); }
.logo { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-right: auto; text-decoration: none; }
.logo:hover { text-decoration: none; }
.orange { color: var(--accent); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.lang-on { color: white; }
.lang-off { color: #8ea0b3; }
.lang-switch button {
  width: 46px;
  height: 26px;
  padding: 3px;
  border-radius: 99px;
  background: #314456;
  display: inline-flex;
  align-items: center;
}
.lang-switch button[aria-checked="true"] { background: var(--accent); }
.knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  display: block;
  transition: transform .15s ease;
}
.lang-switch button[aria-checked="true"] .knob { transform: translateX(20px); }

main { max-width: 1250px; width: 100%; margin: 0 auto; padding: 28px; flex: 1 0 auto; }
.hero {
  background: var(--hero);
  color: white;
  padding: 65px 45px;
  border-radius: 12px;
  border-left: 7px solid var(--accent);
}
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: 0.04em; }
h1, .hero h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin: 14px 0;
  white-space: pre-line;
}
.hero p { max-width: 68ch; margin-top: 0; }
.hero .cta { margin: 8px 10px 0 0; }
h2 { font-size: 27px; margin: 38px 0 8px; }
h3 { line-height: 1.3; margin: 8px 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #bcc6d1;
  border-radius: 5px;
  font: inherit;
  background: white;
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
#search { flex: 2; min-width: 180px; }
#filter { flex: 1; min-width: 160px; width: auto; }
label { font-weight: 650; display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: white;
  padding: 23px;
  border-radius: 8px;
  border-top: 4px solid var(--accent);
  box-shadow: 0 3px 12px #101d2d0b;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.tag, .featured-flag {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a94d00;
}
.featured-flag { margin-left: 8px; }
.muted { color: var(--muted); font-size: 14px; }
.empty { grid-column: 1 / -1; color: var(--muted); }
.dark { background: var(--navy); color: white; padding: 30px; border-radius: 8px; }
details { background: white; padding: 20px; border-radius: 8px; margin: 15px 0; }
summary { cursor: pointer; font-weight: 700; }
.hp { position: absolute; left: -10000px; }
.thanks { background: white; border-radius: 8px; padding: 16px 18px; border-left: 4px solid var(--accent); }

.article-view { max-width: 760px; padding-top: 10px; }
.article-view h1 { max-width: 24em; }
section { scroll-margin-top: 88px; }
.lead { font-size: 20px; line-height: 1.5; }
.article-body, .lead { white-space: pre-wrap; }
.article-body { font-size: 18px; line-height: 1.75; }
.article-body img, .lead img { display: block; max-width: min(100%, 760px); height: auto; border-radius: 8px; margin: 14px 0; }
.article-body::after { content: ''; display: block; clear: both; }
.article-body > p { margin: 0 0 14px; }
.article-body img[data-align="left"] { float: left; margin: 6px 22px 12px 0; }
.article-body img[data-align="right"] { float: right; margin: 6px 0 12px 22px; }
.article-body img[data-align="center"] { margin-left: auto; margin-right: auto; }
@media (max-width: 560px) {
  .article-body img[data-align="left"], .article-body img[data-align="right"] { float: none; width: 100% !important; margin: 14px 0; }
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 18px;
}
.back-btn:hover { background: var(--accent); color: var(--navy); text-decoration: none; }
.fallback {
  background: #fff6ea;
  border-radius: 8px;
  padding: 12px 14px;
  color: #6a3d0b;
}
.not-found { padding: 48px 0 80px; }

.site-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}
.footer-line { margin: 0; color: #d5dde6; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #24364a;
  color: white;
  text-decoration: none;
}
.socials a:hover { background: var(--accent); color: var(--navy); }
.socials svg { width: 18px; height: 18px; }
.boot { padding: 48px 6%; color: var(--muted); }

.thread-list { display: grid; gap: 12px; }
.thread {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  align-items: start;
  background: white;
  padding: 16px 18px;
  border-radius: 10px;
  border-left: 4px solid var(--accent);
  text-decoration: none;
  box-shadow: 0 3px 12px #101d2d0b;
}
.thread:hover { outline: 2px solid var(--accent); }
.thread h3 { margin: 4px 0; }
.thread p { margin: 0; }
.thread-meta { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.thread-page { max-width: 820px; }
.thread-page > .tag,
.article-view > .tag,
.course-page .tag {
  display: block;
  width: fit-content;
  margin-top: 6px;
}
.comments { display: grid; gap: 10px; }
.comment, .comment-form, .ask-box, .enroll {
  background: white;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 3px 12px #101d2d0b;
}
.comment-name { font-weight: 800; margin: 0 0 4px; }
.comment-form, .ask-box { margin-top: 16px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.course {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 12px #101d2d0b;
  display: flex;
  flex-direction: column;
}
.course-bar { height: 8px; background: var(--accent); }
.course-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body p { margin: 0; }
.price { font-size: 22px; font-weight: 800; margin: 6px 0; }
.course .cta { margin-top: auto; align-self: flex-start; }
.course-layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 24px; align-items: start; }
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 340px); gap: 40px; align-items: start; justify-content: space-between; }
.suggested { position: sticky; top: 96px; padding-top: 10px; }
.suggested h2 { font-size: 20px; margin: 0 0 14px; }
.suggested-list { display: grid; grid-template-columns: 1fr; grid-auto-rows: auto; gap: 14px; }
.suggested-card { padding: 16px; display: grid; gap: 6px; }
.suggested-card h3 { font-size: 17px; line-height: 1.3; margin: 4px 0 0; }
.suggested-card p { margin: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.suggested-card p.muted { font-size: 13px; }

@media (max-width: 960px) {
  .article-layout { grid-template-columns: 1fr; }
  .suggested { position: static; }
}

@media (max-width: 800px) {
  .course-layout, .thread { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  main { padding: 14px; }
  .hero { padding: 35px 22px; }
  nav { gap: 12px; font-size: 14px; }
  .logo { order: -2; }
  .lang-switch { order: -1; margin-left: auto; }
}
