:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-muted: #1d1d20;
  --text: #f5f5f6;
  --muted: #c5c7cc;
  --border: #2b2b30;
  --accent: #155e75;
  --accent-hover: #0f4f63;
  --accent-strong: #67e8f9;
  --accent-soft: #12242a;
  --danger: #fda29b;
  --danger-soft: #3b1519;
  --success: #86efac;
  --success-soft: #10351f;
  --input-bg: #101012;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  --max-width: 1180px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #edf0f4;
  --text: #111722;
  --muted: #566171;
  --border: #d8dee8;
  --accent: #315bbf;
  --accent-hover: #27479f;
  --accent-strong: #27479f;
  --accent-soft: #e6edff;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --success: #067647;
  --success-soft: #dcfae6;
  --input-bg: #ffffff;
  --shadow: 0 12px 28px rgba(20, 28, 40, 0.08);
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-regular.ttf") format("truetype");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-bold.ttf") format("truetype");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/fraunces-800.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header,
main,
.site-footer {
  width: min(var(--max-width), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 0;
}

.brand,
.site-header nav,
.header-actions {
  display: inline-flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand span:last-child {
  overflow-wrap: anywhere;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.78rem;
}

.site-header nav,
.site-footer nav {
  flex-wrap: wrap;
  gap: 22px;
  color: var(--muted);
  font-size: 0.93rem;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.site-header nav a,
.site-footer a {
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer a:hover {
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 34px;
  align-items: end;
  padding: 72px 0 48px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 4.8rem);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.hero p:not(.eyebrow),
.section-heading p,
.field-help,
.output-panel p,
.info-grid p,
.status-panel p,
.steps-section p,
.faq-section p,
.trust-section span {
  color: var(--muted);
}

.hero p:not(.eyebrow) {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.status-panel,
.output-panel,
.loader-panel,
.info-grid article,
.step-card,
.faq-grid article,
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-panel,
.output-panel,
.loader-panel,
.info-grid article,
.step-card,
.faq-grid article {
  padding: 24px;
}

.customizer-shell,
.info-grid,
.steps-section,
.faq-section {
  padding: 46px 0;
}

.mini-steps {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 1.2rem;
  color: var(--text);
  font-weight: 750;
}

.loader-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 24px;
  align-items: center;
  margin: 18px 0 34px;
}

.loader-panel h2 {
  margin-bottom: 8px;
}

.loader-panel p {
  margin: 0;
  color: var(--muted);
}

.upload-box {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 18px;
  cursor: pointer;
}

.upload-box:hover,
.upload-box:focus-within {
  border-color: var(--accent-strong);
}

.upload-box span {
  color: var(--text);
  font-weight: 800;
}

.upload-box input {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.field-groups {
  display: grid;
  gap: 20px;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 22px;
}

legend {
  padding: 0 6px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 9px;
}

label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.code-input {
  min-height: 150px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  padding-right: 36px;
}

input[type="color"] {
  padding: 4px;
}

.field-help {
  margin: 0;
  font-size: 0.84rem;
}

.toggle-field {
  align-content: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 14px;
}

.toggle-control {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.toggle-control input {
  width: 20px;
  min-height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.field.is-field-highlighted {
  animation: field-highlight 1.7s ease-out;
}

@keyframes field-highlight {
  0% {
    outline: 4px solid color-mix(in srgb, var(--accent-strong) 82%, transparent);
    outline-offset: 5px;
  }
  100% {
    outline: 4px solid transparent;
    outline-offset: 9px;
  }
}

.color-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
}

.color-pair-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

.color-pair-header,
.color-pair-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.color-pair-header {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.color-pair-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 14px;
}

.color-pair-row .field {
  min-width: 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-weight: 780;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

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

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

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: #aeb8c6;
}

.output-panel {
  margin-top: 24px;
}

.output-panel.is-success {
  border-color: rgba(6, 118, 71, 0.32);
  background: var(--success-soft);
}

.output-panel.is-error {
  border-color: rgba(180, 35, 24, 0.32);
  background: var(--danger-soft);
}

.error-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.error-item {
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--danger) 44%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger-soft) 64%, var(--surface));
  padding: 14px;
}

.error-item p {
  margin: 0;
  color: var(--text);
}

.error-fix {
  justify-self: start;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 780;
  cursor: pointer;
}

.error-fix:hover,
.error-fix:focus-visible {
  border-color: var(--accent-strong);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.catalog-toolbar,
.catalog-section,
.family-section,
.product-section {
  padding: 46px 0;
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  grid-template-areas:
    "search sort"
    "filters filters";
  gap: 22px;
  align-items: end;
}

.search-field,
.sort-field,
.filter-panel {
  display: grid;
  gap: 10px;
}

.filter-panel {
  grid-area: filters;
  align-items: start;
  padding-top: 2px;
}

.search-field {
  grid-area: search;
}

.sort-field {
  grid-area: sort;
}

.filter-row,
.tag-list,
.template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.filter-button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
}

.filter-button[aria-pressed="true"] {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.catalog-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.template-grid {
  display: grid;
  gap: 24px;
}

.template-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1fr);
  overflow: clip;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.template-media {
  position: relative;
  min-height: 100%;
  background: var(--surface-muted);
}

.template-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.template-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 850;
}

.template-card-body {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 28px;
}

.template-card-body p,
.catalog-empty p {
  color: var(--muted);
}

.template-card-body h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.template-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.template-meta li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 10px 12px;
}

.tag-list span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 9px;
  font-size: 0.8rem;
  font-weight: 800;
}

.button-disabled {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}

.catalog-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
}

.catalog-empty p {
  margin-bottom: 0;
}

.family-grid,
.content-grid,
.comparison-grid,
.screenshot-grid,
.two-column-list {
  display: grid;
  gap: 22px;
}

.family-grid,
.content-grid,
.comparison-grid,
.screenshot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-column-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.family-card,
.content-card,
.comparison-grid article,
.screenshot-card,
.two-column-list article,
.product-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.family-card,
.content-card,
.comparison-grid article,
.screenshot-card,
.two-column-list article {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 26px;
}

.family-card p,
.content-card p,
.comparison-grid p,
.two-column-list p,
.product-section p {
  color: var(--muted);
}

.compact-list,
.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li,
.check-list li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
}

.compact-list li::before,
.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--accent-strong);
  content: "•";
  font-weight: 900;
}

.product-hero {
  align-items: center;
}

.product-preview {
  display: grid;
  gap: 20px;
  overflow: clip;
  padding: 16px;
}

.product-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.product-preview > div {
  display: grid;
  gap: 14px;
  padding: 0 8px 8px;
}

.product-meta {
  grid-template-columns: 1fr;
}

.screenshot-card {
  margin: 0;
  overflow: clip;
  padding: 12px;
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-muted);
}

.screenshot-card figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
  padding: 0 4px 4px;
}

.product-section > .check-list {
  max-width: 760px;
}

.step-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.faq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-card,
.faq-grid article {
  display: grid;
  gap: 12px;
  align-content: start;
}

.step-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 850;
}

.trust-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  border-block: 1px solid var(--border);
  margin: 34px 0 18px;
  padding: 30px 0;
}

.trust-section div {
  display: grid;
  gap: 5px;
}

.trust-section strong {
  color: var(--text);
}

.faq-grid p,
.step-card p {
  margin: 0;
}

.disclosure {
  font-size: 0.92rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--border);
  padding: 38px 0 48px;
}

.site-footer p {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
}

.simple-page {
  width: min(880px, 100%);
  margin-inline: auto;
  padding: 58px 0 96px;
}

.simple-page h1 {
  max-width: none;
  margin-bottom: 10px;
  font-size: clamp(2.05rem, 7vw, 3.25rem);
}

.simple-page h2 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.simple-page > p {
  max-width: 680px;
  margin: 0 0 34px;
}

.simple-page p,
.simple-page li {
  color: var(--muted);
}

.simple-page section {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 36px;
  border-top: 1px solid var(--border);
  margin: 0;
  padding: 30px 0;
}

.simple-page section:last-child {
  border-bottom: 1px solid var(--border);
}

.simple-page section h2 {
  margin-top: 2px;
}

.simple-page section p {
  max-width: 620px;
  margin: 0;
}

.simple-page section > div {
  max-width: 650px;
}

.simple-page section > div p {
  max-width: none;
}

.simple-page section p + p,
.simple-page section p + ul,
.simple-page section ul + p {
  margin-top: 16px;
}

.legal-meta {
  font-weight: 700;
}

.legal-list {
  margin: 0;
  padding-left: 1.18rem;
}

.legal-list li + li {
  margin-top: 10px;
}

.legal-callout {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
}

.simple-page a {
  color: var(--accent-strong);
  font-weight: 700;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(103, 232, 249, 0.26);
  outline-offset: 2px;
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus,
:root[data-theme="light"] button:focus-visible,
:root[data-theme="light"] a:focus-visible {
  outline-color: rgba(49, 91, 191, 0.24);
}

.theme-toggle {
  display: inline-grid;
  width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.theme-icon {
  display: none;
  width: 19px;
  height: 19px;
  stroke: currentColor;
}

:root[data-theme="dark"] .theme-icon-sun,
:root:not([data-theme]) .theme-icon-sun {
  display: block;
}

:root[data-theme="light"] .theme-icon-moon {
  display: block;
}

@media (max-width: 800px) {
  .site-header,
  .hero,
  .loader-panel,
  fieldset,
  .info-grid,
  .catalog-controls,
  .template-card,
  .family-grid,
  .content-grid,
  .comparison-grid,
  .two-column-list,
  .step-grid,
  .faq-grid,
  .trust-section {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .brand {
    max-width: min(100%, 420px);
  }

  .header-actions {
    display: contents;
  }

  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .hero {
    padding-top: 28px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-controls {
    grid-template-areas:
      "search"
      "sort"
      "filters";
  }

  .color-pair-header {
    display: none;
  }

  .color-pair-row {
    grid-template-columns: 1fr;
  }

  .catalog-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-media img {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .simple-page {
    padding-top: 28px;
  }

  .simple-page section {
    display: block;
    padding: 18px 0;
  }

  .simple-page section h2 {
    margin-bottom: 8px;
  }

  .template-meta {
    grid-template-columns: 1fr;
  }
}
