:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #1f332d;
  background: #f9f8f3;
  --ink: #1f332d;
  --muted: #4e6058;
  --green: #21483b;
  --line: #d5dbd0;
  --paper: #fffefa;
  --soft: #edf1e7;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: 0.2em; }
p { margin: 0; line-height: 1.65; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.08; }
h3 { font-size: 1rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a04924; outline-offset: 4px; }
section[id] { scroll-margin-top: 1.5rem; }

.page-width { width: min(1112px, calc(100% - clamp(2rem, 10vw, 8rem))); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus { position: fixed; z-index: 1; top: 1rem; left: 1rem; padding: 0.75rem; background: var(--paper); }
.site-header, .site-footer { background: var(--paper); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner, .site-header nav, .site-footer nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.header-inner { min-height: 76px; padding-block: 0.85rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); font-size: 1.2rem; font-weight: 750; text-decoration: none; }
.brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  border: 2px solid currentColor;
  border-radius: 0.4rem;
  display: grid;
  place-items: center;
}

.brand-mark::before { content: ""; width: 0.7rem; height: 0.7rem; border: 2px solid currentColor; border-radius: 0.14rem; }
.site-header nav a, .site-footer nav a { font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover { text-decoration: underline; }

.button, button, .drop label {
  display: inline-block;
  background: var(--paper);
  border: 1px solid #a2b1a6;
  border-radius: 0.6rem;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.68rem 1rem;
  text-decoration: none;
}

.button, .drop label, #export { background: var(--green); border-color: var(--green); color: white; }
.button:hover, .drop label:hover, #export:hover { background: #18362b; }
.button { padding: 0.85rem 1.35rem; }
.button-small { padding: 0.6rem 0.95rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2.8rem, 7vw, 6rem);
}

.eyebrow { color: var(--green); font-size: 0.86rem; font-weight: 700; letter-spacing: 0.075em; text-transform: uppercase; }
.hero h1 { margin-block: 0.75rem 1.25rem; font-size: clamp(2.7rem, 5.8vw, 5.2rem); line-height: 0.98; }
.hero-description { color: var(--muted); max-width: 33rem; font-size: clamp(1rem, 1.8vw, 1.15rem); }
.hero-action { display: flex; align-items: center; flex-wrap: wrap; gap: 0.85rem 1rem; margin-top: 1.7rem; }
.hero-action p { color: var(--muted); font-size: 0.86rem; }

.hero-demo { margin: 0; padding: 0.9rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 14px 42px #24372d12; min-width: 0; }
.demo-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.05rem 0.15rem 0.75rem; color: var(--muted); font-size: 0.875rem; }
.demo-header span:first-child { color: var(--ink); font-weight: 650; }
.demo-stage { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 0.55rem; background: #e8ebe2; }
.demo-viewport { height: 100%; width: 100%; overflow: hidden; }
.demo-viewport img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-demo:has(#demo-square:checked) .demo-viewport { width: 75%; }
.hero-demo:has(#demo-portrait:checked) .demo-viewport { width: 60%; }
.demo-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; margin: 0.75rem 0 0; padding: 0; border: 0; min-width: 0; }
.demo-options label { position: relative; cursor: pointer; }
.demo-options input { position: absolute; opacity: 0; }
.demo-options span { display: block; padding: 0.5rem 0.2rem; border: 1px solid transparent; border-radius: 0.45rem; text-align: center; font-size: 0.875rem; }
.demo-options small { margin-left: 0.15rem; color: var(--muted); font-size: 0.8rem; }
.demo-options input:checked + span { background: var(--soft); border-color: #c8d1c3; font-weight: 650; }
.demo-options input:focus-visible + span { outline: 3px solid #a04924; outline-offset: 2px; }

.how-section { padding-block: 1.7rem 3rem; border-top: 1px solid var(--line); }
.workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 4vw, 2.5rem); margin: 1.55rem 0 0; padding: 0 0 0 1.2rem; }
.workflow li::marker { color: var(--green); font-weight: 750; }
.workflow p { margin-top: 0.35rem; color: var(--muted); }

.workbench { padding: clamp(1rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: 1.1rem; background: var(--paper); }
.workbench-heading { margin-bottom: 1.25rem; }
.workbench-heading p, .drop p { margin-top: 0.5rem; color: var(--muted); }
.drop { position: relative; padding: clamp(1.5rem, 5vw, 3rem) 1rem; border: 2px dashed #7d9483; border-radius: 0.85rem; background: var(--soft); text-align: center; }
.drop p { font-size: 0.9rem; }
#files { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.drop:focus-within { outline: 3px solid #a04924; outline-offset: 4px; }
.drop:has(#files:disabled) label, button:disabled { opacity: 0.62; cursor: default; }
#messages { margin-block: 0.85rem; color: var(--ink); font-size: 0.95rem; white-space: pre-line; overflow-wrap: anywhere; }
#messages:empty { margin: 0; }
.bar, .export { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding-block: 0.85rem; }
#queue, .controls { display: flex; gap: 0.7rem; flex-wrap: wrap; }
#queue button { max-width: 100%; overflow-wrap: anywhere; }
button[aria-pressed="true"] { background: #dbe9d9; border-color: #557863; }
.bar span, .foot, figcaption { color: var(--muted); font-size: 0.875rem; }
.previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.85rem; }
.previews figure { display: grid; grid-template: 1fr auto / minmax(0, 1fr); place-items: center; gap: 0.55rem; margin: 0; padding: 0.85rem; border-radius: 0.6rem; background: #eeeee7; text-align: center; }
canvas { display: block; max-width: 100%; height: auto; max-height: 180px; }
#land { width: min(240px, 100%); }
#square { width: min(180px, 75%); }
#portrait { width: min(144px, 60%); }
#original { max-width: 100%; min-width: 0; }
#original canvas { background: repeating-conic-gradient(#d7ddd5 0% 25%, #f7f9f5 0% 50%) 0 0 / 16px 16px; }
.controls, .export { align-items: center; border-top: 1px solid var(--line); padding-block: 1rem; }
.controls { margin-top: 1rem; }
.controls label, .export label { display: grid; gap: 0.3rem; font-size: 0.9rem; max-width: 100%; }
input { accent-color: var(--green); }
#prefix { width: min(100%, 18rem); padding: 0.6rem; border: 1px solid #a2b1a6; border-radius: 0.4rem; color: var(--ink); font: inherit; }

.faq { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); gap: clamp(1.25rem, 6vw, 4rem); padding-block: clamp(2.5rem, 7vw, 5rem); }
details { border-bottom: 1px solid var(--line); padding: 0.85rem 0; }
details:first-child { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 650; }
details p { margin-top: 0.55rem; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { padding-block: 1.5rem; align-items: start; }
.footer-inner p { margin-top: 0.65rem; color: var(--muted); font-size: 0.875rem; }
.footer-inner nav { gap: 0.75rem 1.25rem; }

.legal-content { max-width: 720px; padding-block: 3rem 4rem; }
.legal-content h1 { margin-bottom: 1rem; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; }
.legal-content h2 { margin-block: 1.7rem 0.5rem; font-size: 1.65rem; }
.legal-content p + p { margin-top: 0.75rem; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero-demo { width: min(100%, 620px); }
  .hero-break { display: none; }
  .previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 585px) {
  .header-inner { row-gap: 0.7rem; }
  .site-header nav { width: 100%; gap: 0.5rem 0.75rem; justify-content: flex-start; }
  .site-header nav .button { margin-left: auto; }
  .workflow, .faq { grid-template-columns: 1fr; }
  .demo-options small { display: none; }
  .previews { gap: 0.45rem; }
  .previews figure { padding: 0.5rem; }
}
