:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-soft: #f9faf6;
  --ink: #171816;
  --muted: #667066;
  --line: #dfe5dc;
  --forest: #1d6f56;
  --forest-dark: #104434;
  --coral: #d86a4a;
  --gold: #d99f35;
  --blue: #305f86;
  --shadow: 0 24px 70px rgba(26, 31, 27, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101512;
  --surface: #171e1a;
  --surface-soft: #1d2621;
  --ink: #edf4ef;
  --muted: #aab9af;
  --line: #34443a;
  --forest: #64c5a1;
  --forest-dark: #309674;
  --coral: #ed8a6d;
  --gold: #e4b554;
  --blue: #78a9d0;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 14px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.site-shell {
  width: calc(100% - clamp(16px, 2vw, 36px));
  max-width: 1920px;
  margin: 0 auto;
  padding: 20px 0 42px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid rgba(223, 229, 220, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 44px rgba(26, 31, 27, 0.08);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav nav,
.hero-actions,
.result-tools,
.download-row,
.nav-actions,
.language-switch {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 38px;
  border-radius: 5px;
  background: transparent url("./examples/mesh-it-studio-mark-transparent.png") center / contain no-repeat;
}

.brand-text {
  white-space: nowrap;
}

.site-nav nav {
  justify-content: center;
  gap: 8px;
}

.site-nav nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav nav a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.site-nav nav a.is-active,
.site-nav nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.legal-status {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-actions {
  justify-content: end;
  gap: 10px;
}

.language-switch {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.language-button {
  min-width: 36px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.language-button.is-active {
  background: var(--ink);
  color: #fff;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.theme-toggle-icon {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
}

.theme-toggle-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid var(--surface-soft);
  border-radius: 50%;
}

:root[data-theme="dark"] .theme-toggle-icon::before {
  inset: 5px 7px 7px 5px;
  border: 0;
  background: var(--gold);
  box-shadow: 5px -3px 0 0 var(--ink);
}

.theme-toggle:hover {
  color: var(--ink);
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 5.6rem;
  line-height: 0.92;
}

h2 {
  font-size: 2.25rem;
  line-height: 1.04;
}

h3 {
  font-size: 1.16rem;
  line-height: 1.18;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: 26px;
  align-items: center;
  min-height: min(680px, calc(100vh - 120px));
  padding: clamp(30px, 5vw, 72px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(248, 250, 246, 0.78), rgba(248, 250, 246, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23dfe6dc'/%3E%3Cpath d='M0 670 C250 570 400 780 630 640 C820 525 940 385 1210 430 C1400 462 1500 375 1600 315 L1600 900 L0 900 Z' fill='%239fb9aa'/%3E%3Cpath d='M0 780 C200 720 360 825 610 735 C860 645 1030 655 1235 735 C1390 795 1510 735 1600 690 L1600 900 L0 900 Z' fill='%235f836f'/%3E%3Ccircle cx='1245' cy='235' r='150' fill='%23d99f35' opacity='.65'/%3E%3Cg opacity='.22' fill='none' stroke='%23171816' stroke-width='2'%3E%3Cpath d='M220 260h260v150H220z'/%3E%3Cpath d='M275 315h150M275 360h95M700 205h300v260H700zM755 280h190v110H755z'/%3E%3Cpath d='M1120 530h210v130h-210z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.hero-brand-panel {
  display: grid;
  align-items: center;
  justify-items: start;
  min-width: 0;
}

.hero-brand-panel img {
  display: block;
  width: min(720px, 100%);
  height: auto;
  background: transparent;
  filter: drop-shadow(0 18px 34px rgba(26, 31, 27, 0.13));
}

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

.hero-copy h1 {
  max-width: 680px;
  font-size: clamp(3rem, 5vw, 5rem);
}

.hero-text {
  max-width: 620px;
  margin: 24px 0 0;
  color: #3e463e;
  font-size: 1.15rem;
  line-height: 1.55;
}

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

.primary-link,
.secondary-link,
.offer-card a,
.download-link,
.print-link,
.primary-action,
.secondary-action {
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.primary-link,
.secondary-link,
.offer-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
}

.primary-link,
.offer-card a {
  background: var(--ink);
  color: #fff;
}

.secondary-link {
  border: 1px solid rgba(23, 24, 22, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.commerce-section,
.examples-section,
.generator-section,
.feedback-section {
  margin-top: 20px;
  padding: clamp(22px, 3.2vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.section-heading p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

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

.offer-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 250px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.offer-card.accent {
  background: #f9f3eb;
}

.offer-kicker {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7eee7;
  color: var(--forest-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

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

.offer-card a {
  width: fit-content;
  margin-top: auto;
}

.examples-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 12px;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-color: #b7c2b8 transparent;
}

.example-card {
  display: grid;
  flex: 0 0 calc((100% - 36px) / 4);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  scroll-snap-align: start;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.example-card:hover {
  border-color: rgba(23, 24, 22, 0.28);
  box-shadow: 0 12px 28px rgba(23, 24, 22, 0.09);
  transform: translateY(-2px);
}

.example-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}

.example-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3.05;
  border-radius: 6px;
  object-fit: contain;
}

.example-card strong {
  font-size: 0.95rem;
  line-height: 1.3;
}

.job-pill,
.format-note,
.runtime {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 8px 11px;
  white-space: nowrap;
}

.job-pill[data-state="running"] {
  color: var(--blue);
}

.job-pill[data-state="done"] {
  color: var(--forest);
}

.job-pill[data-state="error"] {
  color: #b5423d;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1fr) minmax(420px, 1.35fr);
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
}

.image-workspace {
  grid-template-columns: minmax(440px, 0.95fr) minmax(520px, 1.35fr);
}

.image-workflow-controls {
  display: grid;
  grid-column: 1;
  gap: 12px;
  min-width: 0;
}

.workflow-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.workflow-tab {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 880;
  cursor: pointer;
}

.workflow-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.workflow-panel[hidden] {
  display: none;
}

body[data-page="home"] .generator-section,
body[data-page="home"] .feedback-section,
body[data-page="image"] .hero-section,
body[data-page="image"] .examples-section,
body[data-page="image"] .feedback-section,
body[data-page="lithophane"] .hero-section,
body[data-page="lithophane"] .examples-section,
body[data-page="lithophane"] .feedback-section,
body[data-page="feedback"] .hero-section,
body[data-page="feedback"] .examples-section,
body[data-page="feedback"] .generator-section {
  display: none;
}

body[data-page="image"] .generator-section,
body[data-page="lithophane"] .generator-section,
body[data-page="feedback"] .feedback-section {
  margin-top: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

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

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

.site-footer a {
  font-weight: 850;
  text-underline-offset: 3px;
}

.legal-shell {
  max-width: 1180px;
}

.legal-document {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.legal-heading h1 {
  margin: 6px 0 10px;
  font-size: clamp(2.4rem, 7vw, 5rem);
}

.legal-updated {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.legal-draft-warning {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
}

.legal-draft-warning strong {
  display: block;
  margin-bottom: 6px;
}

.legal-draft-warning p,
.legal-document section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.legal-document section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.legal-document section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-document section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.legal-document section p + p {
  margin-top: 12px;
}

.legal-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.legal-details div {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.legal-details dt {
  color: var(--muted);
  font-weight: 800;
}

.legal-details dd {
  margin: 0;
  font-weight: 850;
}

.settings-panel {
  align-self: stretch;
}

.optimization-panel {
  min-width: 0;
}

.image-workspace > .result-panel {
  grid-column: 2;
  grid-row: 1;
}

.lithophane-workspace {
  grid-template-columns: minmax(340px, 0.95fr) minmax(520px, 1.35fr);
}

.lithophane-result-panel {
  grid-column: 2;
  grid-row: 1;
}

.lithophane-settings-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.lithophane-settings-panel .panel-head {
  margin-bottom: 12px;
}

.tool-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(26, 31, 27, 0.08);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-panel h2 {
  font-size: 1.08rem;
  line-height: 1.18;
}

.panel-intro,
.field-help {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.field-help {
  margin: 10px 0 0;
  font-size: 0.84rem;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.usage-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.45;
}

.usage-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--forest);
}

.usage-consent a {
  font-weight: 900;
  text-underline-offset: 3px;
}

.download-warning {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--forest) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--forest) 8%, var(--surface));
  color: var(--ink);
}

.download-warning strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 950;
}

.download-warning p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.55;
}

.plate-style-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf5;
}

.plate-style-panel[hidden] {
  display: none;
}

.plate-style-panel .choice-copy h3 {
  font-size: 0.88rem;
}

.plate-style-control {
  background: #fff;
}

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

.plate-detail-grid label[hidden] {
  display: none;
}

.frame-side-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.frame-side-options[hidden] {
  display: none;
}

.frame-side-options > strong {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.frame-side-options .toggle-field {
  margin-top: 0;
}

.dropzone {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-areas:
    "visual title"
    "visual subtitle";
  align-items: center;
  justify-items: start;
  min-height: 112px;
  padding: 16px;
  column-gap: 14px;
  row-gap: 4px;
  position: relative;
  border: 1.5px dashed #adb8ad;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(29, 111, 86, 0.08), transparent 48%),
    var(--surface-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--forest);
  background: #eef7f0;
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  grid-area: visual;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest-dark);
  font-size: 2rem;
  line-height: 1;
}

.upload-preview {
  grid-area: visual;
  display: block;
  overflow: hidden;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(26, 31, 27, 0.1);
}

.upload-preview[hidden] {
  display: none;
}

.upload-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone.has-image .drop-icon {
  display: none;
}

.dropzone strong {
  grid-area: title;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.2;
}

.drop-subtitle {
  grid-area: subtitle;
  color: var(--muted);
  font-weight: 760;
}

.choice-block {
  margin-top: 16px;
}

.choice-copy h3 {
  margin: 0 0 4px;
  font-size: 0.88rem;
}

.choice-copy p,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.hint {
  margin-top: 10px;
}

.preset-row,
.optimizer-row {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

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

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

.image-workspace .preset-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-workspace .optimizer-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preset,
.optimizer-mode,
.icon-button,
.primary-action,
.secondary-action,
.download-link,
.print-link {
  cursor: pointer;
}

.preset,
.optimizer-mode {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f4ef;
  color: var(--ink);
  font-weight: 850;
}

.preset {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: center;
  justify-items: start;
  padding: 8px 9px;
  text-align: left;
}

.image-workspace .preset {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  min-height: 44px;
  padding: 5px 7px;
  font-size: 0.78rem;
}

.image-workspace .preset-icon {
  width: 38px;
  height: 30px;
}

.image-workspace .optimizer-mode {
  min-width: 0;
  min-height: 38px;
  padding: 5px 4px;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.preset-icon {
  position: relative;
  display: block;
  overflow: hidden;
  width: 74px;
  height: 56px;
  border-radius: 5px;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.preset-icon::after {
  content: "";
  position: absolute;
  inset: 6px 5px;
  border-radius: 4px;
  background: var(--forest);
}

.preset-icon-sign {
  background-image: url("./examples/modis-mode-sign-icon.png");
}

.preset-icon-sign::after {
  content: none;
}

.preset-icon-logo {
  background-image: url("./examples/modis-mode-logo-icon.png");
}

.preset-icon-logo::after {
  content: none;
}

.preset-icon-cutout {
  background-image: url("./examples/modis-mode-cutout-icon.png");
}

.preset-icon-cutout::after {
  content: none;
}

.optimizer-mode {
  color: var(--muted);
}

.preset.is-active,
.optimizer-mode.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.optimizer-section {
  margin-top: 10px;
}

.optimizer-section h2 {
  margin: 0;
}

.optimizer-short-note {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.38;
}

.preset.is-active .preset-icon {
  background-color: rgba(255, 255, 255, 0.26);
}

.preset.is-active .preset-icon-logo::after {
  background: #72c4a8;
}

.preset.is-active .preset-icon-cutout::after {
  background: var(--ink);
  box-shadow: 0 0 0 999px rgba(255, 255, 255, 0.22);
}

.mode-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.image-workspace .direct-action {
  margin-top: 14px;
}

.mode-guide-copy {
  min-width: 0;
}

.mode-guide-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.92rem;
}

.mode-guide-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 740;
  line-height: 1.36;
}

.mode-guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mode-guide-tags span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.lithophane-guide {
  grid-template-columns: 1fr;
  gap: 10px;
}

.lithophane-guide .mode-guide-copy {
  width: 100%;
}

.lithophane-guide .mode-guide-tags span {
  white-space: normal;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #edf1eb;
  color: var(--ink);
  font-size: 1.16rem;
}

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

.control-grid label,
.select-label {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.control-grid span,
.select-label span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.control-grid input,
.select-label select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 820;
}

.control-grid small,
.control-grid output {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input[type="range"] {
  min-height: 28px;
  accent-color: var(--forest);
}

.advanced-panel {
  margin-top: 12px;
}

.primary-action,
.secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
}

.primary-action {
  margin-top: 14px;
  background: var(--forest);
  color: #fff;
}

.primary-action:hover {
  background: var(--forest-dark);
}

.primary-action:disabled {
  background: #9da8a1;
  cursor: wait;
}

.secondary-action {
  margin-top: 12px;
  background: #edf1eb;
  color: var(--ink);
}

.secondary-action.subtle {
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.secondary-action.compact {
  width: auto;
  min-height: 38px;
  margin-top: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.secondary-action[hidden] {
  display: none;
}

.secondary-action:disabled {
  cursor: not-allowed;
  color: #8a9088;
}

.preview-material-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.material-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.material-head h3 {
  font-size: 0.92rem;
}

.material-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.36;
}

.material-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: min(100%, 260px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #edf1eb;
}

.material-mode {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.material-mode.is-active {
  background: var(--ink);
  color: #fff;
}

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

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

.color-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.color-field[hidden] {
  display: none;
}

.color-field span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.color-field input {
  width: 42px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(23, 24, 22, 0.16);
  cursor: pointer;
}

.color-swatch.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.82), 0 0 0 2px rgba(23, 24, 22, 0.1);
}

.swatch-studio-green {
  --swatch: #168b7d;
}

.swatch-black {
  --swatch: #111111;
}

.swatch-white {
  --swatch: #f3f1e8;
}

.swatch-gold {
  --swatch: #d99f35;
}

.swatch-blue {
  --swatch: #305f86;
}

.swatch-coral {
  --swatch: #d86a4a;
}

.result-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(48, 95, 134, 0.12), transparent 45%),
    linear-gradient(300deg, rgba(216, 106, 74, 0.13), transparent 46%),
    #f9faf6;
  color: var(--muted);
  font-weight: 800;
}

.viewer-scale-overlay {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  display: grid;
  gap: 4px;
  max-width: min(340px, calc(100% - 28px));
  padding: 9px 11px;
  border: 1px solid rgba(223, 229, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
  pointer-events: none;
}

.viewer-scale-overlay[hidden] {
  display: none;
}

.viewer-scale-overlay small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.result-panel.is-expanded,
.lithophane-result-panel.is-expanded {
  grid-column: 1 / -1;
  grid-row: 1;
}

.result-panel.is-expanded .result-preview,
.lithophane-result-panel.is-expanded .result-preview {
  min-height: min(72vh, 780px);
}

.workspace:has(.result-panel.is-expanded) {
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1fr);
}

.image-workspace:has(.result-panel.is-expanded) {
  grid-template-columns: 1fr;
}

.image-workspace:has(.result-panel.is-expanded) .image-workflow-controls {
  grid-column: 1;
  grid-row: 2;
}

.image-workspace:has(.result-panel.is-expanded) .upload-panel,
.image-workspace:has(.result-panel.is-expanded) .settings-panel {
  grid-column: auto;
  grid-row: auto;
}

.workspace:has(.result-panel.is-expanded) .upload-panel {
  grid-column: 1;
  grid-row: 2;
}

.workspace:has(.result-panel.is-expanded) .settings-panel {
  grid-column: 2;
  grid-row: 2;
}

.lithophane-workspace:has(.lithophane-result-panel.is-expanded) {
  grid-template-columns: 1fr;
}

.lithophane-workspace:has(.lithophane-result-panel.is-expanded) .lithophane-upload-panel {
  grid-column: 1;
  grid-row: 2;
}

.progress-wrap {
  margin: -4px 0 12px;
}

.progress-wrap[hidden] {
  display: none;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #edf1eb;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--gold), var(--coral));
  transition: width 260ms ease;
}

.cancel-optimizer {
  margin-top: 10px;
  width: 100%;
}

.lithophane-preview-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.lithophane-preview-tools:has(.lithophane-preview-card[hidden]) {
  grid-template-columns: 1fr;
}

.lithophane-preview-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.lithophane-preview-card[hidden] {
  display: none;
}

.lithophane-preview-card strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.lithophane-preview-card img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.light-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
}

.light-control input {
  accent-color: var(--gold);
}

.light-control input:disabled {
  opacity: 0.45;
}

.light-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.light-toggle input {
  width: 18px;
  height: 18px;
}

.light-control output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.result-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-notice {
  position: absolute;
  inset: auto 18px 18px;
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  text-align: center;
}

.viewer-notice[hidden] {
  display: none;
}

.download-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.download-link,
.print-link {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 0;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.print-link {
  border: 1px solid var(--line);
  background: #f2f4ef;
  color: var(--ink);
}

.download-link.is-disabled,
.print-link:disabled {
  pointer-events: none;
  background: #d8ddd4;
  color: #7a8178;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.4;
}

.message.is-error {
  color: #b5423d;
}

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

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--ink);
  font-size: 2.2rem;
  line-height: 1;
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.feedback-form,
.feedback-list-wrap {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(26, 31, 27, 0.08);
}

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

.feedback-form h3,
.feedback-list-head h3 {
  font-size: 1rem;
}

.feedback-form p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.4;
}

.feedback-form label {
  display: grid;
  gap: 7px;
}

.feedback-form label span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  outline: none;
  padding: 11px 12px;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 140px;
}

.feedback-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feedback-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.feedback-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.feedback-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feedback-item strong {
  overflow-wrap: anywhere;
}

.feedback-item time,
.empty-feedback {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.feedback-item p,
.empty-feedback {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

:root[data-theme="dark"] .site-nav {
  border-color: rgba(52, 68, 58, 0.9);
  background: rgba(23, 30, 26, 0.9);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .site-nav nav a.is-active,
:root[data-theme="dark"] .site-nav nav a[aria-current="page"],
:root[data-theme="dark"] .language-button.is-active,
:root[data-theme="dark"] .workflow-tab.is-active,
:root[data-theme="dark"] .preset.is-active,
:root[data-theme="dark"] .optimizer-mode.is-active,
:root[data-theme="dark"] .material-mode.is-active,
:root[data-theme="dark"] .primary-link,
:root[data-theme="dark"] .offer-card a,
:root[data-theme="dark"] .download-link {
  background: #edf4ef;
  color: #111713;
}

:root[data-theme="dark"] .hero-section {
  background:
    linear-gradient(rgba(11, 17, 13, 0.77), rgba(11, 17, 13, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%2319241e'/%3E%3Cpath d='M0 670 C250 570 400 780 630 640 C820 525 940 385 1210 430 C1400 462 1500 375 1600 315 L1600 900 L0 900 Z' fill='%23325142'/%3E%3Cpath d='M0 780 C200 720 360 825 610 735 C860 645 1030 655 1235 735 C1390 795 1510 735 1600 690 L1600 900 L0 900 Z' fill='%231f372c'/%3E%3Ccircle cx='1245' cy='235' r='150' fill='%23d99f35' opacity='.45'/%3E%3Cg opacity='.22' fill='none' stroke='%23edf4ef' stroke-width='2'%3E%3Cpath d='M220 260h260v150H220z'/%3E%3Cpath d='M275 315h150M275 360h95M700 205h300v260H700zM755 280h190v110H755z'/%3E%3Cpath d='M1120 530h210v130h-210z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

:root[data-theme="dark"] .hero-text {
  color: var(--muted);
}

:root[data-theme="dark"] .secondary-link,
:root[data-theme="dark"] .job-pill,
:root[data-theme="dark"] .format-note,
:root[data-theme="dark"] .runtime,
:root[data-theme="dark"] .viewer-scale-overlay,
:root[data-theme="dark"] .viewer-notice {
  border-color: var(--line);
  background: rgba(29, 38, 33, 0.9);
  color: var(--ink);
}

:root[data-theme="dark"] .offer-card.accent,
:root[data-theme="dark"] .plate-style-panel,
:root[data-theme="dark"] .dropzone:hover,
:root[data-theme="dark"] .dropzone.is-dragging,
:root[data-theme="dark"] .preset,
:root[data-theme="dark"] .optimizer-mode,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .material-mode-toggle,
:root[data-theme="dark"] .progress-track,
:root[data-theme="dark"] .print-link {
  background: #202b25;
  color: var(--ink);
}

:root[data-theme="dark"] .plate-style-control,
:root[data-theme="dark"] .mode-guide-tags span,
:root[data-theme="dark"] .color-field,
:root[data-theme="dark"] .upload-preview,
:root[data-theme="dark"] .lithophane-preview-card img {
  background: #121914;
}

:root[data-theme="dark"] .result-preview {
  background:
    linear-gradient(120deg, rgba(78, 133, 177, 0.14), transparent 45%),
    linear-gradient(300deg, rgba(216, 106, 74, 0.14), transparent 46%),
    #121914;
}

:root[data-theme="dark"] .primary-action:hover {
  background: #3dad86;
}

:root[data-theme="dark"] .download-link.is-disabled,
:root[data-theme="dark"] .print-link:disabled,
:root[data-theme="dark"] .primary-action:disabled {
  background: #344039;
  color: #91a097;
}

:root[data-theme="dark"] select {
  color-scheme: dark;
}

:root[data-theme="dark"] .hero-brand-panel img {
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.4));
}

@media (max-width: 1180px) {
  h1 {
    font-size: 4.25rem;
  }

  h2 {
    font-size: 1.85rem;
  }

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

  .hero-section {
    min-height: auto;
  }

  .hero-copy {
    align-self: start;
  }

  .result-panel {
    grid-column: 1 / -1;
  }

  .result-panel {
    grid-row: auto;
  }

  .image-workspace .image-workflow-controls {
    grid-column: 1;
    grid-row: 1;
  }

  .image-workspace > .result-panel {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 20px, 680px);
    padding-top: 10px;
  }

  .site-nav {
    position: static;
    grid-template-columns: 1fr auto;
  }

  .nav-actions {
    align-items: end;
    flex-direction: column;
  }

  .theme-toggle-label {
    display: none;
  }

  .site-nav nav {
    grid-column: 1 / -1;
    justify-content: start;
    overflow-x: auto;
  }

  .hero-section,
  .workspace,
  .offer-grid,
  .section-heading,
  .metrics-grid,
  .feedback-layout,
  .site-footer,
  .site-footer div,
  .site-footer nav,
  .legal-details div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .examples-grid {
    gap: 10px;
  }

  .example-card {
    flex-basis: min(78vw, 320px);
  }

  h1 {
    font-size: 2.85rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .hero-section {
    padding: 24px;
  }

  .hero-brand-panel {
    justify-items: center;
  }

  .hero-copy h1 {
    font-size: 2.85rem;
  }

  .control-grid,
  .download-row,
  .material-head,
  .material-grid {
    grid-template-columns: 1fr;
  }

  .image-workspace .image-workflow-controls,
  .image-workspace > .result-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .image-workspace .preset-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .image-workspace .optimizer-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .light-control {
    grid-template-columns: 1fr;
  }

  .lithophane-workspace,
  .lithophane-preview-tools,
  .frame-side-options {
    grid-template-columns: 1fr;
  }

  .optimization-panel,
  .result-panel,
  .lithophane-result-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .result-preview {
    min-height: 360px;
  }

  .workspace:has(.result-panel.is-expanded) {
    grid-template-columns: 1fr;
  }
}
