:root {
  --ink: #171412;
  --coal: #241f1b;
  --paper: #f4eddf;
  --paper-strong: #fffaf0;
  --paper-soft: #ebe0cb;
  --muted: #74685d;
  --line: rgba(23, 20, 18, 0.16);
  --line-strong: rgba(23, 20, 18, 0.28);
  --red: #9e342d;
  --green: #1e695d;
  --blue: #283f61;
  --gold: #b68436;
  --plum: #5b344f;
  --cream: #fff7e7;
  --shadow: 0 24px 70px rgba(23, 20, 18, 0.2);
  --soft-shadow: 0 12px 38px rgba(23, 20, 18, 0.1);
  --radius: 8px;
  --display-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui-font: Aptos, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--ui-font);
  color: var(--ink);
  background: #d9cfbe;
  scrollbar-color: var(--gold) rgba(23, 20, 18, 0.12);
}

* {
  box-sizing: border-box;
}

::selection {
  color: var(--cream);
  background: var(--plum);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: rgba(23, 20, 18, 0.09);
}

*::-webkit-scrollbar-thumb {
  border: 3px solid rgba(255, 250, 240, 0.78);
  background: linear-gradient(180deg, var(--gold), var(--red));
  border-radius: 999px;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(23, 20, 18, 0.045) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, rgba(255, 250, 240, 0.88), rgba(235, 224, 203, 0.92)),
    url("/assets/studio-bg.png") center top / cover fixed;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

button,
select,
.file-button,
.download-button {
  border-radius: 8px;
}

button {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

button:hover:not(:disabled),
.download-button:hover,
.footer-socials a:hover,
.file-button:hover {
  transform: translateY(-1px);
}

.shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 250, 240, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.9), rgba(244, 237, 223, 0.78));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
  border-radius: var(--radius);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 8px 18px rgba(23, 20, 18, 0.18));
}

.brand strong {
  display: block;
  font-family: var(--display-font);
  font-size: 1.18rem;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.25;
}

.language-label,
.file-button,
.ghost,
.download-button {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.74);
  color: var(--ink);
}

.language-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.language-label span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

select {
  min-height: 40px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--paper-strong), #f6eddd),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23171412' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
      right 10px center / 18px 18px no-repeat;
  color: var(--ink);
  padding: 0 38px 0 12px;
  appearance: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

select:hover {
  border-color: rgba(182, 132, 54, 0.58);
}

select option {
  background: var(--paper-strong);
  color: var(--ink);
}

.language-label:focus-within {
  border-color: rgba(30, 105, 93, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 0 3px rgba(30, 105, 93, 0.16);
}

main {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.intro,
.tool-panel,
.quote-panel,
.progress-panel,
.policy-grid article {
  border: 1px solid rgba(255, 250, 240, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.94), rgba(246, 238, 224, 0.9));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.intro {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(23, 20, 18, 0.06), rgba(23, 20, 18, 0.84)),
    linear-gradient(120deg, rgba(30, 105, 93, 0.36), rgba(158, 52, 45, 0.26) 52%, rgba(40, 63, 97, 0.28)),
    url("/assets/studio-bg.png") 37% center / cover;
  overflow: hidden;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.76rem;
  line-height: 1.3;
}

.intro h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--display-font);
  font-size: 3.9rem;
  line-height: 0.98;
  text-wrap: balance;
}

.lede {
  max-width: 38rem;
  margin: 20px 0 0;
  color: rgba(255, 247, 231, 0.88);
  line-height: 1.62;
}

.trust-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 28px;
}

.trust-strip span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 247, 231, 0.22);
  background: rgba(255, 247, 231, 0.11);
  border-radius: 8px;
  color: rgba(255, 247, 231, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tool-panel,
.quote-panel,
.progress-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.82rem;
  line-height: 1.12;
  text-wrap: balance;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.field-label,
.select-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

textarea {
  display: block;
  width: 100%;
  min-height: 340px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 247, 231, 0.96));
  color: var(--ink);
  line-height: 1.58;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 999px rgba(255, 255, 255, 0.02);
}

textarea::placeholder {
  color: rgba(116, 104, 93, 0.72);
}

textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(30, 105, 93, 0.28);
  outline-offset: 2px;
}

.counter-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 8px;
  align-content: start;
}

.segmented legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.segmented label {
  min-height: 0;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 92px;
  height: auto;
  padding: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--paper-strong), #f6eddd);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.segmented label:hover span {
  transform: translateY(-1px);
  border-color: rgba(182, 132, 54, 0.58);
  box-shadow: var(--soft-shadow);
}

.segmented input:checked + span {
  border-color: rgba(158, 52, 45, 0.78);
  box-shadow:
    inset 0 0 0 2px rgba(158, 52, 45, 0.13),
    0 10px 30px rgba(158, 52, 45, 0.11);
  background: linear-gradient(180deg, #fff2df, #f7e6d0);
}

.segmented strong {
  line-height: 1.2;
}

.segmented small {
  color: var(--muted);
  line-height: 1.35;
}

.style-field {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.style-select {
  width: 100%;
}

.style-preview {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr);
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(246, 237, 221, 0.96));
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.style-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.style-preview-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 18px;
}

.style-preview-copy strong {
  font-size: 1.18rem;
  line-height: 1.16;
}

.style-preview-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.46;
}

.copyright-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.45;
}

.copyright-check input {
  appearance: none;
  display: grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--paper-strong), #f2e7d6);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.copyright-check input::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.14s ease;
  background: var(--green);
  clip-path: polygon(14% 48%, 0 62%, 40% 100%, 100% 16%, 84% 3%, 38% 68%);
}

.copyright-check input:checked {
  border-color: rgba(30, 105, 93, 0.76);
  background: #eef5e7;
}

.copyright-check input:checked::before {
  transform: scale(1);
}

.copyright-check input:focus-visible {
  outline: 3px solid rgba(30, 105, 93, 0.28);
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.download-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

button:active:not(:disabled),
.download-button:active {
  transform: translateY(0);
}

.primary {
  color: var(--cream);
  background:
    linear-gradient(180deg, #247667, var(--green));
  border-color: rgba(23, 20, 18, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 26px rgba(30, 105, 93, 0.22);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2a806f, #185c52);
}

.ghost {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.8), rgba(236, 225, 206, 0.8));
}

.ghost:hover:not(:disabled) {
  border-color: rgba(91, 52, 79, 0.42);
  box-shadow: var(--soft-shadow);
}

.download-button {
  background: linear-gradient(180deg, #b44238, var(--red));
  color: var(--cream);
  box-shadow: 0 12px 28px rgba(158, 52, 45, 0.2);
}

.form-message,
.payment-message {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--red);
  line-height: 1.45;
  font-weight: 700;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 220px;
  padding: 22px;
  border: 1px dashed rgba(23, 20, 18, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.42);
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.quote-result {
  display: grid;
  gap: 16px;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(135deg, var(--coal), #171412 52%, #2b1c26);
  color: var(--cream);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.price-row span {
  color: rgba(255, 247, 231, 0.68);
  font-weight: 800;
}

.price-row strong {
  font-family: var(--display-font);
  font-size: 2.45rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quote-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.quote-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.quote-stats dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-stats dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.line-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.margin-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stripe-area {
  display: grid;
  gap: 12px;
}

.embedded-checkout {
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(23, 20, 18, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.94), rgba(246, 238, 224, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 36px rgba(23, 20, 18, 0.1);
}

.embedded-checkout iframe {
  border-radius: var(--radius);
}

.progress-panel {
  display: grid;
  gap: 14px;
}

.progress-meter {
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(23, 20, 18, 0.2);
  background: rgba(23, 20, 18, 0.08);
  border-radius: 8px;
}

.progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red), var(--blue));
  transition: width 0.35s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  color: var(--muted);
}

.progress-meta strong {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 1.7rem;
}

.event-log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-log li {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.event-log time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.policy-grid article {
  padding: 22px;
}

.policy-grid p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 250, 240, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.82), rgba(238, 228, 210, 0.7));
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  color: rgba(23, 20, 18, 0.74);
}

.footer-copy {
  display: grid;
  gap: 3px;
  justify-self: start;
  min-width: 0;
}

.footer-copy strong {
  font-family: var(--display-font);
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.05;
}

.footer-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.78), rgba(238, 228, 210, 0.66));
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.footer-socials a:hover {
  border-color: rgba(91, 52, 79, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(238, 228, 210, 0.86));
  box-shadow: var(--soft-shadow);
}

.footer-socials span {
  color: inherit;
  line-height: 1;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
  }

  .quote-panel {
    grid-column: 1 / -1;
  }

  .intro {
    min-height: 560px;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 10px;
  }

  .topbar,
  .workspace,
  .policy-grid,
  .option-grid,
  .footer {
    grid-template-columns: 1fr;
  }

  .language-label {
    justify-self: start;
  }

  .footer-socials {
    justify-content: flex-start;
    justify-self: start;
  }

  .intro {
    min-height: 500px;
  }

  .intro h1 {
    font-size: 3rem;
  }

  .segmented,
  .quote-stats {
    grid-template-columns: 1fr;
  }

  .style-preview {
    grid-template-columns: 1fr;
  }

  .style-preview-image {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
  }

  .panel-header,
  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .price-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .intro,
  .tool-panel,
  .quote-panel,
  .progress-panel,
  .policy-grid article {
    padding: 16px;
  }

  .intro h1 {
    font-size: 2.35rem;
  }

  textarea {
    min-height: 280px;
  }

  .embedded-checkout {
    min-height: 480px;
  }

  .style-preview-copy {
    padding: 14px;
  }

  .event-log li {
    grid-template-columns: 1fr;
  }

  .footer-socials a {
    min-width: 0;
    flex: 1 1 138px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
