:root {
  --ink: #181818;
  --muted: #6a6b63;
  --paper: #f5f5ee;
  --paper-deep: #e9e9df;
  --acid: #e9ff3b;
  --line: #c8c9be;
  --white: #fffef9;
  --shadow: 0 18px 40px rgba(21, 22, 17, .08);
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body { margin: 0; min-height: 100vh; }

button, input { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, summary:focus-visible, .dropzone:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.page-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 25px 0 20px;
}

.wordmark { color: var(--ink); font-size: 19px; font-weight: 800; letter-spacing: -.06em; text-decoration: none; }
.wordmark-dot { background: var(--acid); border: 2px solid var(--ink); border-radius: 50%; display: inline-block; height: 12px; margin: 0 5px 0 1px; width: 12px; }
.header-note { color: var(--muted); font-family: Georgia, serif; font-size: 13px; font-style: italic; margin: 0; }
.header-note span { color: var(--ink); font-family: Arial, sans-serif; font-style: normal; font-weight: 700; margin-left: 7px; }

.intro { max-width: 720px; padding: 78px 0 63px; }
.eyebrow, .section-kicker { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow span { color: var(--ink); display: inline-block; font-size: 16px; margin-right: 7px; vertical-align: -1px; }
h1 { font-size: clamp(56px, 8.3vw, 118px); letter-spacing: -.09em; line-height: .84; margin: 28px 0 26px; max-width: 720px; }
h1 em { color: var(--ink); font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: -.09em; }
.intro-copy { color: var(--muted); font-family: Georgia, 'Times New Roman', serif; font-size: 18px; line-height: 1.45; margin: 0; max-width: 395px; }

.editor { align-items: start; display: grid; gap: 36px; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); padding-bottom: 100px; }
.preview-column { min-width: 0; }
.preview-topline { align-items: end; display: flex; justify-content: space-between; margin-bottom: 13px; }
.preview-title { font-size: 14px; font-weight: 800; letter-spacing: -.02em; margin: 7px 0 0; }
.status { color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.status.is-busy { color: var(--ink); }
.status.is-error { color: #a8311e; }

.canvas-shell {
  align-items: center;
  background-color: #dedfd5;
  background-image: linear-gradient(45deg, rgba(255,255,255,.45) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.45) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.45) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.45) 75%);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
  border: 1px solid var(--ink);
  display: flex;
  justify-content: center;
  min-height: 400px;
  overflow: hidden;
  padding: 28px;
  position: relative;
}
.canvas-shell::before { border: 1px solid rgba(24,24,24,.14); content: ''; inset: 12px; pointer-events: none; position: absolute; }
#editorCanvas { display: block; height: auto; max-height: min(68vh, 720px); max-width: 100%; object-fit: contain; position: relative; width: auto; z-index: 1; }
.preview-callout { align-items: center; color: var(--muted); display: flex; font-size: 9px; gap: 7px; left: 27px; letter-spacing: .08em; position: absolute; text-transform: uppercase; top: 19px; z-index: 2; }
.callout-line { background: var(--muted); display: block; height: 1px; width: 22px; }
.preview-footer { align-items: center; color: var(--muted); display: flex; font-family: monospace; font-size: 10px; justify-content: space-between; letter-spacing: .01em; padding-top: 12px; text-transform: uppercase; }
.preview-footer p { margin: 0; }
.preview-footer p span { color: var(--ink); padding: 0 4px; }
.file-kind { align-items: center; display: flex; gap: 6px; }
.alpha-chip { background: var(--acid); border: 1px solid var(--ink); color: var(--ink) !important; font-family: Georgia, serif; font-size: 12px; line-height: 17px; padding: 0 4px !important; }

.control-column { display: flex; flex-direction: column; gap: 12px; }
.control-card { background: var(--white); border: 1px solid var(--ink); box-shadow: var(--shadow); padding: 23px 22px; }
.upload-card { background: var(--acid); }
.card-heading h3 { font-size: 25px; letter-spacing: -.065em; line-height: .97; margin: 12px 0 21px; }
.card-heading.compact h3 { margin-bottom: 22px; }
.dropzone { align-items: flex-start; background: rgba(255,255,255,.55); border: 1px dashed var(--ink); display: flex; flex-direction: column; padding: 17px 16px 15px; text-align: left; transition: background .18s ease, transform .18s ease; width: 100%; }
.dropzone:hover, .dropzone.is-dragging { background: var(--white); transform: translateY(-2px); }
.dropzone:disabled { cursor: wait; opacity: .72; transform: none; }
.drop-icon { font-size: 25px; font-weight: 300; line-height: .8; margin-bottom: 13px; }
.drop-main { font-size: 14px; font-weight: 800; }
.drop-sub { color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; margin-top: 5px; }
#fileInput { height: 1px; opacity: 0; position: absolute; width: 1px; }
.source-name { color: rgba(24,24,24,.72); font-family: monospace; font-size: 10px; line-height: 1.4; margin: 13px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.setting-group { border: 0; margin: 0 0 19px; padding: 0; }
.setting-group legend { font-size: 11px; font-weight: 800; margin-bottom: 8px; padding: 0; width: 100%; }
.legend-note { color: var(--muted); font-family: Georgia, serif; font-size: 11px; font-style: italic; font-weight: 400; margin-left: 3px; }
.segmented { border: 1px solid var(--line); display: grid; }
.segmented.two-up { grid-template-columns: 1fr 1fr; }
.segmented label { min-width: 0; position: relative; }
.segmented label + label { border-left: 1px solid var(--line); }
.segmented input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.segmented label span { cursor: pointer; display: block; font-size: 11px; padding: 10px 8px; text-align: center; }
.segmented label:hover span { background: var(--paper); }
.segmented input:checked + span { background: var(--ink); color: var(--white); }
.fine-tune { border-top: 1px solid var(--line); padding-top: 15px; }
.fine-tune summary { cursor: pointer; font-size: 11px; font-weight: 800; list-style: none; }
.fine-tune summary::-webkit-details-marker { display: none; }
.fine-tune summary span { float: right; font-size: 16px; font-weight: 400; line-height: 10px; transition: transform .18s ease; }
.fine-tune:not([open]) summary span { transform: rotate(-90deg); }
.range-setting { margin-top: 17px; }
.range-label { display: flex; font-size: 11px; justify-content: space-between; margin-bottom: 9px; }
.range-label output { color: var(--muted); font-family: monospace; font-size: 10px; }
input[type='range'] { accent-color: var(--ink); cursor: pointer; height: 16px; margin: 0; width: 100%; }
.settings-help { border-top: 1px solid var(--line); color: var(--muted); font-family: Georgia, 'Times New Roman', serif; font-size: 11px; line-height: 1.45; margin: 18px 0 0; padding-top: 14px; }

.workflow { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); padding: 15px 0 14px; }
.workflow-heading { align-items: baseline; display: flex; justify-content: space-between; }
.workflow-heading h3 { font-size: 15px; letter-spacing: -.04em; margin: 0; }
.workflow-steps { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 14px 0 0; padding: 0; }
.workflow-step { align-items: start; display: grid; gap: 7px; grid-template-columns: 21px minmax(0, 1fr); opacity: .48; }
.workflow-step.is-current { opacity: 1; }
.workflow-number { align-items: center; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 50%; display: flex; font-family: monospace; font-size: 10px; height: 21px; justify-content: center; width: 21px; }
.workflow-step.is-current .workflow-number { background: var(--acid); border-color: var(--ink); }
.workflow-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.workflow-copy strong { font-size: 10px; line-height: 1.1; }
.workflow-copy small { color: var(--muted); font-family: Georgia, 'Times New Roman', serif; font-size: 10px; line-height: 1.2; }

.action-row { display: flex; gap: 10px; }
.button, .download-button { align-items: center; border: 1px solid var(--ink); display: inline-flex; font-size: 11px; font-weight: 800; justify-content: space-between; letter-spacing: .01em; min-height: 45px; padding: 0 15px; transition: background .18s ease, color .18s ease, transform .18s ease; }
.button:hover, .download-button:hover { transform: translateY(-2px); }
.button-quiet { background: transparent; color: var(--ink); flex: .4; }
.button-quiet:hover { background: var(--white); }
.button-dark { background: var(--ink); color: var(--white); flex: 1; }
.button-dark:hover { background: #36372e; }
.button:disabled { cursor: wait; opacity: .65; }
.button:disabled:hover { background: transparent; transform: none; }
.button-dark:disabled:hover { background: var(--ink); }
.button-dark span:last-child, .download-button span:last-child { font-size: 18px; font-weight: 400; line-height: 0; }
.download-button { background: var(--acid); width: 100%; }
.download-button:hover { background: #f0ff70; }
.download-button:disabled { background: var(--paper-deep); border-color: var(--line); color: var(--muted); cursor: not-allowed; opacity: .9; }
.download-button:disabled:hover { background: var(--paper-deep); transform: none; }
.download-help { color: var(--muted); font-family: Georgia, 'Times New Roman', serif; font-size: 11px; font-style: italic; margin: -3px 0 0; text-align: center; }
.privacy-note { color: var(--muted); font-family: Georgia, serif; font-size: 11px; font-style: italic; margin: 4px 0 0; text-align: center; }
.privacy-note span { color: var(--ink); font-family: Arial, sans-serif; font-size: 16px; font-style: normal; vertical-align: -2px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; font-family: monospace; font-size: 10px; justify-content: space-between; letter-spacing: .04em; padding: 17px 0 24px; text-transform: uppercase; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

@media (max-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr) minmax(285px, .72fr); gap: 22px; }
  .control-card { padding: 19px 17px; }
  .card-heading h3 { font-size: 21px; }
  .canvas-shell { min-height: 330px; padding: 22px; }
}

@media (max-width: 700px) {
  .page-shell { width: min(100% - 28px, 560px); }
  .site-header { padding-top: 18px; }
  .intro { padding: 58px 0 45px; }
  h1 { font-size: clamp(57px, 16vw, 88px); }
  .intro-copy { font-size: 16px; }
  .editor { display: block; padding-bottom: 62px; }
  .control-column { margin-top: 30px; }
  .canvas-shell { min-height: 285px; padding: 19px; }
  .preview-callout { left: 19px; top: 14px; }
  .site-footer { flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
