:root {
  --bg: #f7f0e8;
  --surface: rgba(255, 251, 247, 0.9);
  --surface-strong: #fff7ee;
  --ink: #1e1d1a;
  --muted: #5d564c;
  --line: rgba(30, 29, 26, 0.1);
  --accent: #ff6b2c;
  --accent-deep: #d64b14;
  --accent-soft: #ffd3b8;
  --green: #176b52;
  --shadow: 0 18px 60px rgba(120, 74, 39, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 180, 135, 0.75), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 214, 139, 0.5), transparent 28%),
    linear-gradient(180deg, #fff7ef 0%, var(--bg) 48%, #f0e7dc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 64px;
}

.hero {
  padding: 22px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 241, 0.72);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links a,
.button,
.tool-link {
  text-decoration: none;
  color: inherit;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand img {
  display: block;
  height: 52px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 24px;
  padding-top: 30px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.tool-card,
.why-grid article,
.faq-grid article,
.ad-card {
  border: 1px solid rgba(30, 29, 26, 0.08);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 38px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 249, 243, 0.96), rgba(255, 238, 221, 0.88));
}

.hero-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(32, 28, 22, 0.95), rgba(59, 40, 24, 0.92));
  color: #fff3e8;
}

.eyebrow,
.tool-kicker,
.panel-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.eyebrow,
.tool-kicker {
  background: rgba(255, 107, 44, 0.12);
  color: var(--accent-deep);
}

.panel-label {
  background: rgba(255, 255, 255, 0.08);
  color: #ffd2b7;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

h1,
h2 {
  letter-spacing: -0.05em;
}

h1 {
  max-width: 10ch;
  margin-top: 18px;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.96;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.hero-text,
.why-grid p,
.faq-grid p,
.channel-list p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-text {
  max-width: 62ch;
  margin-top: 20px;
  font-size: 1.05rem;
}

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

.hero-tool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tool-pills a {
  padding: 10px 14px;
  border: 1px solid rgba(30, 29, 26, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.button,
.tool-actions button,
.tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.tool-actions button:hover,
.tool-link:hover {
  transform: translateY(-1px);
}

.button-primary,
.tool-actions button:not(.ghost) {
  background: var(--accent);
  color: white;
}

.button-secondary,
.tool-actions button.ghost,
.tool-link {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid rgba(30, 29, 26, 0.1);
}

.tool-link {
  white-space: nowrap;
}

.hero-points {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.hero-points li::before {
  content: "◆";
  margin-right: 10px;
  color: var(--accent);
}

.channel-list {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.channel-list a {
  display: block;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
  border: 1px solid transparent;
}

.channel-list a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 210, 183, 0.24);
}

.channel-list span {
  display: block;
  margin-bottom: 10px;
  color: #ffb88a;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.channel-list strong {
  display: block;
  margin-bottom: 6px;
}

main {
  display: grid;
  gap: 32px;
}

.section-heading {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.why-section,
.tools-section,
.faq-section,
.tool-menu-section {
  padding-top: 14px;
}

.why-grid,
.faq-grid,
.ad-strip,
.tool-grid {
  display: grid;
  gap: 18px;
}

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

.why-grid article,
.faq-grid article {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.82);
}

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

.tool-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.span-two {
  grid-column: span 2;
}

.tool-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #201c17;
  color: #fff7ee;
  font-size: 0.78rem;
  white-space: nowrap;
}

.badge-alt {
  background: #e7f4ee;
  color: var(--green);
}

textarea,
.output-box,
input[type="file"],
input[type="password"],
input[type="text"],
select {
  width: 100%;
  border: 1px solid rgba(30, 29, 26, 0.12);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

textarea,
.output-box {
  min-height: 200px;
  padding: 18px;
}

textarea {
  resize: vertical;
}

.output-box {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.tall {
  min-height: 290px;
}

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

.wrap-actions {
  row-gap: 12px;
}

.status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.status.error {
  color: #b42318;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.language-grid {
  align-items: start;
}

.language-panel {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 12px;
}

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

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

.ad-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 209, 183, 0.68), rgba(255, 247, 235, 0.82));
}

.ad-card.wide {
  grid-column: 1 / -1;
}

.ad-card p {
  font-weight: 700;
}

.ad-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.mid-gap {
  margin-top: -6px;
}

.select-wrap {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.input-wrap {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.range-wrap {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.control-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(30, 29, 26, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.toggle-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(30, 29, 26, 0.12);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--muted);
}

.toggle-chip input {
  margin: 0;
  accent-color: var(--accent);
}

input[type="file"] {
  padding: 16px;
}

input[type="password"],
input[type="text"],
input[type="number"] {
  min-height: 52px;
  padding: 0 16px;
}

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

select {
  padding: 14px 16px;
}

.preview-wrap {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed rgba(30, 29, 26, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.preview-wrap.checkerboard {
  background:
    linear-gradient(45deg, rgba(30, 29, 26, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(30, 29, 26, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(30, 29, 26, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(30, 29, 26, 0.06) 75%),
    rgba(255, 255, 255, 0.5);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.preview-wrap img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 14px;
}

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

.stats-row div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.stats-row span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
}

.stats-row small {
  color: var(--muted);
}

.image-editor-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.helper-note {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.api-key-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(30, 29, 26, 0.08);
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.82);
  box-shadow: var(--shadow);
}

.tool-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tool-menu-grid a {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(30, 29, 26, 0.08);
  border-radius: 20px;
  box-shadow: var(--shadow);
  background: rgba(255, 252, 247, 0.82);
  color: var(--ink);
  text-decoration: none;
}

.tool-menu-grid span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.section-intro {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.7;
}

.subhero {
  display: grid;
  gap: 18px;
  padding: 26px 0 8px;
}

.breadcrumb {
  display: inline-flex;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 241, 0.72);
  color: var(--muted);
  text-decoration: none;
}

.subhero-card {
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid rgba(30, 29, 26, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  background: linear-gradient(145deg, rgba(255, 249, 243, 0.96), rgba(255, 238, 221, 0.88));
}

.subhero-card h1 {
  max-width: none;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
}

.subhero-card p {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.7;
}

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

.meta-strip div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.meta-strip strong {
  display: block;
  margin-bottom: 6px;
}

.meta-strip span {
  color: var(--muted);
  font-size: 0.95rem;
}

.single-tool {
  grid-template-columns: 1fr;
}

.page-footer {
  display: grid;
  gap: 22px;
  margin-top: 20px;
  padding: 28px;
  border: 1px solid rgba(30, 29, 26, 0.08);
  border-radius: calc(var(--radius-xl) + 4px);
  background:
    radial-gradient(circle at top right, rgba(255, 159, 95, 0.26), transparent 28%),
    linear-gradient(145deg, rgba(38, 30, 22, 0.96), rgba(78, 49, 28, 0.94));
  color: #fff3e7;
  box-shadow: 0 28px 80px rgba(67, 38, 17, 0.22);
  overflow: hidden;
  position: relative;
}

.page-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
}

.page-footer > * {
  position: relative;
  z-index: 1;
}

.page-footer .section-heading h2,
.page-footer .section-heading p,
.page-footer .section-heading .eyebrow {
  color: inherit;
}

.page-footer .eyebrow {
  background: rgba(255, 211, 184, 0.14);
  color: #ffd7bf;
}

.footer-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.footer-brand-block,
.footer-signal-card,
.footer-column {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 248, 241, 0.06);
  backdrop-filter: blur(12px);
}

.footer-brand-block {
  padding: 26px;
}

.footer-brand-block h2 {
  margin-top: 14px;
  max-width: 12ch;
}

.footer-brand-block p,
.footer-note {
  margin-top: 14px;
  color: rgba(255, 243, 231, 0.78);
  line-height: 1.75;
}

.footer-signal-card {
  padding: 22px;
}

.footer-card-label,
.footer-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffc9a9;
}

.footer-signal-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.footer-signal-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.footer-signal-grid strong {
  display: block;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.footer-signal-grid span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 243, 231, 0.74);
  line-height: 1.5;
}

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

.footer-column {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px;
}

.footer-column a,
.footer-inline-link,
.footer-bottom-links a {
  color: #fff3e7;
  text-decoration: none;
}

.footer-column a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.footer-column a:hover,
.footer-inline-link:hover,
.footer-bottom-links a:hover {
  transform: translateY(-1px);
}

.footer-column a:hover {
  background: rgba(255, 211, 184, 0.12);
  border-color: rgba(255, 211, 184, 0.22);
}

.footer-note-column {
  grid-template-columns: 1fr;
}

.footer-inline-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 107, 44, 0.2);
  border: 1px solid rgba(255, 170, 126, 0.25);
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-bar p {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 243, 231, 0.72);
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tool-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tool-directory a {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff3e7;
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero-grid,
  .why-grid,
  .faq-grid,
  .tool-grid,
  .split-grid,
  .control-grid,
  .ad-strip {
    grid-template-columns: 1fr;
  }

  .two-up {
    grid-template-columns: 1fr;
  }

  .meta-strip,
  .tool-directory,
  .tool-menu-grid,
  .footer-grid,
  .footer-hero-panel {
    grid-template-columns: 1fr;
  }

  .span-two,
  .ad-card.wide {
    grid-column: auto;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1000px);
  }

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

  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
  }

  .hero-copy,
  .hero-panel,
  .tool-card,
  .why-grid article,
  .faq-grid article,
  .ad-card,
  .subhero-card,
  .page-footer,
  .footer-brand-block,
  .footer-signal-card,
  .footer-column {
    padding: 20px;
  }

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

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