:root {
  --ink: #181a17;
  --paper: #f5f1e7;
  --panel: #fffdf7;
  --blue: #2457f5;
  --lime: #c8f552;
  --yellow: #ffd94d;
  --orange: #f35e49;
  --muted: #62665f;
  --line: #cbc7bd;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(1060px, calc(100% - 36px)); margin: auto; }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

header { position: sticky; top: 0; z-index: 30; border-bottom: 2px solid var(--ink); background: rgba(245, 241, 231, .94); backdrop-filter: blur(12px); }
.nav { display: flex; min-height: 66px; align-items: center; justify-content: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 19px; font-weight: 950; letter-spacing: -.03em; text-decoration: none; }
.mark { display: grid; width: 36px; height: 34px; place-items: center; border: 2px solid var(--ink); border-radius: 48% 52% 45% 55%; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-weight: 950; transform: rotate(-6deg); }
.nav nav { display: flex; align-items: center; gap: 18px; }
.nav nav a { color: var(--ink); font-size: 14px; font-weight: 850; text-decoration: none; }
.nav-pill { padding: 8px 13px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; }

.hero { display: flex; flex-direction: column; align-items: center; padding: 70px 0 42px; text-align: center; }
.route-stamp { padding: 7px 12px; border: 2px solid var(--ink); background: var(--orange); color: #fff; font-size: 12px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-1deg); }
h1 { margin: 24px auto; font-size: clamp(55px, 8.6vw, 94px); line-height: .9; letter-spacing: -.075em; }
h1 em { position: relative; color: var(--blue); font-family: Georgia, serif; font-weight: 400; }
h1 em::after { content: ""; position: absolute; right: -2%; bottom: -6px; left: 0; z-index: -1; height: 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--lime); transform: rotate(-1deg); }
.dek { max-width: 720px; margin: 0; color: #41443f; font-size: clamp(18px, 2vw, 22px); }
.maker-note { display: flex; align-items: center; gap: 16px; width: min(760px, 100%); margin-top: 30px; padding: 18px 22px; border: 2px solid var(--ink); border-radius: 22px 22px 28px 22px; background: #fff; box-shadow: 6px 6px 0 var(--ink); text-align: left; transform: rotate(.2deg); }
.maker-note strong { display: block; margin-bottom: 3px; }
.maker-note p { margin: 0; color: var(--muted); }
.maker-badge { flex: 0 0 52px; display: grid; height: 50px; place-items: center; border: 2px solid var(--ink); border-radius: 38% 62% 47% 53%; background: var(--lime); font-family: Georgia, serif; font-style: italic; font-weight: 900; transform: rotate(-7deg); }

.workbench { padding-bottom: 86px; }
.privacy-banner { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; padding: 16px 20px; border: 2px solid var(--ink); border-radius: 24px; background: var(--lime); text-align: center; }
.privacy-banner p { margin: 2px 0 0; color: #3f4632; font-size: 13px; }
.privacy-dot { flex: 0 0 20px; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: var(--blue); box-shadow: 3px 3px 0 var(--ink); }
.empty-state, .editor { border: 2px solid var(--ink); border-radius: 32px; background: var(--panel); box-shadow: 10px 10px 0 var(--ink); overflow: hidden; }
.dropzone { display: grid; min-height: 410px; place-items: center; margin: 22px; padding: 42px 24px; border: 2px dashed var(--ink); border-radius: 25px; background: linear-gradient(145deg, rgba(36,87,245,.08), rgba(200,245,82,.13)); cursor: pointer; text-align: center; transition: background .16s ease, transform .16s ease; }
.dropzone:hover, .dropzone.drag { background: linear-gradient(145deg, rgba(36,87,245,.15), rgba(200,245,82,.22)); transform: translateY(-2px); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-shape { display: block; width: 104px; height: 80px; margin: 0 auto 20px; border: 2px solid var(--ink); border-radius: 31px; background: var(--blue); box-shadow: 7px 7px 0 var(--ink); transform: rotate(-5deg); }
.dropzone h2 { margin: 0 0 7px; font-size: clamp(29px, 5vw, 46px); letter-spacing: -.055em; }
.dropzone p { margin: 0 0 21px; color: var(--muted); }
.dropzone small { display: block; margin-top: 14px; color: var(--muted); }

.button { display: inline-flex; min-height: 47px; align-items: center; justify-content: center; padding: 10px 19px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 900; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
.button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button.primary { background: var(--ink); color: #fff; }
.button.secondary { background: #fff; }

.editor-topline { display: flex; align-items: center; justify-content: center; gap: 34px; padding: 25px 28px; border-bottom: 2px solid var(--ink); text-align: center; }
.editor-topline h2, .control-heading h2, .export-bar h2 { margin: 1px 0 2px; font-size: 26px; letter-spacing: -.04em; }
.editor-topline p, .control-heading p, .export-bar p { margin: 0; color: var(--muted); font-size: 13px; }
.step { display: inline-block; padding: 3px 7px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 11px; font-weight: 950; }
.top-actions { display: flex; gap: 9px; }

.preview-wrap { display: grid; justify-items: center; padding: 26px 28px 18px; }
.preview-stage { display: grid; width: min(760px, 100%); min-height: 380px; place-items: center; padding: 28px; border: 2px solid var(--ink); border-radius: 26px; overflow: hidden; background-color: #fff; background-image: linear-gradient(45deg,#dedede 25%,transparent 25%),linear-gradient(-45deg,#dedede 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#dedede 75%),linear-gradient(-45deg,transparent 75%,#dedede 75%); background-position: 0 0,0 10px,10px -10px,-10px 0; background-size: 20px 20px; }
#previewCanvas { display: block; max-width: 100%; max-height: 570px; filter: drop-shadow(0 14px 20px rgba(24,26,23,.22)); user-select: none; -webkit-user-drag: none; }
#previewCanvas.draggable { cursor: grab; touch-action: none; }
#previewCanvas.dragging { cursor: grabbing; }
.frame-controls { width: min(760px, 100%); margin-top: 14px; padding: 17px 19px; border: 2px solid var(--ink); border-radius: 22px; background: #fff; text-align: left; }
.frame-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.frame-heading strong, .frame-heading span { display: block; }
.frame-heading span { margin-top: 1px; color: var(--muted); font-size: 12px; }
.recenter-button { padding: 6px 11px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 12px; font-weight: 900; cursor: pointer; }
.recenter-button:disabled { opacity: .45; cursor: not-allowed; }
.zoom-label { display: flex; justify-content: space-between; margin-top: 15px; font-weight: 900; }
.zoom-label output { color: var(--blue); }
.zoom-slider { width: 100%; accent-color: var(--blue); }
.frame-controls p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.compare-button { margin-top: 13px; padding: 7px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 850; cursor: pointer; }
.compare-button:active, .compare-button.comparing { background: var(--yellow); transform: translateY(1px); }

.controls { border-top: 2px solid var(--ink); }
.control-section { padding: 30px 28px; text-align: center; }
.control-heading { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 800px; margin: auto; gap: 10px; }
.preset { min-height: 74px; padding: 11px; border: 2px solid var(--ink); border-radius: 20px; background: #fff; font-weight: 950; cursor: pointer; transition: .14s ease; }
.preset small { display: block; margin-top: 2px; color: var(--muted); font-weight: 800; }
.preset:hover, .preset.active { background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); transform: translate(-1px,-1px); }
.radius-control { max-width: 800px; margin: 20px auto; padding: 20px; border: 2px solid var(--ink); border-radius: 22px; background: #fff; }
.radius-control label { display: flex; justify-content: space-between; font-weight: 900; }
.radius-control output { color: var(--blue); }
.radius-control input, .export-slider input { width: 100%; accent-color: var(--blue); }
.radius-control p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.style-picker { display: grid; grid-template-columns: 1fr 1fr; max-width: 800px; margin: auto; gap: 10px; }
.style-option { min-height: 82px; padding: 13px; border: 2px solid var(--ink); border-radius: 24px; background: #fff; cursor: pointer; }
.style-option strong, .style-option span { display: block; }
.style-option span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.style-option.active { background: var(--lime); box-shadow: 4px 4px 0 var(--ink); }
.memory-note { max-width: 800px; margin: 17px auto 0; padding: 12px 15px; border: 1.5px dashed var(--ink); border-radius: 18px; background: #fffaf0; color: var(--muted); font-size: 13px; }
.memory-note strong { color: var(--ink); }

.advanced { border-top: 2px solid var(--ink); background: #efede5; }
.advanced summary { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 22px; cursor: pointer; font-weight: 950; list-style: none; text-align: center; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; font-size: 22px; }
.advanced[open] summary::after { content: "−"; }
.advanced summary span { color: var(--muted); font-size: 12px; font-weight: 750; }
.advanced fieldset { max-width: 800px; margin: 0 auto 25px; padding: 19px; border: 2px solid var(--ink); border-radius: 22px; background: #fff; text-align: center; }
.advanced legend { padding: 0 8px; font-weight: 950; }
.format-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.format { min-height: 45px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 950; cursor: pointer; }
.format.active { background: var(--blue); color: #fff; }
.export-slider { display: grid; margin-top: 15px; gap: 5px; font-weight: 900; }
.color-label { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px; font-weight: 900; }
.color-label input { width: 48px; height: 36px; padding: 2px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
#formatNote { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.reset-box { max-width: 620px; margin: 19px auto 0; padding-top: 17px; border-top: 1.5px dashed var(--line); }
.reset-button { padding: 8px 13px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 900; cursor: pointer; }
.reset-button:hover { background: #f2eee4; }
.reset-box p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.export-bar { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 26px 28px; border-top: 2px solid var(--ink); background: var(--yellow); text-align: center; }
.export-actions { display: flex; gap: 9px; }

.section-kicker { font-size: 12px; font-weight: 950; letter-spacing: .15em; text-transform: uppercase; }
.guide, .how, .faq { padding: 76px 0; text-align: center; }
.guide h2, .how h2, .faq h2 { margin: 10px auto 35px; font-size: clamp(42px, 6vw, 66px); line-height: .95; letter-spacing: -.06em; }
.guide-grid, .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guide-grid article, .steps article { padding: 25px; border: 2px solid var(--ink); border-radius: 26px; background: #fff; }
.guide-grid article:nth-child(2), .steps article:nth-child(2) { background: var(--lime); transform: rotate(-.35deg); }
.guide-grid article:nth-child(3), .steps article:nth-child(3) { background: #dfe7ff; transform: rotate(.3deg); }
.guide-grid h3, .steps h3 { margin: 13px 0 6px; font-size: 21px; }
.guide-grid p, .steps p { margin: 0; color: #4d5048; }
.guide-shape { display: block; width: 74px; height: 58px; margin: auto; border: 2px solid var(--ink); background: var(--blue); }
.smooth-shape { border-radius: 24px; }
.classic-shape { border-radius: 13px; background: var(--yellow); }
.transparent-shape { border-radius: 50%; background: repeating-conic-gradient(#ddd 0 25%,#fff 0 50%) 50% / 12px 12px; }
.honest-note { max-width: 820px; margin: 24px auto 0; padding: 20px; border: 2px dashed var(--ink); border-radius: 20px; background: var(--panel); }
.how { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: #fff9e7; }
.steps b { display: inline-grid; width: 45px; height: 42px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--orange); color: #fff; }
.faq-list { display: grid; max-width: 830px; margin: auto; gap: 11px; text-align: left; }
.faq details { padding: 17px 20px; border: 2px solid var(--ink); border-radius: 18px; background: #fff; }
.faq summary { cursor: pointer; font-weight: 950; }
.faq p { margin: 10px 0 0; color: var(--muted); }

footer { padding: 32px 0; border-top: 2px solid var(--ink); text-align: center; }
footer .brand { justify-content: center; }
footer p { color: var(--muted); font-size: 13px; }
footer a { color: inherit; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(360px, calc(100% - 40px)); padding: 13px 17px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-weight: 850; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
:focus-visible { outline: 4px solid rgba(36,87,245,.36); outline-offset: 3px; }

@media (max-width: 760px) {
  .guide-grid, .steps { grid-template-columns: 1fr; }
  .guide-grid article, .steps article { width: 100%; max-width: 620px; margin: auto; }
  .editor-topline, .export-bar { flex-direction: column; gap: 16px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1060px); }
  .nav { min-height: 58px; gap: 14px; }
  .nav nav a:not(.nav-pill) { display: none; }
  .brand { font-size: 17px; }.mark { width: 34px; height: 32px; }
  .hero { padding-top: 50px; }
  h1 { font-size: 50px; }
  .maker-note { align-items: flex-start; padding: 16px; }
  .privacy-banner { align-items: flex-start; text-align: left; }
  .empty-state, .editor { border-radius: 24px; box-shadow: 6px 7px 0 var(--ink); }
  .dropzone { min-height: 350px; margin: 12px; padding: 30px 15px; }
  .editor-topline, .preview-wrap, .control-section, .export-bar { padding-right: 14px; padding-left: 14px; }
  .preview-stage { min-height: 270px; padding: 14px; border-radius: 20px; }
  #previewCanvas { max-height: 430px; }
  .frame-controls { padding: 15px; border-radius: 18px; }
  .preset-row { grid-template-columns: 1fr 1fr; }
  .style-picker { grid-template-columns: 1fr; }
  .advanced summary span { display: none; }
  .advanced fieldset { margin-right: 14px; margin-left: 14px; }
  .export-actions { width: 100%; flex-direction: column; }
  .export-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
