@font-face {
  font-family: "Everyday Sans";
  src: url("assets/EverydaySans-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --paper-scale: 18px; /* screen pixels per printed inch */
  --paper-w: calc(24 * var(--paper-scale));
  --paper-h: calc(36 * var(--paper-scale));
  --panel: #ffffff;
  --ink: #161616;
  --muted: #6b6b6b;
  --line: #d9d9d9;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Everyday Sans", Arial, sans-serif;
  color: var(--ink);
  background: #f4f4f1;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: #161616;
  color: white;
}
.app-header h1 { margin: 0 0 8px; font-size: 28px; }
.app-header p { margin: 0; color: #d6d6d6; max-width: 900px; }

.workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  padding: 22px;
}
.controls { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 3px 18px rgba(0,0,0,.05);
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }
label { display: block; margin: 12px 0; font-size: 14px; color: #2c2c2c; }
input, select, textarea, button {
  width: 100%;
  font: inherit;
  border-radius: 10px;
}
input, select, textarea {
  border: 1px solid var(--line);
  padding: 10px 12px;
  margin-top: 6px;
  background: #fff;
}
input[type="color"] { height: 44px; padding: 4px; }
button {
  border: 0;
  padding: 11px 12px;
  background: #e8e8e8;
  cursor: pointer;
}
button:hover { filter: brightness(.96); }
.primary { background: #1f6feb; color: white; }
.secondary { background: #6f42c1; color: white; }
.danger { background: #d1242f; color: white; }
.button-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.35; }
.size-grid { display: grid; gap: 10px; }
.size-option {
  border: 2px solid var(--line);
  background: #fafafa;
  text-align: left;
}
.size-option.active { border-color: #1f6feb; background: #eef5ff; }

.preview-area { overflow-x: auto; }
.preview-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.preview-card h2 { margin: 0 0 14px; font-size: 17px; }
.preview-banner { transform-origin: top left; }

.sheet-wrap { display: inline-block; }
.sheet-label { margin: 0 0 8px; color: var(--muted); }
.poster-sheet {
  position: relative;
  width: var(--paper-w);
  height: var(--paper-h);
  background: white;
  border: 1px solid #999;
  box-shadow: 0 8px 30px rgba(0,0,0,.16);
  overflow: hidden;
}
.poster-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(0,0,0,.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(0,0,0,.05) 1px, transparent 1px);
  background-size: var(--paper-scale) var(--paper-scale);
}
.banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2b2b2b, #666);
  border: 1px dashed rgba(0,0,0,.35);
}
.banner-content {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  transform-origin: top left;
  background: linear-gradient(135deg, #2b2b2b, #666);
}
.banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: none;
}
.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
}
.banner-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: .18in .32in;
  color: white;
  text-align: center;
  text-shadow: 0 2px 9px rgba(0,0,0,.45);
}
.banner-headline {
  font-size: 42px;
  letter-spacing: .035em;
  line-height: .92;
  text-transform: uppercase;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.sheet-banner { position: absolute; }
.banner-actions {
  position: absolute;
  z-index: 5;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
}
.banner-actions button { width: auto; padding: 5px 8px; border-radius: 7px; font-size: 11px; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; }
}

@page {
  size: 24in 36in;
  margin: 0;
}
@media print {
  :root { --paper-scale: 1in; }
  html, body { width: 24in; height: 36in; margin: 0; background: white; }
  .no-print { display: none !important; }
  .workspace, .preview-area, .sheet-wrap { display: block; padding: 0; margin: 0; overflow: visible; }
  .poster-sheet {
    width: 24in;
    height: 36in;
    border: 0;
    box-shadow: none;
  }
  .poster-sheet::after { display: none; }
  .sheet-banner { border: .01in dashed rgba(0,0,0,.45); }
  .banner-content { transform-origin: top left; }
}
