@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Oswald:wght@500;600;700&family=Playfair+Display:ital,wght@1,700&display=swap');

:root {
  --paper: #f4ead8;
  --paper-light: #fbf6ec;
  --ink: #101820;
  --muted: #665f55;
  --coral: #ee4b48;
  --sun: #f3be3d;
  --cyan: #20a9bb;
  --line: rgba(16, 24, 32, .22);
  --ease: cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  background-image: radial-gradient(rgba(16, 24, 32, .055) .65px, transparent .65px);
  background-size: 4px 4px;
}
button, input, textarea, select { font: inherit; }
button, a { touch-action: manipulation; }
.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.prototype-ribbon { background: var(--ink); color: var(--paper); text-align: center; padding: 7px 16px; font: 600 10px/1.2 'DM Sans'; letter-spacing: .16em; }
.site-head { height: 88px; border-bottom: 1px solid var(--ink); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.wordmark { display: flex; flex-direction: column; width: max-content; color: var(--ink); text-decoration: none; font: 600 13px/1 'Oswald'; letter-spacing: .18em; }
.wordmark strong { font-size: 26px; letter-spacing: -.02em; }
.edition { text-align: center; font: 600 10px/1.25 'DM Sans'; letter-spacing: .16em; }
.mini-action { justify-self: end; color: var(--ink); font-weight: 700; text-underline-offset: 5px; }

.hero { position: relative; min-height: 740px; padding: 86px 0 110px; overflow: hidden; }
.eyebrow, .section-number { font: 700 11px/1 'DM Sans'; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow::before, .section-number::before { content: '●'; color: var(--coral); margin-right: 9px; }
.hero h1 { font: 600 clamp(66px, 10vw, 136px)/.84 'Oswald'; letter-spacing: -.055em; text-transform: uppercase; margin: 28px 0 30px; max-width: 920px; }
.hero h1 em { font-family: 'Playfair Display', serif; font-weight: 700; text-transform: none; color: var(--coral); letter-spacing: -.04em; }
.hero-copy { max-width: 520px; font-size: 20px; margin: 0 0 34px; }
.primary-button, .secondary-button, .text-button, .remove-photo { border: 0; cursor: pointer; }
.primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; background: var(--ink); color: #fff; text-decoration: none; padding: 18px 22px; min-height: 58px; font-weight: 700; box-shadow: 5px 5px 0 var(--coral); transition: transform 140ms var(--ease), box-shadow 140ms var(--ease); }
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--coral); }
.primary-button:active { transform: scale(.98); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.hero-stamp { position: absolute; right: 6%; top: 160px; width: 220px; height: 220px; border: 3px solid var(--ink); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(9deg); background: var(--sun); box-shadow: 8px 8px 0 var(--ink); }
.hero-stamp span { font: 700 11px 'DM Sans'; letter-spacing: .15em; }
.hero-stamp strong { font: 700 46px/.95 'Oswald'; }
.ticker { overflow: hidden; background: var(--coral); border-block: 2px solid var(--ink); white-space: nowrap; }
.ticker div { padding: 15px 0; font: 700 16px 'Oswald'; letter-spacing: .1em; animation: ticker 24s linear infinite; }
@keyframes ticker { to { transform: translateX(-50%); } }

.roles { padding: 110px 0 130px; }
.section-intro { display: grid; grid-template-columns: 160px 1fr 300px; gap: 30px; align-items: start; margin-bottom: 54px; }
.section-intro h2, .maker h2, .how h2 { font: 600 clamp(44px, 6vw, 78px)/.95 'Oswald'; letter-spacing: -.04em; text-transform: uppercase; margin: 0; }
.section-intro p:last-child { margin: 0; font-size: 16px; }
.role-story { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.role-story > div { min-height: 210px; padding: 28px; border-right: 1px solid var(--ink); background: var(--paper-light); }
.role-story > div:last-child { border-right: 0; }
.role-story span { font: 700 11px 'DM Sans'; letter-spacing: .16em; color: var(--coral); }
.role-story strong { display: block; font: 600 30px/1 'Oswald'; text-transform: uppercase; margin: 42px 0 12px; }
.role-story p { margin: 0; color: var(--muted); }

.maker { background: var(--ink); color: var(--paper); padding: 100px 0; }
.maker-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .85fr); gap: 80px; align-items: start; }
.maker .section-number::before { color: var(--sun); }
.maker-note { color: #cfc6b8; font-size: 18px; margin: 20px 0 50px; }
fieldset { border: 0; padding: 0; margin: 0 0 48px; }
legend { width: 100%; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255, 255, 255, .25); padding-bottom: 14px; margin-bottom: 22px; font: 700 19px 'DM Sans'; }
legend span { display: grid; place-items: center; width: 30px; height: 30px; background: var(--sun); color: var(--ink); border-radius: 50%; font-size: 13px; }
.two-col, .photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid rgba(255, 255, 255, .35); border-radius: 0; background: #1d2730; color: #fff; padding: 14px 15px; outline: none; transition: border-color 140ms, box-shadow 140ms; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(243, 190, 61, .18); }
.optional { color: #8f989f; font-weight: 500; }
.field-help { font-size: 12px; color: #aeb4b9; margin: 0 0 16px; }
.photo-pair { margin-bottom: 14px; }
.photo-slot { min-width: 0; }
.upload-zone { min-height: 132px; border: 1px dashed rgba(255, 255, 255, .55); padding: 22px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; cursor: pointer; background: rgba(255, 255, 255, .035); transition: background 150ms, border-color 150ms; }
.upload-zone:hover, .upload-zone.dragging { background: rgba(32, 169, 187, .1); border-color: var(--cyan); }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; border: 0; }
.upload-zone small { grid-column: 2; color: #aeb4b9; font-weight: 400; }
.upload-icon { grid-row: 1/3; font-size: 28px; color: var(--cyan); }
.photo-preview { margin: 0; padding: 10px; background: #1d2730; border: 1px solid rgba(255, 255, 255, .25); }
.photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 1px solid rgba(255, 255, 255, .5); }
.photo-preview figcaption { margin: 8px 0; font-size: 10px; color: #abb1b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remove-photo { width: 100%; border: 1px solid var(--coral); background: transparent; color: #fff; padding: 9px; font: 700 11px 'DM Sans'; }
.remove-photo:hover { background: var(--coral); }
.check-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; margin-top: 18px; font-size: 12px; font-weight: 500; color: #bcc1c4; }
.check-row input { width: 18px; height: 18px; accent-color: var(--sun); margin: 1px 0 0; flex: 0 0 auto; }
.tone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tone-grid label { display: block; cursor: pointer; }
.tone-grid input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; border: 0; }
.tone-grid span { display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, .3); padding: 14px 15px; transition: all 150ms; }
.tone-grid small { color: #929ca3; font-weight: 400; }
.tone-grid input:checked + span { background: var(--sun); color: var(--ink); border-color: var(--sun); box-shadow: 4px 4px 0 var(--coral); }
.tone-grid input:checked + span small { color: #403a2a; }
.form-actions { display: grid; gap: 18px; }
.form-actions .primary-button { width: 100%; }
.text-button { background: transparent; color: var(--paper); text-decoration: underline; text-underline-offset: 5px; }
.api-note, .generation-status { font-size: 12px; color: #aeb4b9; }
.generation-status:not(:empty) { border-left: 3px solid var(--sun); padding: 9px 12px; margin-bottom: 15px; background: rgba(255, 255, 255, .05); }

.preview-panel { position: sticky; top: 28px; }
.preview-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.preview-head span { font: 700 9px 'DM Sans'; letter-spacing: .16em; }
.preview-head h2 { font-size: 24px; margin: 3px 0 0; }
.model-chip { border: 1px solid currentColor; padding: 7px 9px; color: var(--sun); text-align: center; }
.canvas-shell { background: #252f37; padding: 14px; box-shadow: 0 28px 80px rgba(0, 0, 0, .42); }
canvas { display: block; width: 100%; height: auto; background: var(--paper-light); }
.editor-controls { background: #141c23; padding: 20px; border-top: 1px solid rgba(255, 255, 255, .15); }
.editor-controls label { margin-bottom: 14px; }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.secondary-button { background: var(--paper); color: var(--ink); padding: 14px; font-weight: 700; }
.preview-actions .primary-button { min-height: auto; padding: 14px; box-shadow: 4px 4px 0 var(--coral); gap: 8px; }
.compact { margin-top: 15px; }
.submit-status { font-size: 12px; margin-top: 10px; color: var(--sun); }

.how { padding: 120px 0; }
.how h2 { margin: 22px 0 60px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--ink); }
.how-grid > div { padding: 32px 30px; min-height: 220px; border-right: 1px solid var(--ink); }
.how-grid > div:last-child { border: 0; }
.how-grid span { font: 700 12px 'DM Sans'; color: var(--coral); }
.how-grid strong { display: block; font: 600 28px/1.05 'Oswald'; text-transform: uppercase; margin: 38px 0 12px; }
.how-grid p { margin: 0; color: var(--muted); }
footer { background: var(--coral); border-top: 2px solid var(--ink); padding: 34px 0; }
footer .wrap { display: flex; justify-content: space-between; align-items: end; }
footer strong { font: 700 48px/.9 'Oswald'; }
footer p { max-width: 390px; margin: 0; text-align: right; font-size: 13px; }

@media (max-width: 900px) {
  .hero-stamp { width: 160px; height: 160px; right: 2%; top: 250px; }
  .hero-stamp strong { font-size: 34px; }
  .section-intro { grid-template-columns: 1fr; }
  .section-intro p:last-child { max-width: 500px; }
  .role-story, .maker-grid, .how-grid { grid-template-columns: 1fr; }
  .role-story > div, .how-grid > div { border-right: 0; border-bottom: 1px solid var(--ink); min-height: auto; }
  .role-story > div:last-child, .how-grid > div:last-child { border-bottom: 0; }
  .role-story strong { margin-top: 22px; }
  .preview-panel { position: static; }
}

@media (max-width: 620px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .prototype-ribbon { font-size: 8px; }
  .site-head { height: 70px; grid-template-columns: 1fr 1fr; }
  .edition { display: none; }
  .wordmark strong { font-size: 21px; }
  .mini-action { font-size: 13px; }
  .hero { min-height: 690px; padding: 58px 0 90px; }
  .hero h1 { font-size: clamp(58px, 18.5vw, 84px); margin-top: 23px; }
  .hero-copy { font-size: 17px; max-width: 340px; }
  .hero-stamp { width: 120px; height: 120px; right: -8px; top: 500px; }
  .hero-stamp strong { font-size: 26px; }
  .hero-stamp span { font-size: 8px; }
  .ticker div { font-size: 13px; }
  .roles { padding: 78px 0 94px; }
  .section-intro { margin-bottom: 34px; }
  .role-story > div { padding: 24px 20px; }
  .maker { padding: 70px 0; }
  .maker-grid { gap: 50px; }
  .maker h2, .how h2 { font-size: 48px; }
  .maker-note { margin-bottom: 40px; }
  .two-col, .tone-grid, .photo-pair, .preview-actions { grid-template-columns: 1fr; }
  .upload-zone { padding: 20px; }
  .how { padding: 84px 0; }
  .how h2 { margin-bottom: 36px; }
  .how-grid > div { padding: 26px 8px; }
  .how-grid strong { margin-top: 22px; }
  footer .wrap { display: block; }
  footer strong { font-size: 38px; }
  footer p { text-align: left; margin-top: 16px; }
  .primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker div { animation: none; }
  .primary-button { transition: none; }
}
