:root {
  --bg: #f6f3ed;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --text: #15191f;
  --muted: #626b78;
  --line: #ded8cd;
  --accent: #172033;
  --accent-2: #20745f;
  --accent-3: #9b6b1f;
  --danger: #b4493d;
  --shadow: 0 18px 60px rgba(23, 32, 51, .10);
}

[data-theme="dark"] {
  --bg: #0f131b;
  --surface: #171d29;
  --surface-2: #111722;
  --text: #f7f8fb;
  --muted: #aab3c1;
  --line: #2c3445;
  --accent: #f7f8fb;
  --accent-2: #39c79d;
  --accent-3: #f2c14e;
  --danger: #ff8d7f;
  --shadow: 0 18px 60px rgba(0, 0, 0, .26);
}

[data-theme="contrast"] {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --text: #ffffff;
  --muted: #f3f3f3;
  --line: #ffffff;
  --accent: #ffffff;
  --accent-2: #00ff9d;
  --accent-3: #ffe600;
  --danger: #ff5c5c;
  --shadow: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color .24s ease, color .24s ease;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity .32s ease, visibility .32s ease;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-mark {
  display: grid;
  gap: 16px;
  justify-items: center;
  color: var(--muted);
  font-weight: 800;
}
.loader-mark::before {
  content: "";
  width: 42px;
  height: 42px;
  border: 3px solid var(--line);
  border-top-color: var(--accent-2);
  border-radius: 999px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page {
  opacity: 0;
  transform: translateY(8px);
  animation: pageIn .46s ease forwards;
}
@keyframes pageIn { to { opacity: 1; transform: none; } }
.theme-flash { animation: themeFlash .26s ease; }
@keyframes themeFlash { 50% { filter: saturate(1.08) brightness(1.04); } }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  padding-right: 252px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--muted); font-size: 14px; font-weight: 800; }
.store-link {
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--surface);
}
.theme-control {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 60;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.theme-control button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}
.theme-control button:first-child { border-left: 0; }
.theme-control button.active { background: var(--accent); color: var(--bg); }
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 80;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }
.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(40px, 7vw, 82px) 0;
}
.section.tight { padding-top: 32px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}
h1, h2, h3 { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(44px, 8vw, 86px); line-height: .96; max-width: 920px; }
h2 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 52px); line-height: 1.04; }
h3 { margin: 0 0 10px; font-size: 25px; line-height: 1.15; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.65; max-width: 780px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero-panel, .card, .contact-panel, .article-row, .product-card, .profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.hero-panel { padding: 26px; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.profile-card {
  min-height: 190px;
  padding: clamp(20px, 4vw, 28px);
}
.profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.bio-blank {
  min-height: 112px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  align-items: center;
  padding: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.button.subtle { color: var(--muted); }
.product-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
}
.product-copy { padding: clamp(22px, 4vw, 36px); }
.product-side {
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  padding: clamp(22px, 4vw, 34px);
}
.product-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.product-logo { width: 46px; height: 46px; flex: 0 0 auto; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}
.facts { display: grid; gap: 12px; margin-top: 18px; }
.fact { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); line-height: 1.5; }
.fact strong { display: block; color: var(--text); margin-bottom: 4px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.articles { display: grid; gap: 12px; }
.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}
.article-row p { margin: 0; color: var(--muted); line-height: 1.5; }
.meta { color: var(--muted); font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(320px, 1.2fr);
  gap: 20px;
  align-items: start;
}
.contact-panel { padding: clamp(20px, 4vw, 30px); }
.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; color: var(--muted); font-weight: 800; font-size: 13px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
}
.field textarea { min-height: 136px; resize: vertical; }
.form-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.status { min-height: 20px; color: var(--accent-2); font-weight: 800; }
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  line-height: 1.6;
  padding: 24px clamp(16px, 5vw, 72px);
}
.site-footer strong { color: var(--text); }
.article-layout { max-width: 860px; }
.article-layout p, .article-layout li { color: var(--muted); line-height: 1.75; font-size: 18px; }
.article-layout h1 { font-size: clamp(38px, 6vw, 68px); }
.article-layout h2 {
  margin-top: 42px;
  font-size: clamp(26px, 4vw, 38px);
}
.article-layout h3 {
  margin-top: 30px;
}
.article-layout pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-2);
  color: var(--text);
}
.article-layout code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .92em;
}
.article-layout blockquote {
  margin: 28px 0;
  padding: 8px 0 8px 18px;
  border-left: 4px solid var(--accent-2);
  color: var(--muted);
}
.demo-attribution {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 22;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(5, 7, 18, 0.86);
  color: #c5cee0;
  font: 600 12px/1.45 Inter, system-ui, sans-serif;
  backdrop-filter: blur(10px);
}
.demo-attribution strong { color: #f6f8fc; }
@media (max-width: 860px) {
  .nav-wrap, .nav-links { align-items: flex-start; flex-direction: column; }
  .nav-wrap { padding: 16px 0; }
  .hero-grid, .product-card, .contact-grid, .profile-grid { grid-template-columns: 1fr; }
  .product-side { border-left: 0; border-top: 1px solid var(--line); }
  .section-head, .article-row { grid-template-columns: 1fr; display: grid; align-items: start; }
  .theme-control { width: 100%; }
  .theme-control button { padding: 0 8px; }
}
@media (max-width: 520px) {
  .section { width: min(100% - 24px, 1180px); }
  .nav-wrap { width: min(100% - 24px, 1180px); }
  h1 { font-size: 42px; }
  .actions { flex-direction: column; }
  .button { width: 100%; }
}

.profile-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.profile-list li { color: var(--muted); line-height: 1.55; }
.writing-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.filter-panel {
  position: sticky;
  top: 90px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.filter-panel h2 { font-size: 18px; margin-bottom: 12px; }
.filter-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  margin-bottom: 14px;
}
.filter-group {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}
.filter-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 800;
}
.filter-button.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.no-results {
  display: none;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.no-results.visible { display: block; }
.visual-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 28px 0;
}
.visual-card figcaption {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 14px;
}
.visual-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.visual-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.visual-step strong { display: block; color: var(--text); margin-bottom: 4px; }
.comments {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.comments h2 { margin-bottom: 10px; }
.comment-form {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.comment-list { display: grid; gap: 12px; }
.comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}
.comment strong { display: block; }
.comment time {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 10px;
}
.comment p { margin: 0; font-size: 16px; line-height: 1.6; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }
.site-footer {
  text-align: center;
  font-size: 12px;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}
.site-footer strong { color: color-mix(in srgb, var(--text) 76%, transparent); }
@media (max-width: 860px) {
  .nav-wrap { padding-top: 60px; padding-right: 0; }
  .writing-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .theme-control { width: auto; max-width: calc(100% - 24px); }
}
