/* Poster Press — editorial consumer shell */
:root {
  --paper: #faf7f0;
  --paper-deep: #f1ebdd;
  --ink: #191712;
  --ink-soft: #6b6353;
  --line: #e2dac8;
  --accent: #c96f3b;
  --accent-deep: #a4532a;
  --serif: "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Helvetica Neue", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must always win over any display rule */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(201, 111, 59, 0.10), transparent 60%),
    linear-gradient(var(--paper), var(--paper-deep));
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.nav-right { display: flex; gap: 22px; }

.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--ink); }

.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 28px 80px;
  text-align: center;
}

.hero-kicker {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--accent-deep);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.02em;
}

.hero-sub {
  max-width: 560px;
  margin: 22px auto 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.hero-frame {
  margin-top: 56px;
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
}

.hero-poster {
  width: min(300px, 78vw);
  transition: transform 0.25s ease;
}
.hero-poster:first-child { transform: rotate(-1.4deg); }
.hero-poster:last-child { transform: rotate(1.2deg); }
.hero-poster:hover { transform: rotate(0) scale(1.02); }

.hero-poster img {
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -18px rgba(25, 23, 18, 0.35);
}

.hero-poster figcaption {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  box-shadow: 0 8px 20px -8px rgba(164, 83, 42, 0.55);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(25, 23, 18, 0.05); }

.btn-small { padding: 7px 16px; font-size: 13px; }

/* ---------- Consumer shell sections ---------- */
.shell-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 88px 28px 8px;
  text-align: center;
}

.shell-h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.shell-p {
  margin: 18px auto 0;
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.shell-p.avoid { margin-top: 26px; font-size: 13.5px; }

/* ---------- Studio ---------- */
.studio {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 28px 24px;
}

.studio-head { text-align: center; }

.studio-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.studio-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 860px) {
  .studio-grid { grid-template-columns: 1fr; }
}

.panel {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 12px 32px -24px rgba(25, 23, 18, 0.3);
}

.field { margin-bottom: 24px; }

.field-label {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.field-label .optional { font-weight: 400; color: var(--ink-soft); }

/* dropzone */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--ink-soft);
  border-radius: 12px;
  background:
    repeating-linear-gradient(45deg, rgba(25,23,18,0.015) 0 12px, transparent 12px 24px),
    var(--paper);
  min-height: 220px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-deep);
  background:
    repeating-linear-gradient(45deg, rgba(201,111,59,0.05) 0 12px, transparent 12px 24px),
    var(--paper);
}

.dz-empty { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 20px; }
.dz-empty span { font-size: 12px; opacity: 0.75; }

.dz-icon {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink-soft);
  border-radius: 50%;
  font-size: 20px;
}

.dz-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #efe9db;
}

/* text input */
.text-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--accent-deep); }

/* number stepper */
.num-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.num-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.num-btn:hover { border-color: var(--accent-deep); background: #fff; }

.num-display {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-width: 90px;
  text-align: center;
}

.num-hint { margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }

.btn-generate { width: 100%; margin-top: 4px; font-size: 16px; padding: 14px; }

/* space picker */
.space-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.space-name {
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gen-note {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------- Result panel ---------- */
.panel-result { min-height: 560px; }

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.result-status { font-size: 13px; color: var(--accent-deep); letter-spacing: 0.04em; }

.result-empty, .result-loading, .result-error, .result-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.result-empty p, .result-loading p { color: var(--ink-soft); font-size: 14px; }

/* mini poster schematic */
.re-frame, .loader-poster {
  width: 220px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.re-top { height: 50%; background: linear-gradient(135deg, #d9d2c0, #cfc6ae); }
.re-bottom {
  height: 50%;
  background: #f6f1e4;
  display: grid;
  place-items: center;
  position: relative;
}

.re-figure {
  width: 26px; height: 40px;
  background: var(--accent);
  border-radius: 12px 12px 6px 6px;
  opacity: 0.85;
}

.re-caption {
  position: absolute;
  bottom: 10px;
  width: 60px; height: 5px;
  background: var(--line);
  border-radius: 3px;
}

/* loading shimmer */
.loader-poster .lp-top { height: 50%; background: linear-gradient(100deg, #e4ddca 30%, #efe9d8 50%, #e4ddca 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.loader-poster .lp-bottom { height: 50%; background: #f6f1e4; }
.lp-shimmer { width: 80%; height: 60%; margin: 12% auto 0; border-radius: 8px; background: linear-gradient(100deg, #ece5d2 30%, #f6f1e4 50%, #ece5d2 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.result-error { color: #8c3d22; font-size: 14px; }

.result-done { gap: 18px; }

.result-poster-link { display: block; width: min(340px, 100%); cursor: zoom-in; }

.result-img {
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -20px rgba(25, 23, 18, 0.4);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* ---------- Cases ---------- */
.cases .case-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 720px) {
  .case-grid { grid-template-columns: 1fr; }
}

.case-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -22px rgba(25, 23, 18, 0.4);
}

.case-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.case-card figcaption {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.case-card strong { font-family: var(--serif); letter-spacing: 0.1em; font-size: 14px; }
.case-card span { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Specs ---------- */
.spec-grid {
  margin: 36px auto 0;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .spec-grid { grid-template-columns: 1fr 1fr; }
}

.spec-item {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spec-item strong { font-family: var(--serif); font-size: 15px; letter-spacing: 0.04em; }
.spec-item span { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  padding: 34px 28px 44px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  background: var(--paper-deep);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.88);
  display: grid;
  place-items: center;
  z-index: 50;
  cursor: zoom-out;
  padding: 4vh 4vw;
}
.lightbox img {
  max-height: 92vh;
  max-width: 92vw;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

/* ---------- Auth banner ---------- */
.auth-banner {
  max-width: 720px;
  margin: 26px auto 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
}
.auth-banner .btn { margin-top: 12px; }
