:root {
  --bg: #f4efe7;
  --panel: rgba(255, 250, 243, 0.84);
  --panel-strong: #fff8ef;
  --line: rgba(34, 29, 26, 0.12);
  --text: #201714;
  --muted: #66534c;
  --accent: #d45c2f;
  --accent-dark: #9f3816;
  --shadow: 0 24px 80px rgba(71, 44, 24, 0.15);
}

html {
  background: #f9f3ea;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(212, 92, 47, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(250, 203, 98, 0.35), transparent 26%),
    linear-gradient(180deg, #f9f3ea 0%, #f0e7da 100%);
}

.page-layout {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1180px) minmax(120px, 160px);
  gap: 20px;
  align-items: start;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.shell {
  width: 100%;
  margin: 0;
  padding: 48px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.topbar-plain {
  margin-bottom: 32px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.topnav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a,
.text-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}

.topnav a:hover,
.text-link:hover {
  text-decoration: underline;
}

.ad-rail {
  position: sticky;
  top: 24px;
  min-height: 640px;
  padding-top: 48px;
  position: sticky;
  overflow: hidden;
  isolation: isolate;
}

.ad-rail .adsbygoogle {
  width: 100%;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(32, 23, 20, 0.06);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.bottom-ad {
  position: relative;
  margin-top: 24px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(32, 23, 20, 0.06);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.bottom-ad .adsbygoogle {
  min-height: 120px;
  position: relative;
  z-index: 1;
}

.ad-placeholder {
  position: absolute;
  inset: 48px 0 auto;
  min-height: 600px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 1px dashed rgba(32, 23, 20, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(212, 92, 47, 0.03) 10px,
      rgba(212, 92, 47, 0.03) 20px
    );
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 0;
}

.ad-placeholder-bottom {
  inset: 12px;
  min-height: 120px;
}

.adsbygoogle[data-ad-status="filled"] + .ad-placeholder,
.adsbygoogle[data-ad-status="filled"] ~ .ad-placeholder,
.ad-slot-filled .ad-placeholder {
  display: none;
}

.hero {
  max-width: 780px;
  margin-bottom: 28px;
}

.eyebrow,
.preview-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--accent-dark);
}

.hero h1,
.preview-header h2 {
  margin: 0;
  line-height: 0.96;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  max-width: 11ch;
}

.lede {
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.info-card h2,
.article-strip h2,
.faq-panel h2 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.info-card p {
  color: var(--muted);
  line-height: 1.7;
}

.steps,
.feature-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.article-strip,
.faq-panel {
  margin-top: 24px;
}

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

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

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

.article-grid-list {
  grid-template-columns: 1fr;
}

.article-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(32, 23, 20, 0.08);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 92, 47, 0.22);
  box-shadow: var(--shadow);
}

.article-card h3,
.article-card h2 {
  margin: 0;
  line-height: 1.15;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.article-card-large {
  padding: 28px;
}

.article-card-muted {
  opacity: 0.86;
}

.article-tag {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 92, 47, 0.1);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(32, 23, 20, 0.08);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.article-page {
  background:
    radial-gradient(circle at top left, rgba(212, 92, 47, 0.14), transparent 26%),
    linear-gradient(180deg, #f9f3ea 0%, #f0e7da 100%);
}

.article-shell {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.tool-page {
  background:
    radial-gradient(circle at top left, rgba(212, 92, 47, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(51, 112, 255, 0.12), transparent 22%),
    linear-gradient(180deg, #f9f3ea 0%, #f0e7da 100%);
}

.tool-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.tool-workspace {
  margin-top: 14px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.secondary {
  margin-top: 22px;
  border: 1px solid rgba(32, 23, 20, 0.12);
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.secondary:hover:enabled {
  transform: translateY(-1px);
}

.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.preview-stage-compact {
  min-height: 320px;
}

.generated-image-preview {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
}

.generated-image-preview.is-hidden,
.svg-preview-empty.is-hidden {
  display: none;
}

.output-field {
  margin-top: 18px;
}

.code-output,
.text-output {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
}

.code-output {
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
}

.code-input {
  min-height: 220px;
}

.file-card-preview-wrap-dark {
  background:
    linear-gradient(45deg, rgba(32, 23, 20, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(32, 23, 20, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(32, 23, 20, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(32, 23, 20, 0.08) 75%);
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0;
}

.svg-thumb,
.svg-thumb svg {
  width: 100%;
  height: 100%;
}

.svg-preview-stage {
  margin-top: 20px;
  padding: 24px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.32)),
    linear-gradient(135deg, rgba(51, 112, 255, 0.08), rgba(255, 255, 255, 0));
  border: 1px solid rgba(32, 23, 20, 0.08);
  min-height: 420px;
}

.svg-preview-stage svg {
  width: 100%;
  height: auto;
  display: block;
}

.svg-preview-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.article-hero {
  margin-bottom: 28px;
}

.article {
  padding: 32px;
  border-radius: 28px;
  background: rgba(255, 250, 243, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow);
}

.article h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.article h2 {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.article p,
.article li {
  color: var(--muted);
  line-height: 1.78;
  font-size: 1.02rem;
}

.article ul {
  padding-left: 22px;
}

.article-intro {
  font-size: 1.12rem;
}

.panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 24px;
}

.dropzone {
  display: grid;
  gap: 10px;
  min-height: 220px;
  border: 1.5px dashed rgba(32, 23, 20, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 239, 0.4)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(212, 92, 47, 0.04) 10px,
      rgba(212, 92, 47, 0.04) 20px
    );
  padding: 22px;
  align-content: center;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  transform: translateY(-2px);
  border-color: rgba(212, 92, 47, 0.45);
}

.dropzone-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 92, 47, 0.1);
  color: var(--accent-dark);
  font-size: 0.84rem;
}

.dropzone strong {
  font-size: 1.25rem;
}

.dropzone span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.controls {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.file-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(32, 23, 20, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
}

.file-card.is-hidden {
  display: none;
}

.file-card-preview-wrap {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(32, 23, 20, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(32, 23, 20, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(32, 23, 20, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(32, 23, 20, 0.04) 75%);
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0;
}

.file-card-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.file-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-card-copy strong,
.file-card-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(32, 23, 20, 0.08);
  border-radius: 14px;
  background: rgba(32, 23, 20, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(212, 92, 47, 0.1);
  border-color: rgba(212, 92, 47, 0.22);
}

.field,
.checkbox {
  display: grid;
  gap: 10px;
}

.field span,
.checkbox span {
  font-size: 0.92rem;
}

.color-input {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(32, 23, 20, 0.14);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.swatch:hover {
  transform: translateY(-1px);
}

.swatch.is-active {
  border-color: rgba(212, 92, 47, 0.9);
  box-shadow:
    0 0 0 3px rgba(212, 92, 47, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.field.is-disabled {
  opacity: 0.5;
}

.field.is-disabled .swatch,
.field.is-disabled input {
  pointer-events: none;
}

input[type="text"],
input[type="color"],
input[type="range"] {
  width: 100%;
}

input[type="text"] {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
}

input[type="color"] {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.78);
}

input[type="range"] {
  accent-color: var(--accent);
}

.checkbox {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.primary {
  margin-top: 22px;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #ec8a3e 100%);
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.primary:hover:enabled {
  transform: translateY(-1px);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.meta {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
  min-height: 48px;
}

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

.preview-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.badge {
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(32, 23, 20, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
}

.preview-stage {
  margin-top: 20px;
  padding: 26px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.32)),
    linear-gradient(135deg, rgba(212, 92, 47, 0.08), rgba(255, 255, 255, 0));
  border: 1px solid rgba(32, 23, 20, 0.08);
}

.preview-stage canvas {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
  border-radius: 22%;
  box-shadow: 0 20px 60px rgba(38, 27, 17, 0.18);
  background:
    linear-gradient(45deg, rgba(32, 23, 20, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(32, 23, 20, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(32, 23, 20, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(32, 23, 20, 0.04) 75%);
  background-size: 32px 32px;
  background-position:
    0 0,
    0 16px,
    16px -16px,
    -16px 0;
}

.spec-list {
  margin: 22px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(32, 23, 20, 0.92);
  color: white;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

@media (max-width: 920px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .ad-rail {
    display: none;
  }

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

  .content-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .preview-header {
    flex-direction: column;
  }

  .file-card {
    grid-template-columns: 60px minmax(0, 1fr) 40px;
  }

  .file-card-preview-wrap {
    width: 60px;
    height: 60px;
  }
}

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

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

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .preview-stage {
    padding: 16px;
  }

  .article-shell {
    width: min(100% - 20px, 920px);
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .tool-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
    padding-bottom: 36px;
  }

  .article {
    padding: 20px;
    border-radius: 22px;
  }
}
