:root {
  --ink: #07111f;
  --ink-soft: #14243a;
  --paper: #ffffff;
  --canvas: #f4f7f6;
  --canvas-warm: #f8faf8;
  --muted: #5f6f7f;
  --border: #dce5e2;
  --brand: #551285;
  --brand-bright: #77419d;
  --brand-deep: #3c0d5d;
  --brand-soft: #eee7f3;
  --accent: #ffcf5c;
  --success: #087f5b;
  --warn: #a4510b;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(7, 17, 31, 0.09);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

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

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(119, 65, 157, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-160%);
  padding: 0.65rem 1rem;
  color: var(--paper);
  background: var(--brand-deep);
  border-radius: 10px;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  overflow: hidden;
  padding: 1rem 1.25rem 4.5rem;
  color: var(--paper);
  background:
    radial-gradient(circle at 10% 20%, rgba(119, 65, 157, 0.2), transparent 32rem),
    radial-gradient(circle at 85% 10%, rgba(255, 207, 92, 0.13), transparent 26rem),
    var(--brand-deep);
}

.site-header::after {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -8rem;
  width: 24rem;
  height: 24rem;
  opacity: 0.08;
  background-image:
    linear-gradient(90deg, var(--paper) 25%, transparent 25%, transparent 75%, var(--paper) 75%),
    linear-gradient(var(--paper) 25%, transparent 25%, transparent 75%, var(--paper) 75%);
  background-size: 44px 44px;
  transform: rotate(12deg);
}

.nav {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--ink);
  background: var(--accent);
  border-radius: 8px;
  font-weight: 950;
  box-shadow: inset 0 0 0 2px rgba(7, 17, 31, 0.14);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav-links a {
  color: #cbd7df;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--paper);
}

.nav-links .github-link {
  padding: 0.55rem 0.85rem;
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin: 6rem auto 0;
  text-align: center;
}

.open-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  color: #dacbe4;
  background: rgba(85, 18, 133, 0.15);
  border: 1px solid rgba(119, 65, 157, 0.28);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.hero h1 {
  margin: 1.35rem 0 1rem;
  font-size: clamp(3rem, 8vw, 6.3rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-lead {
  max-width: 690px;
  margin: 0 auto;
  color: #c2d0d9;
  font-size: clamp(1.08rem, 2.2vw, 1.3rem);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.proof-list {
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.5rem;
  color: #aebfc9;
  font-size: 0.9rem;
  list-style: none;
}

.proof-list span {
  color: #b294c8;
  font-weight: 900;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0.76rem 1rem;
  color: var(--ink);
  background: var(--paper);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--paper);
  background: var(--brand-deep);
}

.site-header .btn-primary,
.final-cta .btn-primary {
  color: var(--ink);
  background: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 18px rgba(7, 17, 31, 0.15);
}

.btn-secondary {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
}

.site-header .btn-secondary {
  color: var(--paper);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-button {
  min-width: 170px;
  padding: 0.9rem 1.2rem;
}

.workspace {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.section-heading {
  max-width: 700px;
  margin: 0 auto 2.25rem;
  text-align: center;
}

.section-heading h2,
.split-section h2,
.final-cta h2 {
  margin: 0.25rem 0 0.7rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.section-heading p:last-child,
.split-section > div > p,
.info-card p,
.faq-list p {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.generator-heading {
  margin-bottom: 1.5rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}

.preview-panel,
.editor-panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.preview-panel {
  position: sticky;
  top: 1rem;
  order: 2;
  display: grid;
  gap: 0.8rem;
  align-content: start;
  padding: 1.15rem;
  scroll-margin-top: 1rem;
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.preview-header h3,
.content-block h3 {
  margin: 0;
  font-size: 1.05rem;
}

.preview-subhead,
.content-help {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge-idle {
  color: var(--muted);
  background: #e8eeee;
}

.badge-ready {
  color: var(--success);
  background: #d8f3e8;
}

.badge-warn {
  color: var(--warn);
  background: #fff0cf;
}

.qr-preview {
  aspect-ratio: 1 / 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  background:
    linear-gradient(45deg, #f3f7f6 25%, transparent 25%),
    linear-gradient(-45deg, #f3f7f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3f7f6 75%),
    linear-gradient(-45deg, transparent 75%, #f3f7f6 75%),
    #fbfcfc;
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.preview-empty {
  text-align: center;
  color: var(--muted);
}

.preview-empty-icon {
  margin-bottom: 0.35rem;
  font-size: 2.7rem;
  opacity: 0.35;
}

.preview-empty p {
  margin: 0;
}

.qr-canvas {
  display: block;
  width: min(100%, 300px);
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(7, 17, 31, 0.09);
}

.status {
  min-height: 1.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-ok {
  color: var(--success);
}

.status-warn {
  color: var(--warn);
}

.download-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.download-row .btn-primary,
.download-row .btn-ghost {
  grid-column: 1 / -1;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border);
}

#share-png {
  display: none;
}

.editor-panel {
  order: 1;
  padding: 1.15rem;
}

#qr-form {
  display: grid;
  gap: 0.9rem;
}

.field-block {
  width: 100%;
}

.content-block {
  padding: 1rem;
  background: var(--canvas-warm);
  border: 1px solid var(--border);
  border-radius: 14px;
}

label,
.customize-grid label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 750;
}

.field-block > label:first-child,
.customize-grid > label:first-child {
  margin-top: 0;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #cbd8d5;
  border-radius: 11px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-bright);
  box-shadow: 0 0 0 3px rgba(119, 65, 157, 0.13);
}

input:disabled {
  opacity: 0.55;
}

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

.quick-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.quick-type {
  padding: 0.37rem 0.67rem;
  color: var(--ink-soft);
  background: var(--canvas-warm);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.quick-type:hover,
.quick-type.is-active {
  color: var(--paper);
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.content-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dynamic-fields > :first-child {
  margin-top: 0;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.check {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem !important;
  font-weight: 650 !important;
}

.check input,
.radio-row input {
  width: auto;
}

.radio-row {
  display: flex;
  gap: 1rem;
  margin: 0.6rem 0 0;
  padding: 0;
  border: 0;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 !important;
  font-weight: 650 !important;
}

.input-compact {
  margin-bottom: 0.25rem;
}

.customize-panel {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--canvas-warm);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.customize-panel summary {
  cursor: pointer;
  font-weight: 850;
}

.customize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.8rem;
  margin-top: 0.75rem;
}

.customize-grid .check {
  grid-column: 1 / -1;
}

.generate-row {
  display: none;
}

.btn-generate {
  width: 100%;
  padding: 0.9rem 1rem;
  color: var(--paper);
  background: var(--brand);
  font-size: 1rem;
}

.generate-hint {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.privacy-note {
  max-width: 850px;
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  color: #40515d;
  background: var(--brand-soft);
  border: 1px solid #c8b2d8;
  border-radius: 12px;
  font-size: 0.88rem;
  text-align: center;
}

.privacy-note a,
.text-link {
  color: var(--brand);
  font-weight: 800;
}

.content-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.content-section + .content-section {
  border-top: 1px solid var(--border);
}

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

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

.card-number {
  color: var(--brand-bright);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.info-card h3 {
  margin: 2.5rem 0 0.45rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.info-card p {
  margin: 0;
}

.split-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 8vw, 6rem);
  align-items: center;
}

.split-section h2 {
  max-width: 650px;
}

.inline-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.code-window {
  overflow: hidden;
  color: #d3f6ee;
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.code-window-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-window-bar span {
  width: 0.55rem;
  height: 0.55rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.code-window pre {
  margin: 0;
  padding: 1.5rem;
  font-size: clamp(0.82rem, 2vw, 1rem);
  line-height: 1.75;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.type-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-weight: 800;
  text-decoration: none;
}

.type-grid a:hover {
  border-color: var(--brand-bright);
}

.type-grid span {
  color: var(--brand);
}

.faq-section {
  max-width: 850px;
}

.faq-list {
  border-top: 1px solid var(--border);
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  padding: 1.25rem 2.2rem 1.25rem 0;
  font-weight: 850;
  cursor: pointer;
}

.faq-list p {
  margin: -0.45rem 0 1.25rem;
}

.final-cta {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 4rem 1.25rem;
  color: var(--paper);
  background: var(--brand-deep);
  border-radius: 28px;
  text-align: center;
}

.final-cta .eyebrow {
  color: #b294c8;
}

.final-cta .btn-secondary {
  color: var(--paper);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.footer-brand {
  color: var(--ink);
}

.site-footer p {
  margin: 0.6rem 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}

.site-footer nav a {
  font-weight: 700;
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--brand);
}

.seo-page {
  min-height: 100vh;
  background: var(--canvas);
}

.seo-page .site-header {
  padding-bottom: 3.5rem;
}

.seo-page .hero {
  max-width: 820px;
  margin-top: 4rem;
}

.seo-page .hero h1 {
  font-size: clamp(2.7rem, 7vw, 5.2rem);
}

.article-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 1.25rem 6rem;
}

.article-shell h2 {
  margin-top: 3rem;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.article-shell p,
.article-shell li {
  color: #40515d;
}

.article-shell .callout {
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 0 12px 12px 0;
}

@media (max-width: 900px) {
  .nav-links > a:not(.github-link) {
    display: none;
  }

  .hero {
    margin-top: 4.5rem;
  }

  .workspace-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    order: 2;
  }

  .editor-panel {
    order: 1;
  }

  .generate-row {
    display: block;
  }

  #share-png.share-available {
    display: block;
    grid-column: 1 / -1;
  }

  .step-grid,
  .type-grid {
    grid-template-columns: 1fr;
  }

  .info-card h3 {
    margin-top: 1.5rem;
  }

  .final-cta {
    margin-right: 1rem;
    margin-left: 1rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .nav {
    align-items: flex-start;
  }

  .brand > span:last-child {
    max-width: 9rem;
  }

  .nav-links .github-link {
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.6rem);
  }

  .hero-actions,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-button,
  .inline-actions .btn {
    width: 100%;
  }

  .proof-list {
    align-items: flex-start;
    flex-direction: column;
    width: fit-content;
    margin-right: auto;
    margin-left: auto;
  }

  .workspace,
  .content-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .content-heading-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .field-row,
  .customize-grid,
  .download-row {
    grid-template-columns: 1fr;
  }

  .download-row .btn,
  .customize-grid .check {
    grid-column: 1;
  }

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

  .site-footer nav {
    justify-content: flex-start;
  }
}

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

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