@font-face {
  font-family: "Plenqors Display";
  src: url("/fonts/barlow-condensed-bold-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Plenqors Text";
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --paper: #f6efd9;
  --paper-light: #fffaf0;
  --ink: #18352f;
  --ink-soft: #46605a;
  --moss: #5f7d5c;
  --leaf: #96ad72;
  --sky: #a9ced0;
  --sun: #edbd48;
  --coral: #d96046;
  --line: rgba(24, 53, 47, 0.24);
  --shadow: 0 24px 70px rgba(29, 58, 50, 0.13);
  --display: "Plenqors Display", sans-serif;
  --text: "Plenqors Text", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.72), transparent 26rem),
    radial-gradient(circle at 92% 22%, rgba(169, 206, 208, 0.3), transparent 22rem),
    repeating-linear-gradient(8deg, rgba(24, 53, 47, 0.018) 0 1px, transparent 1px 7px),
    var(--paper);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 30;
  inset: 0;
  border: 8px solid var(--ink);
  pointer-events: none;
  content: "";
}

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

a {
  color: inherit;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.8rem 1rem;
  color: var(--paper-light);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  width: min(100% - 4rem, 1440px);
  min-height: 96px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 3rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50% 50% 46% 54% / 58% 43% 57% 42%;
  color: var(--paper-light);
  background: var(--ink);
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1;
  transform: rotate(-5deg);
}

.brand-word {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(1.1rem, 3vw, 2.6rem);
}

.main-nav a,
.footer-column a {
  position: relative;
  text-decoration: none;
}

.main-nav a {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.main-nav a::after,
.text-link::after {
  position: absolute;
  right: 0;
  bottom: -0.3rem;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.text-link:hover::after,
.text-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-cta {
  padding: 0.78rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.header-cta:hover,
.header-cta:focus-visible {
  color: var(--paper-light);
  background: var(--ink);
  transform: translateY(-2px);
}

.hero {
  position: relative;
  width: min(100% - 4rem, 1440px);
  min-height: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(460px, 1.12fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 5rem 0 4rem;
}

.eyebrow,
.section-kicker,
.result-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  justify-content: space-between;
  max-width: 32rem;
  margin: 0 0 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.hero h1,
.section-heading h2,
.gallery-intro h2,
.about-copy h2,
.help-section h2,
.legal-main h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.86;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 48rem;
  font-size: clamp(5rem, 8vw, 9.6rem);
}

.hero h1 em,
.section-heading h2 em {
  display: inline-block;
  color: var(--coral);
  font-style: normal;
  font-weight: 700;
  text-transform: none;
  transform: rotate(-2deg);
}

.hero-lede {
  max-width: 38rem;
  margin: 2rem 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.button,
.generate-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  min-height: 52px;
  padding: 0.8rem 1.4rem;
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--sun);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button-primary:hover,
.button-primary:focus-visible {
  box-shadow: 2px 2px 0 var(--sun);
  transform: translate(3px, 3px);
}

.text-link {
  position: relative;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.hero-facts {
  margin: 3.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.hero-facts div {
  padding: 1rem 0.5rem 0 0;
}

.hero-facts div + div {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.hero-facts dt {
  color: var(--coral);
  font-family: var(--display);
  font-size: 1.8rem;
}

.hero-facts dd {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-art {
  position: relative;
  min-height: 650px;
  display: grid;
  place-items: center;
}

.sun-disc {
  position: absolute;
  top: 6%;
  right: 1%;
  width: clamp(130px, 17vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: inset -16px -12px 0 rgba(195, 125, 51, 0.13);
}

.hero-frame {
  position: relative;
  z-index: 2;
  width: min(75%, 540px);
  margin: 0;
  padding: 0.8rem;
  background: var(--paper-light);
  border: 1px solid rgba(24, 53, 47, 0.35);
  box-shadow: var(--shadow);
  transform: rotate(2.2deg);
}

.hero-frame::before {
  position: absolute;
  z-index: 3;
  top: -22px;
  left: 36%;
  width: 120px;
  height: 38px;
  background: rgba(244, 222, 154, 0.72);
  content: "";
  transform: rotate(-3deg);
}

.hero-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--sky);
}

.hero-frame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.15rem 0.1rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.art-note {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 11%;
  margin: 0;
  padding: 0.9rem 1.1rem;
  color: var(--paper-light);
  background: var(--coral);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  transform: rotate(-3deg);
}

.leaf {
  position: absolute;
  z-index: 4;
  width: 45px;
  height: 104px;
  border: 2px solid var(--ink);
  border-radius: 100% 0 100% 0;
  background: var(--leaf);
}

.leaf-one {
  top: 20%;
  left: 3%;
  transform: rotate(-38deg);
}

.leaf-two {
  bottom: 8%;
  left: 14%;
  width: 34px;
  height: 76px;
  background: var(--sky);
  transform: rotate(24deg);
}

.story-ribbon {
  overflow: hidden;
  color: var(--paper-light);
  background: var(--ink);
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transform: rotate(-1deg) scale(1.02);
}

.story-ribbon-track {
  width: max-content;
  display: flex;
  padding: 0.65rem 0;
  animation: ribbon 24s linear infinite;
}

.story-ribbon span {
  display: block;
  padding-right: 0.65rem;
}

@keyframes ribbon {
  to { transform: translateX(-50%); }
}

.studio-section {
  padding: clamp(7rem, 11vw, 11rem) max(2rem, calc((100vw - 1440px) / 2));
}

.section-heading {
  margin-bottom: 4rem;
  display: grid;
  grid-template-columns: 0.5fr 1.4fr 0.8fr;
  align-items: end;
  gap: 2rem;
}

.section-kicker {
  margin: 0 0 0.8rem;
  color: var(--coral);
}

.section-heading h2,
.gallery-intro h2,
.about-copy h2,
.help-section h2 {
  font-size: clamp(4rem, 6.5vw, 7.5rem);
}

.section-heading > p:last-child {
  max-width: 28rem;
  margin: 0;
  color: var(--ink-soft);
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(460px, 1.1fr);
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 14px 14px 0 rgba(24, 53, 47, 0.14);
}

.composer {
  padding: clamp(1.5rem, 3vw, 3rem);
  border-right: 1px solid var(--ink);
}

.auth-panel {
  margin: 0 0 2rem;
  padding: 1rem;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: rgba(169, 206, 208, 0.16);
}

.auth-panel h3 {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--display);
  font-size: 1.55rem;
  text-transform: uppercase;
}

.auth-panel-copy > p:last-child,
.auth-message {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.auth-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.auth-fields label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-fields input {
  min-width: 0;
  height: 44px;
  padding: 0 0.75rem;
}

.auth-mode-switch,
.auth-submit,
.auth-terms,
.auth-message {
  grid-column: 1 / -1;
}

.auth-mode-switch {
  display: flex;
  gap: 0.55rem;
}

.auth-mode-switch button,
.auth-submit,
.signed-in-panel button {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-light);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-mode-switch button.is-active,
.auth-submit {
  color: var(--paper-light);
  background: var(--ink);
}

.auth-submit {
  min-height: 44px;
}

.auth-terms {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 0.55rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.45;
}

.auth-terms input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.auth-terms[hidden] {
  display: none !important;
}

.signed-in-panel {
  margin: 0 0 1.4rem;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.signed-in-panel strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signed-in-panel button {
  margin-left: auto;
  border-color: var(--line);
  background: transparent;
}

.payment-panel {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--ink);
  background: rgba(237, 189, 72, 0.14);
}

.payment-panel > p {
  margin: 0.3rem 0;
}

.payment-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.payment-packs button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-light);
  color: var(--ink);
  cursor: pointer;
  padding: 0.55rem 0.8rem;
}

.account-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(24, 53, 47, 0.28);
}

.account-history[hidden] {
  display: none;
}

.account-history h4 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.history-list {
  display: grid;
  gap: 0.45rem;
}

.history-list article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(24, 53, 47, 0.16);
  font-size: 0.68rem;
}

.history-list article div {
  display: grid;
  gap: 0.15rem;
}

.history-list article span,
.history-list time,
.history-empty,
.history-status {
  color: var(--ink-soft);
}

.history-list time {
  max-width: 7rem;
  text-align: right;
}

.history-empty,
.history-status {
  margin: 0;
  font-size: 0.68rem;
}

.history-status {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .account-history {
    grid-template-columns: 1fr;
  }
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 2.5rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem;
}

.mode-button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-transform: uppercase;
}

.mode-button.is-active {
  color: var(--paper-light);
  background: var(--ink);
}

.form-step {
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

.step-label {
  width: 100%;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.step-label > span:first-child {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--coral);
  font-family: var(--text);
  font-size: 0.62rem;
}

.drop-zone {
  position: relative;
  width: 100%;
  min-height: 112px;
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  border: 1px dashed var(--ink-soft);
  border-radius: 14px;
  background: rgba(169, 206, 208, 0.12);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging,
.drop-zone.needs-attention {
  background: rgba(169, 206, 208, 0.3);
  transform: translateY(-2px);
}

.drop-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  font-size: 1.4rem;
}

.drop-copy {
  display: grid;
  min-width: 0;
}

.drop-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-copy small,
.ratio-grid small,
.model-note {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.drop-action {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.drop-zone.has-image {
  min-height: 150px;
  grid-template-columns: 110px 1fr;
}

.drop-zone.has-image .drop-icon,
.drop-zone.has-image .drop-action {
  display: none;
}

.drop-zone img {
  grid-row: 1;
  grid-column: 1;
  width: 110px;
  height: 118px;
  border-radius: 9px;
  object-fit: cover;
}

.drop-zone.has-image .drop-copy {
  grid-column: 2;
}

.remove-upload {
  margin-top: 0.6rem;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--coral);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.prompt-wrap {
  position: relative;
}

textarea,
.auth-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: #fffdf6;
  transition: border 180ms ease, box-shadow 180ms ease;
}

textarea {
  min-height: 138px;
  padding: 1rem 1rem 2rem;
  resize: vertical;
}

textarea:focus,
.auth-fields input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(169, 206, 208, 0.42);
}

.character-count {
  position: absolute;
  right: 0.8rem;
  bottom: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.prompt-ideas {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.prompt-ideas button {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.68rem;
  cursor: pointer;
}

.prompt-ideas button:hover,
.prompt-ideas button:focus-visible {
  border-color: var(--ink);
  background: rgba(237, 189, 72, 0.2);
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.ratio-grid label {
  position: relative;
  min-height: 118px;
  padding: 0.8rem;
  display: grid;
  align-content: end;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.ratio-grid input {
  position: absolute;
  opacity: 0;
}

.ratio-grid label:has(input:checked) {
  border: 2px solid var(--ink);
  background: rgba(237, 189, 72, 0.17);
}

.ratio-grid strong {
  margin-top: 0.55rem;
  font-size: 0.8rem;
}

.ratio-icon {
  display: block;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--sky);
}

.ratio-portrait { width: 18px; height: 27px; }
.ratio-square { width: 24px; height: 24px; }
.ratio-landscape { width: 30px; height: 20px; }

.consent-row {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.consent-row input {
  width: 17px;
  height: 17px;
  margin-top: 0.1rem;
  accent-color: var(--ink);
}

.generate-button {
  width: 100%;
  min-height: 58px;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.75rem 1.4rem;
  color: var(--paper-light);
  background: var(--coral);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.generate-button:hover:not(:disabled),
.generate-button:focus-visible:not(:disabled) {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper-light);
}

.model-note {
  margin: 0.9rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(217, 96, 70, 0.15);
}

.status-dot.is-ready {
  background: var(--moss);
  box-shadow: 0 0 0 4px rgba(95, 125, 92, 0.17);
}

.result-stage {
  position: relative;
  min-height: 820px;
  overflow: hidden;
  background:
    linear-gradient(rgba(24, 53, 47, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 53, 47, 0.07) 1px, transparent 1px),
    #dbe5d3;
  background-size: 32px 32px;
}

.result-empty,
.result-loading,
.result-error {
  min-height: 820px;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.result-empty img {
  width: min(76%, 430px);
  margin-bottom: 2.5rem;
  border: 10px solid var(--paper-light);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.result-stage h3 {
  max-width: 30rem;
  margin: 0.5rem auto;
  font-family: var(--display);
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.result-stage p:not(.result-number) {
  max-width: 31rem;
  margin: 1rem auto 0;
  color: var(--ink-soft);
}

.paint-orbit {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 2rem;
  animation: orbit 4s linear infinite;
}

.paint-orbit span {
  position: absolute;
  width: 52px;
  height: 68px;
  border-radius: 70% 30% 64% 36%;
}

.paint-orbit span:nth-child(1) { top: 0; left: 39px; background: var(--sun); }
.paint-orbit span:nth-child(2) { right: 0; bottom: 8px; background: var(--coral); transform: rotate(120deg); }
.paint-orbit span:nth-child(3) { bottom: 8px; left: 0; background: var(--sky); transform: rotate(240deg); }

@keyframes orbit {
  to { transform: rotate(360deg); }
}

.result-error > span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
  font-family: var(--display);
  font-size: 3.5rem;
  transform: rotate(6deg);
}

.result-success {
  min-height: 820px;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--ink);
}

.result-success > img {
  width: 100%;
  height: 740px;
  object-fit: contain;
  background: #101f1c;
}

.result-toolbar {
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--paper-light);
}

.result-toolbar p {
  margin: 0 !important;
  color: inherit !important;
}

.result-toolbar p:last-child {
  opacity: 0.7;
  font-size: 0.72rem;
}

.download-button {
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  color: var(--ink);
  background: var(--sun);
  font-size: 0.72rem;
}

.gallery-section {
  position: relative;
  padding: clamp(7rem, 10vw, 10rem) max(2rem, calc((100vw - 1440px) / 2));
  color: var(--paper-light);
  background:
    radial-gradient(circle at 75% 10%, rgba(169, 206, 208, 0.12), transparent 26rem),
    repeating-linear-gradient(-12deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 8px),
    var(--ink);
}

.gallery-intro {
  margin-bottom: 4rem;
  display: grid;
  grid-template-columns: 0.55fr 1.2fr 0.7fr;
  align-items: end;
  gap: 2rem;
}

.gallery-intro > p:last-child {
  max-width: 26rem;
  margin: 0;
  color: rgba(255, 250, 240, 0.67);
}

.story-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: clamp(1.2rem, 3vw, 3rem);
}

.story-card {
  margin: 0;
}

.story-card img {
  width: 100%;
  object-fit: cover;
  border: 9px solid var(--paper-light);
  box-shadow: 12px 12px 0 rgba(237, 189, 72, 0.55);
}

.story-card-wide img { aspect-ratio: 1.45 / 1; }
.story-card-tall img { aspect-ratio: 0.73 / 1; }

.story-card figcaption {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.story-card figcaption span:first-child {
  display: grid;
}

.story-card figcaption strong {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.story-card figcaption small,
.gallery-quote cite {
  color: rgba(255, 250, 240, 0.57);
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-quote {
  grid-column: 1 / -1;
  margin: 3rem 0 0;
  padding: 3rem 0 0 22%;
  border-top: 1px solid rgba(255, 250, 240, 0.25);
}

.gallery-quote p {
  max-width: 760px;
  margin: 0 0 1rem;
  color: var(--sun);
  font-family: var(--display);
  font-size: clamp(3rem, 5.6vw, 6.5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.how-section {
  padding: clamp(7rem, 10vw, 10rem) max(2rem, calc((100vw - 1440px) / 2));
}

.section-heading.compact {
  grid-template-columns: 0.55fr 1.8fr;
}

.process-list {
  max-width: 1080px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.process-list li {
  min-height: 170px;
  padding: 2rem 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: start;
  border-bottom: 1px solid var(--ink);
}

.process-list > li > span {
  color: var(--coral);
  font-family: var(--display);
  font-size: 3rem;
}

.process-list h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
}

.process-list p {
  max-width: 670px;
  margin: 0;
  color: var(--ink-soft);
}

.process-list code {
  padding: 0.1rem 0.3rem;
  background: rgba(169, 206, 208, 0.25);
}

.about-section {
  padding: clamp(6rem, 9vw, 9rem) max(2rem, calc((100vw - 1440px) / 2));
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(3rem, 7vw, 8rem);
  align-items: center;
  background: #e4ead9;
}

.about-art {
  position: relative;
}

.about-art img {
  width: 100%;
  aspect-ratio: 0.82 / 1;
  object-fit: cover;
  border: 10px solid var(--paper-light);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.about-art span {
  position: absolute;
  right: -2rem;
  bottom: 3rem;
  padding: 0.8rem 1rem;
  color: var(--paper-light);
  background: var(--coral);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  transform: rotate(3deg);
}

.about-lede {
  max-width: 720px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.principles {
  margin: 2.5rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.principles div {
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
}

.principles span {
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.principles p {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.help-section {
  min-height: 590px;
  padding: clamp(7rem, 11vw, 11rem) max(2rem, calc((100vw - 1200px) / 2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.help-section h2 {
  max-width: 900px;
}

.help-section > a {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--coral);
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 4rem);
  text-decoration: none;
}

.help-section > p:last-child {
  max-width: 580px;
  color: var(--ink-soft);
}

.site-footer {
  padding: 5rem max(2rem, calc((100vw - 1440px) / 2)) 2rem;
  display: grid;
  grid-template-columns: 1.2fr 0.55fr 0.65fr 1fr;
  gap: 2rem;
  color: var(--paper-light);
  background: var(--ink);
}

.footer-brand strong {
  margin-left: 0.6rem;
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: 0.08em;
}

.footer-brand .brand-mark {
  color: var(--ink);
  background: var(--sun);
}

.footer-brand p {
  color: rgba(255, 250, 240, 0.6);
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-style: normal;
}

.footer-column h2 {
  margin: 0 0 0.8rem;
  color: var(--sun);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.footer-column span {
  color: rgba(255, 250, 240, 0.62);
}

.footer-bottom {
  grid-column: 1 / -1;
  margin: 3rem 0 0;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 250, 240, 0.2);
  color: rgba(255, 250, 240, 0.5);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.story-card:nth-child(2) { transition-delay: 120ms; }
.process-list li:nth-child(2) { transition-delay: 70ms; }
.process-list li:nth-child(3) { transition-delay: 140ms; }
.process-list li:nth-child(4) { transition-delay: 210ms; }

/* Legal pages */
.legal-body {
  min-height: 100vh;
}

.legal-header {
  width: min(100% - 4rem, 1120px);
}

.legal-header .main-nav {
  justify-content: flex-end;
}

.legal-main {
  width: min(100% - 4rem, 960px);
  margin: 0 auto;
  padding: clamp(5rem, 9vw, 9rem) 0;
}

.legal-main .legal-kicker {
  margin: 0 0 1rem;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.legal-main h1 {
  max-width: 820px;
  font-size: clamp(4rem, 9vw, 8rem);
}

.legal-meta {
  margin: 2rem 0 4rem;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 4rem;
}

.legal-toc {
  position: sticky;
  top: 2rem;
  align-self: start;
  display: grid;
  gap: 0.45rem;
  font-size: 0.75rem;
}

.legal-toc strong {
  margin-bottom: 0.5rem;
  color: var(--coral);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-toc a {
  text-decoration: none;
}

.legal-content section {
  padding: 0 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.legal-content section + section {
  padding-top: 2.5rem;
}

.legal-content h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 2.2rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.legal-content h3 {
  margin-top: 1.5rem;
  font-size: 1rem;
}

.legal-content p,
.legal-content li {
  color: var(--ink-soft);
}

.legal-content li + li {
  margin-top: 0.6rem;
}

.legal-contact {
  padding: 1.4rem;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 6px 6px 0 var(--sun);
}

@media (max-width: 1060px) {
  .site-header {
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
  }

  .main-nav {
    justify-content: flex-end;
  }

  .header-cta {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr 0.9fr;
    gap: 2rem;
  }

  .hero-art {
    min-height: 570px;
  }

  .section-heading,
  .gallery-intro {
    grid-template-columns: 0.45fr 1.55fr;
  }

  .section-heading > p:last-child,
  .gallery-intro > p:last-child {
    grid-column: 2;
  }

  .studio-shell {
    grid-template-columns: 1fr;
  }

  .composer {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .result-stage,
  .result-empty,
  .result-loading,
  .result-error,
  .result-success {
    min-height: 700px;
  }

  .result-success > img {
    height: 620px;
  }

  .about-section {
    grid-template-columns: 0.7fr 1.3fr;
  }

  .principles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body::before {
    border-width: 4px;
  }

  .site-header,
  .hero,
  .legal-header,
  .legal-main {
    width: min(100% - 2rem, 100%);
  }

  .site-header {
    min-height: 80px;
    display: flex;
    justify-content: space-between;
  }

  .brand-word {
    font-size: 1.2rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
  }

  .main-nav {
    gap: 0.8rem;
  }

  .main-nav a:nth-child(2),
  .main-nav a:nth-child(4) {
    display: none;
  }

  .main-nav a {
    font-size: 0.65rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .hero-copy {
    padding: 4rem 0 0;
  }

  .hero h1 {
    font-size: clamp(4rem, 21vw, 6.3rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .hero-facts div,
  .hero-facts div + div {
    padding: 0.8rem 0;
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-facts dd {
    margin: 0;
  }

  .hero-art {
    width: 100%;
    min-height: 560px;
  }

  .hero-frame {
    width: 82%;
  }

  .art-note {
    right: 0.5rem;
  }

  .story-ribbon {
    margin-top: 2rem;
  }

  .studio-section,
  .gallery-section,
  .how-section,
  .about-section,
  .help-section {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .section-heading,
  .gallery-intro,
  .section-heading.compact {
    display: block;
  }

  .section-heading h2,
  .gallery-intro h2,
  .about-copy h2,
  .help-section h2 {
    font-size: clamp(3.6rem, 18vw, 5.4rem);
  }

  .section-heading > p:last-child,
  .gallery-intro > p:last-child {
    margin-top: 1.5rem;
  }

  .studio-shell {
    box-shadow: 7px 7px 0 rgba(24, 53, 47, 0.14);
  }

  .composer {
    padding: 1.1rem;
  }

  .mode-switch {
    margin-bottom: 2rem;
  }

  .drop-zone {
    grid-template-columns: auto 1fr;
  }

  .drop-action {
    grid-column: 2;
    justify-self: start;
  }

  .ratio-grid {
    grid-template-columns: 1fr;
  }

  .ratio-grid label {
    min-height: 88px;
    grid-template-columns: 42px 1fr;
    align-items: center;
  }

  .ratio-grid strong,
  .ratio-grid small {
    grid-column: 2;
    margin: 0;
  }

  .ratio-grid small {
    align-self: start;
  }

  .result-stage,
  .result-empty,
  .result-loading,
  .result-error,
  .result-success {
    min-height: 560px;
  }

  .result-empty,
  .result-loading,
  .result-error {
    padding: 2rem 1.2rem;
  }

  .result-success > img {
    height: 500px;
  }

  .result-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-card-tall {
    width: 78%;
    margin-left: auto;
  }

  .gallery-quote {
    padding-left: 0;
  }

  .process-list li {
    grid-template-columns: 64px 1fr;
  }

  .process-list > li > span {
    font-size: 2.2rem;
  }

  .about-section {
    grid-template-columns: 1fr;
  }

  .about-art {
    width: 78%;
    margin: 0 auto;
  }

  .about-art span {
    right: -1rem;
  }

  .site-footer {
    padding-right: 1.2rem;
    padding-left: 1.2rem;
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand,
  .footer-bottom {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-header .main-nav {
    display: none;
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .legal-toc {
    position: static;
    padding: 1rem;
    border: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
