:root {
  --paper: #e8ebe6;
  --paper-deep: #d5dbd3;
  --ink: #141816;
  --muted: #4d5650;
  --line: #b7c0b6;
  --panel: #f3f5f1;
  --accent: #2f6f68;
  --accent-deep: #245851;
  --warn: #8a3b2c;
  --wrap: 720px;
  --wide: 1120px;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  background:
    radial-gradient(1200px 600px at 80% -10%, #cfd8cf 0%, transparent 55%),
    linear-gradient(180deg, #eef1eb 0%, var(--paper) 40%, #e2e7e0 100%);
  min-height: 100vh;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink) url('/favicon.svg') center/72% no-repeat;
}
.top nav { display: flex; gap: 22px; font-size: 0.95rem; font-weight: 600; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

/* Hero: one composition, brand-first, full-bleed visual */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f4f7f3;
}
.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  animation: drift 18s ease-in-out infinite alternate;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 18, 14, 0.72) 0%, rgba(12, 18, 14, 0.35) 48%, rgba(12, 18, 14, 0.15) 100%),
    linear-gradient(0deg, rgba(12, 18, 14, 0.55) 0%, transparent 45%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: var(--wide);
  width: 100%;
  margin: 0 auto;
  padding: 48px 22px 56px;
}
.brand-hero {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lead {
  max-width: 34rem;
  margin: 16px 0 28px;
  color: rgba(244, 247, 243, 0.86);
  font-size: 1.05rem;
  text-wrap: pretty;
}
.hero-cta { margin: 0; }
.go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #f5faf8;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.go:hover { background: var(--accent-deep); }
.go:active { transform: translateY(1px); }
.go:disabled { opacity: 0.55; cursor: wait; }

@keyframes drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.2%, -0.8%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-visual img { animation: none; }
  html { scroll-behavior: auto; }
}

.studio {
  max-width: var(--wide);
  margin: -28px auto 0;
  padding: 0 22px 24px;
  position: relative;
  z-index: 2;
}
.studio-copy { max-width: 40rem; margin-bottom: 18px; }
.studio-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
}
.studio-lead { margin: 0; color: var(--muted); }

.studio-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(20, 24, 22, 0.08);
}
.drop {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 180px;
  padding: 20px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fafcf9, #eef2ec);
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.drop.is-over, .drop:hover { border-color: var(--accent); background: #f7faf6; }
.drop-title { font-weight: 700; }
.drop-sub { color: var(--muted); font-size: 0.92rem; }
.drop-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drop.has-file .drop-title,
.drop.has-file .drop-sub { display: none; }

.style-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #f4f7f3;
}

.prompt-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.opt { color: var(--muted); font-weight: 500; }
textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.ghost-link {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.ghost-link:hover { color: var(--ink); text-decoration: underline; }

.status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: 0.95rem; }
.status.is-error { color: var(--warn); }

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.compare figure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.compare figcaption {
  padding: 10px 12px 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.compare img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-deep);
}

.block {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 36px 22px 8px;
}
.block h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}
.steps li {
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); }
.steps b { color: var(--ink); font-weight: 700; }

.prose p, .prose li { color: var(--muted); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 1.15rem; }
.prose a { color: var(--accent-deep); font-weight: 600; }
.doc { padding-top: 28px; padding-bottom: 48px; }
.doc h1 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 4px; color: var(--muted); }

.more {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 18px;
}
.more a { font-weight: 600; text-decoration: none; color: var(--accent-deep); }
.more a:hover { text-decoration: underline; }

.foot {
  max-width: var(--wide);
  margin: 48px auto 0;
  padding: 28px 22px 40px;
  border-top: 1px solid var(--line);
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}
.foot-title { margin: 0 0 10px; font-weight: 700; }
.foot a {
  display: block;
  width: fit-content;
  margin-bottom: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.foot a:hover { color: var(--ink); text-decoration: underline; }
.fine { margin: 0; color: var(--muted); font-size: 0.88rem; max-width: 52rem; }

@media (max-width: 720px) {
  .compare { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 78vh; }
}

/* Auth */
.auth { position: relative; }
.auth-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.auth-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(260px, 80vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 24, 22, 0.12);
  display: grid;
  gap: 8px;
  z-index: 20;
}
.auth-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.auth-btn.is-disabled { opacity: 0.45; }
.auth-google { background: #fff; }
.auth-x { background: #141816; color: #f4f7f3; border-color: #141816; }
.auth-out { background: transparent; }
.auth-note { margin: 0; color: var(--warn); font-size: 0.82rem; }

.top nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Examples gallery */
.gallery {
  display: grid;
  gap: 18px;
  margin: 18px 0 8px;
}
.gallery-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
}
.gallery-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.gallery-pair img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: var(--paper-deep);
}
.gallery-card figcaption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  padding: 10px 12px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}
.gallery-card figcaption em {
  grid-column: 1 / -1;
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

@media (max-width: 720px) {
  .gallery-pair img { height: 160px; }
}
