:root {
  /* Studio backdrop (header, hero, footer) + paper (the tool itself, like a
     photographer's light box - neutral so colors in your photos read true). */
  --charcoal: #18160f;
  --charcoal-soft: #26221a;
  --charcoal-ink: #f3efe4;
  --charcoal-ink-muted: #b5ac96;
  --paper: #f6f4ee;
  --paper-card: #fffdf8;
  --ink: #201d16;
  --muted: #756e5c;
  --line: #e2dfd3;
  --brass: #b8792a;
  --brass-deep: #8f5c1c;
  --danger: #b23b2a;
  --radius: 14px;
  --display-font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body-font: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must always win, even on elements whose class sets a
   `display` (e.g. .download-link / .generate-button) - those tie the UA
   [hidden] rule on specificity and would otherwise keep showing. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .logo, .mode-button, .generate-button, .step-number, .download-link {
  font-family: var(--display-font);
}

/* Signature: viewfinder corner brackets, like a camera focus overlay - marks
   the surfaces where your photo is actually captured or displayed. Pure
   background layers, no extra markup. */
.viewfinder {
  --vf-size: 18px;
  --vf-thick: 2px;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass)),
    linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass)),
    linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass)),
    linear-gradient(var(--brass), var(--brass)), linear-gradient(var(--brass), var(--brass));
  background-size:
    var(--vf-thick) var(--vf-size), var(--vf-size) var(--vf-thick),
    var(--vf-thick) var(--vf-size), var(--vf-size) var(--vf-thick),
    var(--vf-thick) var(--vf-size), var(--vf-size) var(--vf-thick),
    var(--vf-thick) var(--vf-size), var(--vf-size) var(--vf-thick);
  background-position:
    12px 12px, 12px 12px,
    calc(100% - 12px) 12px, calc(100% - 12px - var(--vf-size) + var(--vf-thick)) 12px,
    12px calc(100% - 12px), 12px calc(100% - 12px - var(--vf-thick)),
    calc(100% - 12px) calc(100% - 12px), calc(100% - 12px - var(--vf-size) + var(--vf-thick)) calc(100% - 12px);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(24, 22, 15, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--charcoal-soft);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--charcoal-ink);
  text-decoration: none;
}

.logo-mark {
  display: block;
}

.logo-accent {
  color: var(--brass);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--charcoal-ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--charcoal-ink);
}

/* Hero (part of the dark studio bookend, full-bleed like the header) */

.hero {
  background: var(--charcoal);
  color: var(--charcoal-ink);
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}

.hero-subtitle {
  margin: 0;
  color: var(--charcoal-ink-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Main / content sections, on the paper surface */

main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* How it works */

.how-it-works {
  max-width: 720px;
  margin: 0 auto 3rem;
}

.how-it-works h2 {
  text-align: center;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 1.75rem;
}

.how-it-works-tracks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.how-it-works-track {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.how-it-works-track h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.steps li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: var(--brass);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.steps h4 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Mode explainer */

.mode-explainer {
  max-width: 720px;
  margin: 0 auto 3rem;
}

.mode-explainer h2 {
  text-align: center;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 1.75rem;
}

.mode-explainer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.mode-explainer-item {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.mode-explainer-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.mode-explainer-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Showcase (before/after) */

.showcase {
  max-width: 720px;
  margin: 0 auto 3rem;
  text-align: center;
}

.showcase h2 {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.showcase-intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.showcase-item {
  margin: 0;
}

.showcase-item img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: contain;
  background-color: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.showcase-item figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* FAQ */

.faq {
  max-width: 720px;
  margin: 0 auto 3rem;
}

.faq h2 {
  text-align: center;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}

.faq-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.faq-item:first-of-type {
  border-top: 1px solid var(--line);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.2rem;
  color: var(--brass);
  font-family: var(--display-font);
  font-weight: 700;
}

.faq-item[open] summary::before {
  content: "−";
}

.faq-item p {
  margin: 0.6rem 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Card */

.card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper-card);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -20px rgba(24, 22, 15, 0.2);
  padding: 2rem;
  text-align: center;
}

.card-intro {
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.audience-cta {
  margin-top: 3rem;
}

.audience-cta h2 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.audience-cta-button {
  margin-top: 1.25rem;
}

/* Mode toggle */

.mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mode-button {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button-active,
.mode-button-active:hover {
  background: var(--charcoal);
  color: var(--charcoal-ink);
}

/* Dropzone */

.dropzone {
  margin-top: 1.5rem;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  background-color: var(--paper);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brass);
  background-color: #fbf3e6;
}

.dropzone-hint {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Photo list */

.photo-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.photo-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  padding: 0;
  border: 2px solid var(--paper-card);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Buttons */

.generate-button {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: var(--brass-deep);
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.generate-button:hover:not(:disabled) {
  background: var(--brass);
}

.generate-button:active:not(:disabled) {
  transform: scale(0.98);
}

.generate-button:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* Status text */

.loading {
  margin-top: 1rem;
  color: var(--muted);
}

.error-message {
  margin-top: 1rem;
  color: var(--danger);
}

/* Viewer / cutout preview */

.viewer {
  display: block;
  width: 100%;
  height: 340px;
  margin-top: 1.5rem;
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cutout-preview {
  object-fit: contain;
}

.quality-tips {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fbf3e6;
  border: 1px solid #e7cd9d;
  border-radius: var(--radius);
  text-align: left;
}

.quality-tips-label {
  margin: 0 0 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.quality-tips ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.quality-tips li {
  margin-bottom: 0.25rem;
}

.quality-tips li:last-child {
  margin-bottom: 0;
}

/* Background section */

.background-section {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  text-align: left;
}

.background-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.suggestions-loading {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.background-suggestions {
  margin-bottom: 0.75rem;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suggestion-chip {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.suggestion-chip:hover {
  background: #fbf3e6;
  border-color: var(--brass);
}

.background-generate {
  display: flex;
  gap: 0.5rem;
}

.background-prompt {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}

.background-prompt:focus {
  outline: 2px solid var(--brass);
  outline-offset: -1px;
}

.background-generate .generate-button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.background-section > input[type="file"] {
  margin-top: 0.75rem;
}

.composite-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.download-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.3rem;
  background: var(--brass-deep);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.download-link:hover {
  background: var(--brass);
}

/* Footer */

.site-footer {
  background: var(--charcoal);
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  color: var(--charcoal-ink-muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.license-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.license-buy-link {
  color: var(--brass);
  font-weight: 600;
  text-decoration: none;
}

.license-buy-link:hover {
  text-decoration: underline;
}

.license-submit {
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: var(--brass-deep);
  color: #fff;
  font-family: var(--display-font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.license-submit:hover {
  background: var(--brass);
}

.license-bar .error-message {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
}

/* Pricing page */

.pricing-account-section {
  max-width: 520px;
  margin: 0 auto 2rem;
  text-align: center;
}

.pricing-account-status {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-card);
  color: var(--muted);
  font-size: 0.92rem;
}

.pricing-account-status strong {
  color: var(--ink);
}

.pricing-account-status a {
  color: var(--brass);
  font-weight: 600;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.pricing-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}

.pricing-plan-highlight {
  border-color: var(--brass);
  border-width: 2px;
  background: #fbf3e6;
}

.pricing-plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 1.5rem;
  padding: 0.2rem 0.6rem;
  background: var(--brass);
  color: #fff;
  border-radius: 999px;
  font-family: var(--display-font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pricing-plan h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.pricing-plan-credits {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.pricing-price {
  margin: 0 0 1rem;
  font-family: var(--display-font);
  font-size: 1.6rem;
  font-weight: 700;
}

.pricing-price-note {
  font-family: var(--body-font);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.pricing-plan-button {
  width: 100%;
  margin-top: 0;
}

.pricing-plan-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.pricing-features {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.pricing-status-card {
  max-width: 480px;
}

.pricing-payment-methods {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.pricing-status-card .loading,
.pricing-status-card .error-message {
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* Account (login / sign up) */

.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

.auth-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-toggle .mode-button {
  flex: 1;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink);
}

.auth-input {
  font-family: var(--body-font);
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.auth-input:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}

.auth-form .generate-button {
  margin-top: 0.25rem;
}

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--brass);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.auth-link-button:hover {
  color: var(--brass-deep);
}

/* Dashboard */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.dashboard-card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.dashboard-list {
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
}

.dashboard-list dt {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
  align-self: center;
}

.dashboard-list dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
  word-break: break-word;
}

.dashboard-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.verify-ok {
  color: var(--brass-deep);
  font-weight: 600;
}

.verify-pending {
  color: var(--danger);
  font-weight: 600;
}

.dashboard-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 1.25rem;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.download-link-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.download-link-danger:hover {
  background: var(--danger);
  color: #fff;
}

.success-message {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brass-deep);
}

/* Billing history */

.dashboard-billing {
  margin-top: 1.25rem;
}

.dashboard-billing h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.billing-table th,
.billing-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.billing-table th {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}

.billing-table .billing-amount {
  text-align: right;
  white-space: nowrap;
}

.billing-table tbody tr:last-child td {
  border-bottom: none;
}

/* Collapse the dashboard grids on narrow screens. This lives after the base
   grid rules on purpose: the earlier @media (max-width: 900px) block sits
   before them and so loses the cascade tie to these definitions. */
@media (max-width: 720px) {
  .dashboard-grid,
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1.5rem 1.25rem;
  }

  .how-it-works-tracks,
  .mode-explainer-grid,
  .pricing-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}
