:root {
  color-scheme: light;
  --bg: #fffdf7;
  --surface: #ffffff;
  --border: #e5e0d8;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --text: #1f1f1f;
  --muted: #5f5f5f;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.row {
  display: flex;
}

.row.gap-sm {
  gap: 0.75rem;
}

.row.align-center {
  align-items: center;
}

.row.between {
  justify-content: space-between;
}

.app-header {
  position: sticky;
  top: 0;
  background: rgba(255, 253, 247, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.logo {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.github {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.github:hover {
  color: var(--accent-dark);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5rem;
  padding-bottom: 4rem;
}

.hero {
  padding: 5rem 0 3rem 0;
}

.hero-layout {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero h1 {
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  margin-bottom: 0.75rem;
}

.hero p {
  margin: 0 0 2.5rem 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-figure {
  display: flex;
  justify-content: center;
}

.hero-figure img {
  width: 100%;
  max-width: 520px;
  border-radius: 32px;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.18);
}

.upload {
  display: flex;
  justify-content: flex-start;
}

.drop-zone {
  width: min(580px, 100%);
  background: rgba(255, 255, 255, 0.8);
  border: 2px dashed rgba(15, 23, 42, 0.12);
  border-radius: 30px;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
}

.drop-zone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.drop-zone.dragging,
.drop-zone:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.7);
}

.drop-zone svg {
  width: 60px;
  height: 60px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.drop-zone p {
  font-weight: 600;
  margin: 0;
}

.drop-zone span {
  color: var(--muted);
  font-size: 0.9rem;
}

.drop-zone button {
  margin-top: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 180ms ease;
}

.drop-zone button:hover {
  background: var(--accent-dark);
}

.editor {
  padding: 3rem 0;
}

.editor-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.controls-column {
  display: grid;
  gap: 1.75rem;
}

.panel {
  background: var(--surface);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.panel p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.panel .muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.field-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 0.6rem 0.9rem;
}

.input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  width: 100%;
}

select {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
}

select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.primary {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary:active {
  transform: translateY(1px);
}

.primary.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: center;
}

.primary.with-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: white;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(148, 163, 184, 0.7);
  transition: 0.3s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #ffffff;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.switch input:checked+.slider {
  background-color: rgba(249, 115, 22, 0.9);
}

.switch input:checked+.slider:before {
  transform: translateX(18px);
}

.dimension-block {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  margin-bottom: 1.5rem;
}

.dimension-block strong {
  font-size: 1.1rem;
}

.image-preview {
  position: relative;
  min-height: 260px;
  border-radius: 24px;
  background: repeating-linear-gradient(45deg, #f1f5f9 0, #f1f5f9 10px, #e2e8f0 10px, #e2e8f0 20px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-preview img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.18);
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ghost-icon {
  border: none;
  background: transparent;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease;
}

.ghost-icon:hover {
  background: rgba(15, 23, 42, 0.08);
}

.ghost-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--text);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dimension-summary {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.preview-img {
  max-width: 100%;
  height: auto;
  display: block;
}

.muted.large {
  font-size: 1.05rem;
  line-height: 1.8;
}

.section {
  padding: 4rem 0;
}

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

.key-features-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.text-block {
  display: grid;
  gap: 2rem;
}

.feature-list {
  display: grid;
  gap: 1.5rem;
}

.feature-list article {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
}

.feature-figure {
  display: flex;
  justify-content: center;
}

.feature-figure img {
  width: 100%;
  max-width: 460px;
  border-radius: 30px;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.2);
}

.section-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-heading.center {
  text-align: center;
  justify-items: center;
}

.card-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card-grid.two-cols {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-items: center;
}

.feature-card {
  text-align: left;
  display: grid;
  gap: 1.25rem;
}

.icon-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.icon-bubble svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-bubble.large {
  width: 72px;
  height: 72px;
}

.icon-bubble.large svg {
  width: 32px;
  height: 32px;
}

.shaded {
  background: rgba(255, 255, 255, 0.7);
}

.step-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step-card {
  background: var(--surface);
  border-radius: 26px;
  padding: 2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  text-align: center;
}

.step-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  justify-self: center;
}

.accordion {
  display: grid;
  gap: 1rem;
}

.accordion-item {
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 180ms ease;
}

.accordion-item.open {
  transform: translateY(-2px);
}

.accordion-button {
  width: 100%;
  background: none;
  border: none;
  padding: 1.2rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.accordion-button svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}

.accordion-item.open .accordion-button svg {
  transform: rotate(45deg);
}

.accordion-panel {
  padding: 0 1.5rem 0 1.5rem;
  max-height: 0;
  opacity: 0;
  transition: max-height 220ms ease, opacity 220ms ease;
}

.accordion-item.open .accordion-panel {
  padding-bottom: 1.5rem;
  max-height: 300px;
  opacity: 1;
}

.app-card {
  text-align: center;
  display: grid;
  gap: 1.5rem;
  max-width: 420px;
}

.primary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transition: filter 180ms ease, transform 180ms ease;
}

.primary-link:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.primary-link:active {
  transform: translateY(1px);
}

.info {
  background: rgba(255, 255, 255, 0.7);
  padding: 3.5rem 0;
}

.columns {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.info h2 {
  margin-top: 0;
}

.info ul,
.info ol {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.app-footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
}

#toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: #1f2937;
  color: white;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .drop-zone {
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
  }

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

  .dimension-block {
    flex-direction: column;
  }

  .hero {
    text-align: center;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .upload {
    justify-content: center;
  }

  .preview-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}