:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5f6d7e;
  --line: #d8e1ea;
  --paper: #f7fafc;
  --white: #ffffff;
  --teal: #0f9f94;
  --teal-dark: #0b6f68;
  --rose: #c2415d;
  --amber: #f5b84b;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(247, 250, 252, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.nav {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand {
  font-weight: 800;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: white;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav {
  color: var(--muted);
  font-size: 14px;
}

main {
  padding: 0 5vw 56px;
}

.hero {
  align-items: end;
  display: block;
  min-height: 430px;
  padding: 72px 0 44px;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 84px);
  letter-spacing: 0;
  line-height: 0.96;
  margin: 10px 0 20px;
  max-width: 940px;
}

.lede {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
  margin: 0;
  max-width: 780px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.panel {
  padding: 26px;
}

.panel h2 {
  font-size: 28px;
  margin: 0 0 20px;
}

.url-form label {
  color: var(--muted);
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

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

input[type="url"],
input[type="email"],
input[type="number"],
select,
input[type="text"] {
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 52px;
  padding: 0 14px;
  width: 100%;
}

button,
.file-picker span,
.button-link {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
}

.secondary-button {
  background: #eef4f7;
  color: var(--ink);
}

.secondary-link {
  background: #eef4f7;
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.muted {
  background: #eef4f7;
  color: var(--muted);
}

.error {
  background: #fff0f3;
  color: var(--rose);
}

.success {
  background: #e8f8f4;
  color: var(--teal-dark);
}

.hidden {
  display: none;
}

.result {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 18px;
  overflow: hidden;
}

.result img {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  width: 100%;
}

.result-body {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
}

.result h3 {
  font-size: 21px;
  margin: 8px 0 6px;
}

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

.pill {
  background: #e9fbf7;
  border-radius: 999px;
  color: var(--teal-dark) !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  text-transform: uppercase;
}

.action-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.action-row button:nth-child(2),
#downloadImageBtn {
  background: var(--teal);
}

.ad-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fff7e3 100%);
}

.ad-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.image-tool {
  margin-top: 22px;
}

.support-section {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 420px;
  margin-top: 22px;
}

.support-copy {
  align-self: center;
}

.support-copy h2 {
  font-size: 34px;
  line-height: 1.05;
  margin: 0 0 14px;
  max-width: 720px;
}

.support-copy p:not(.eyebrow),
.support-panel p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.support-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fff7e3 100%);
  display: grid;
  gap: 16px;
}

.coffee-mark {
  align-items: center;
  background: var(--amber);
  border-radius: 8px;
  color: #332408;
  display: inline-flex;
  font-size: 28px;
  font-weight: 900;
  height: 68px;
  justify-content: center;
  width: 92px;
}

.support-panel h3 {
  font-size: 24px;
  margin: 0 0 6px;
}

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

.support-actions button:first-child {
  background: var(--teal-dark);
}

.membership-section {
  display: grid;
  gap: 22px;
  grid-template-columns: 360px minmax(0, 1fr);
  margin-top: 22px;
}

.membership-copy h2 {
  font-size: 34px;
  line-height: 1.05;
  margin: 0 0 14px;
}

.membership-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.login-form label,
.admin-form label {
  color: var(--muted);
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

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

.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.plan-card h3 {
  margin: 0;
}

.plan-price {
  color: var(--teal-dark);
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.plan-card ul {
  color: var(--muted);
  display: grid;
  gap: 8px;
  line-height: 1.45;
  margin: 0;
  padding-left: 18px;
}

.plan-card button {
  margin-top: auto;
}

.admin-page {
  padding-top: 42px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

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

.image-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: 260px minmax(0, 1fr);
}

.image-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.file-picker input {
  display: none;
}

.file-picker span {
  background: var(--teal-dark);
  width: 100%;
}

.slider-label {
  color: var(--muted);
  display: grid;
  gap: 8px;
  font-size: 14px;
}

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

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.canvas-wrap {
  background:
    linear-gradient(45deg, #eef2f6 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f6 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f6 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 320px;
  overflow: hidden;
}

canvas {
  display: block;
  height: auto;
  width: 100%;
}

.faq {
  display: grid;
  gap: 28px;
  grid-template-columns: 360px minmax(0, 1fr);
  margin-top: 42px;
}

.faq h2 {
  font-size: 34px;
  margin: 0;
}

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

details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

summary {
  cursor: pointer;
  font-weight: 750;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 620px);
  padding: 34px 5vw 44px;
}

.site-footer p {
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: end;
}

.site-footer a {
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 700;
}

.content-hero {
  padding: 64px 0 28px;
}

.content-hero h1 {
  font-size: clamp(38px, 6vw, 72px);
  letter-spacing: 0;
  line-height: 1;
  margin: 10px 0 18px;
  max-width: 900px;
}

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

.article {
  display: grid;
  gap: 18px;
}

.article h2,
.article h3 {
  margin: 0;
}

.article p,
.article li {
  color: var(--muted);
  line-height: 1.72;
}

.article ul,
.article ol {
  margin: 0;
  padding-left: 22px;
}

.tool-links {
  display: grid;
  gap: 10px;
}

.tool-links a {
  background: #eef4f7;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 750;
  padding: 12px 14px;
}

.note-box {
  background: #fff7e3;
  border: 1px solid #f3d596;
  border-radius: 8px;
  color: #715316;
  line-height: 1.6;
  padding: 16px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(23, 32, 51, 0.46);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 22px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
}

.modal {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.22);
  max-width: 460px;
  padding: 28px;
  width: 100%;
}

.modal h2 {
  font-size: 28px;
  margin: 0 0 12px;
}

.modal p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 860px) {
  .tool-grid,
  .image-layout,
  .support-section,
  .membership-section,
  .faq,
  .site-footer,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  .input-row,
  .result-body,
  .plan-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    justify-content: start;
  }

  .nav {
    display: none;
  }

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