:root {
  --ink: #101827;
  --blue: #1d4ed8;
  --blue-bright: #2563eb;
  --orange: #f97316;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #526277;
  --line: #e2e8f0;
  --band: #e7edf5;
  --watermark: rgba(37, 99, 235, 0.14);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0c1322;
  --card: #151d2e;
  --text: #e7eef8;
  --muted: #a8b6cc;
  --line: #2a3854;
  --band: #10182a;
  --watermark: rgba(147, 197, 253, 0.16);
  color-scheme: dark;
}

* { box-sizing: border-box; }
pre, code { white-space: pre-wrap; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 12% -8%, rgba(249, 115, 22, 0.08), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
}
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .hero-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.96;
  color: var(--text);
}
a { color: var(--blue); }
a:hover { color: var(--orange); }
:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}
::selection { background: var(--orange); color: var(--ink); }
[hidden] { display: none !important; }

.shell {
  width: auto;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.hero, .page-band, .site-header, .newsletter, .site-footer { overflow-x: clip; }
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: white;
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  z-index: 40;
}
.skip:focus { top: 0.6rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #101827;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.4rem;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: white;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.mark {
  width: 1.35rem;
  height: 1.05rem;
  background:
    linear-gradient(var(--orange), var(--orange)) 0 0 / 100% 2px no-repeat,
    linear-gradient(#93c5fd, #93c5fd) 0 50% / 78% 2px no-repeat,
    linear-gradient(white, white) 0 100% / 55% 2px no-repeat;
}
.nav { display: flex; gap: 1.05rem; margin-left: auto; }
.nav a {
  color: #d7e0ec;
  text-decoration: none;
  font-size: 0.95rem;
}
.nav a[aria-current="page"] {
  color: white;
  box-shadow: inset 0 -2px 0 var(--orange);
}
.theme-toggle, .nav-toggle, .hero-toolbar button, .code-window-bar button, .codeblock-bar button {
  font: inherit;
  color: #f8fafc;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.nav-toggle { display: none; }
.theme-toggle[aria-pressed="true"] { border-color: var(--orange); color: var(--orange); }

.hero {
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #101827;
  background-size: 52px 52px, 52px 52px, auto;
  color: #f8fafc;
  padding: 2.2rem 0 1.4rem;
}
.hero-slide { display: none; }
.hero-slide.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 2.5rem;
  align-items: end;
  animation: rise 480ms ease;
}
.hero-title {
  color: white;
  font-size: clamp(3.4rem, 8vw, 6.1rem);
  margin: 0.2rem 0 0.8rem;
  max-width: 9ch;
}
.hero-copy p { max-width: 36rem; color: #d5deea; font-size: 1.15rem; }
.kicker {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.hero .kicker, .page-band .kicker, .newsletter .kicker, .page-band .kicker a { color: var(--orange); }
.hero-actions { margin-top: 1.4rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--orange);
  color: #101827;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  cursor: pointer;
}
.btn:hover { background: #fb923c; color: #101827; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  margin-left: 0.4rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--orange); }
.code-window, .codeblock {
  background: #0b1220;
  color: #e8eef7;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 12px 14px 0 rgba(249, 115, 22, 0.28);
}
.code-window-bar, .codeblock-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  color: #b9c6d8;
  font-family: var(--mono);
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-window-bar span:last-of-type, .codeblock-bar span { margin-right: auto; }
.code-dots {
  width: 2.4rem;
  height: 0.45rem;
  background:
    radial-gradient(circle at 4px 50%, #f97316 4px, transparent 4.5px),
    radial-gradient(circle at 18px 50%, #2563eb 4px, transparent 4.5px),
    radial-gradient(circle at 32px 50%, #94a3b8 4px, transparent 4.5px);
}
.code-window pre, .codeblock pre, .challenge-code {
  display: block;
  margin: 0;
  padding: 1rem 1.05rem 1.15rem;
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
}
.hero-slide.is-active,
.hero-slide.is-active > *,
.split,
.split > *,
.newsletter-inner,
.newsletter-inner > *,
.contact-grid,
.contact-grid > *,
.card-grid,
.service-grid,
.tool-grid,
.category-grid,
.code-window,
.codeblock,
.code-window pre,
.codeblock pre,
.code-window pre code,
.codeblock pre code {
  min-width: 0;
  max-width: 100%;
}
.hero-slide.is-active { width: 100%; }
.code-window pre code,
.codeblock pre code,
.challenge-code code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hero-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.3rem 0 0.4rem;
}
.hero-dots { display: flex; gap: 0.45rem; }
.hero-dots button {
  width: 1.7rem;
  height: 0.28rem;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}
.hero-dots button.is-active { background: var(--orange); }

.section { padding: 4.2rem 0; }
.section-alt { background: var(--band); }
.section-head { max-width: 40rem; margin-bottom: 1.5rem; }
.section-head h2, .split h2, .newsletter h2 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin-bottom: 0.6rem;
}
.section-head p:last-child { color: var(--muted); }

.search-wrap { display: grid; gap: 1.5rem; }
.search-bar label, .form label, .newsletter label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.search-bar div, .newsletter-row { display: flex; gap: 0.6rem; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
textarea { resize: vertical; }
.search-bar input { border-radius: 999px; padding-inline: 1rem; }
.service-grid, .card-grid, .community-grid, .about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}
.card-grid, .about-grid { grid-template-columns: repeat(2, 1fr); }
.community-grid { grid-template-columns: repeat(3, 1fr); }
.service, .card, .tool, .community-grid article, .about-grid article, .note-list article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.05rem 1.1rem 1.15rem;
}
.service, .card { border-top: 3px solid var(--blue-bright); }
.service h2, .card h3, .tool h3, .community-grid h3, .note-list h3, .about-grid h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
}
.service h2 a, .card h3 a, .note-list h3 a { color: inherit; text-decoration: none; }
.service h2 a:hover, .card h3 a:hover, .note-list h3 a:hover { color: var(--blue); }
.service p, .card p, .tool p, .community-grid p { color: var(--muted); margin-bottom: 0; }
.card-meta, .light-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.55rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.light-meta { color: #d5deea; }

.problem-list { display: grid; gap: 0.7rem; }
.problem {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.2rem 1rem;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--line);
}
.problem span { font-family: var(--mono); font-size: 0.75rem; color: var(--orange); }
.problem strong { font-family: var(--mono); font-size: 0.92rem; font-weight: 500; }
.problem em { grid-column: 2; color: var(--muted); font-style: normal; }
.problem:hover { border-color: var(--blue-bright); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.category {
  position: relative;
  overflow: hidden;
  min-height: 8.2rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
}
.category span {
  position: absolute;
  top: -0.35rem;
  right: 0.45rem;
  font-family: var(--serif);
  font-size: 4.4rem;
  line-height: 1;
  color: var(--watermark);
}
.category strong { font-size: 1.05rem; }
.category em { color: var(--muted); font-style: normal; font-size: 0.92rem; }
.category:hover { border-color: var(--orange); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.lede { color: var(--muted); font-size: 1.08rem; }
.challenge fieldset {
  border: 0;
  margin: 0.8rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.challenge legend { padding: 0; margin-bottom: 0.45rem; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.challenge label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}
.challenge input { width: auto; }
.challenge-code {
  background: #0b1220;
  color: #e8eef7;
  border-radius: 16px;
}
.plain-list { padding-left: 1.1rem; }
.plain-list li + li { margin-top: 0.25rem; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}
.tool h3 { font-size: 1.35rem; }
.note-list { display: grid; gap: 0.8rem; }

.newsletter {
  background: #101827;
  color: #f8fafc;
  padding: 3.5rem 0;
}
.newsletter h2, .page-band h1 { color: white; }
.newsletter p { color: #d5deea; }
.newsletter-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: end;
}
.newsletter input { background: #0b1220; color: white; border-color: rgba(255, 255, 255, 0.16); }
.form-ok, .form-error { border-radius: 12px; padding: 0.7rem 0.8rem; }
.form-ok { background: rgba(37, 99, 235, 0.12); }
.form-error { background: rgba(249, 115, 22, 0.14); }
.hp {
  position: absolute;
  left: -999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  background: #0b1220;
  color: #d5deea;
  padding: 2.8rem 0 1.2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 1.5rem;
}
.footer-brand { color: white; margin-bottom: 0.4rem; }
.site-footer h2 {
  color: white;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.site-footer a { display: block; color: #d5deea; text-decoration: none; margin: 0.25rem 0; }
.site-footer a:hover { color: var(--orange); }
.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
}
.footer-base a { display: inline; }

.page-band {
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #101827;
  background-size: 52px 52px, auto;
  color: #f8fafc;
  padding: 3.4rem 0 2.8rem;
}
.page-band h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  max-width: 16ch;
  margin: 0.15rem 0 0.8rem;
}
.page-band .lede { color: #d5deea; max-width: 40rem; }
.prose, .prose-wide { max-width: 46rem; }
.prose-wide { max-width: 68rem; }
.prose h2, .prose-wide h2 { font-size: clamp(2rem, 3vw, 2.7rem); margin: 1.6rem 0 0.6rem; }
.prose li + li { margin-top: 0.35rem; }
.error-quote {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: #101827;
  color: white;
  border-radius: 16px;
  padding: 0.9rem 1rem;
}
.error-quote span {
  display: block;
  color: var(--orange);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.filters { display: grid; gap: 0.7rem; margin-bottom: 1.3rem; }
.filters div { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filters span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 0.3rem; }
.filters a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.92rem;
}
.filters a[aria-current="true"] { background: var(--ink); color: white; border-color: var(--ink); }
html[data-theme="dark"] .filters a[aria-current="true"] { background: var(--orange); color: #101827; border-color: var(--orange); }
.empty { color: var(--muted); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}
.form { display: grid; gap: 0.35rem; }
.form .btn { margin-top: 0.7rem; width: fit-content; }
.contact-aside {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
}
.search-bar-page { margin-bottom: 1.4rem; }

@media (max-width: 980px) {
  .service-grid, .category-grid, .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid, .split, .newsletter-inner, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-slide.is-active { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .community-grid { grid-template-columns: 1fr; }
  .problem { grid-template-columns: 1fr; }
  .problem em { grid-column: 1; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.4rem 1rem 1rem;
    background: #101827;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav.is-open { display: flex; }
  .theme-toggle { margin-left: auto; }
  .card-grid, .about-grid, .service-grid, .category-grid, .tool-grid { grid-template-columns: 1fr; }
  .search-bar div, .newsletter-row, .footer-base { flex-direction: column; }
  .hero-title { max-width: none; }
  .code-window { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide.is-active { animation: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
