@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Bitter:wght@600;700&family=IBM+Plex+Mono:wght@500&display=swap");

:root {
  color-scheme: light;
  --forest-950: #182117;
  --forest-900: #233123;
  --forest-800: #304130;
  --sand-100: #f6f0e4;
  --sand-200: #ebe0cf;
  --ink-900: #1f1c17;
  --ink-700: #4e473d;
  --ink-500: #7d7265;
  --rust-500: #c86f34;
  --rust-600: #aa5725;
  --sage-500: #8b9461;
  --paper: rgba(246, 240, 228, 0.92);
  --paper-strong: rgba(252, 248, 240, 0.96);
  --line: rgba(54, 42, 28, 0.16);
  --line-strong: rgba(54, 42, 28, 0.28);
  --shadow: 0 22px 60px rgba(12, 15, 10, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--forest-950);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", "Trebuchet MS", sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 15% 20%, rgba(200, 111, 52, 0.18), transparent 26%),
    radial-gradient(circle at 85% 8%, rgba(139, 148, 97, 0.22), transparent 20%),
    linear-gradient(145deg, #182117 0%, #263326 45%, #4a402f 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    repeating-linear-gradient(110deg, transparent 0 20px, rgba(255, 255, 255, 0.04) 21px 22px, transparent 23px 46px),
    repeating-linear-gradient(24deg, transparent 0 28px, rgba(255, 255, 255, 0.03) 29px 30px, transparent 31px 58px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(12, 16, 12, 0.12) 0%, transparent 18%, transparent 78%, rgba(12, 16, 12, 0.18) 100%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid;
  gap: 24px;
}

.hero,
.workspace {
  display: grid;
  gap: 24px;
  align-items: start;
}

.hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.workspace {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.hero-copy,
.hero-card,
.section-card,
.results-panel {
  animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  display: grid;
  align-content: center;
  gap: 18px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(200, 111, 52, 0.28) 0%, rgba(200, 111, 52, 0.08) 45%, transparent 72%);
}

.eyebrow,
.card-kicker,
.section-tag {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.eyebrow {
  color: rgba(246, 240, 228, 0.68);
}

.hero h1 {
  margin: 0;
  max-width: 11ch;
  color: #f9f5ee;
  font-family: "Bitter", "Georgia", serif;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.subhead {
  margin: 0;
  max-width: 42rem;
  color: rgba(246, 240, 228, 0.78);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(246, 240, 228, 0.18);
  background: rgba(11, 16, 11, 0.18);
  color: #f6f0e4;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.hero-card,
.section-card,
.results-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(54, 42, 28, 0.18);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(249, 243, 231, 0.98) 0%, rgba(235, 224, 207, 0.94) 100%);
  display: grid;
  gap: 18px;
}

.hero-card::before,
.section-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--sage-500), var(--rust-500), transparent 70%);
}

.card-kicker,
.section-tag {
  color: var(--ink-500);
}

.hero-card h2,
.section-heading h2,
.results-copy h2 {
  margin: 0;
  font-family: "Bitter", "Georgia", serif;
  line-height: 1.08;
}

.hero-card h2 {
  font-size: 2rem;
}

.hero-card-copy,
.hero-note,
.section-heading p,
.results-copy p:last-child {
  margin: 0;
  color: var(--ink-700);
  line-height: 1.55;
}

.profile-stats {
  margin: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-stats div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(54, 42, 28, 0.1);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.profile-stats dt {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.profile-stats dd {
  margin: 0;
  color: var(--ink-900);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
}

.form {
  display: grid;
  gap: 20px;
}

.form > *:nth-child(2) {
  animation-delay: 0.06s;
}

.form > *:nth-child(3) {
  animation-delay: 0.12s;
}

.form > *:nth-child(4) {
  animation-delay: 0.18s;
}

.form > *:nth-child(5) {
  animation-delay: 0.24s;
}

.section-card,
.results-panel {
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--paper-strong) 0%, var(--paper) 100%);
}

.section-card {
  display: grid;
  gap: 22px;
}

.section-heading,
.results-copy,
.summary-copy {
  display: grid;
  gap: 8px;
}

.section-heading h2,
.results-copy h2,
.summary-copy h2 {
  font-size: 1.7rem;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-900);
}

.helper {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

input,
select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-900);
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

input::placeholder {
  color: var(--ink-500);
}

input:hover,
select:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(200, 111, 52, 0.7);
  box-shadow: 0 0 0 4px rgba(200, 111, 52, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  background: #fffdfa;
}

select {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-500) 50%),
    linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.checkbox {
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(54, 42, 28, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--forest-800);
  box-shadow: none;
}

.checkbox .helper {
  margin-top: 0;
}

.advanced {
  padding: 0;
}

.advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px;
  cursor: pointer;
  list-style: none;
}

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

.summary-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(54, 42, 28, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink-700);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.summary-indicator::before {
  content: "+";
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
}

.advanced[open] .summary-indicator::before {
  content: "-";
}

.advanced > .grid {
  padding: 0 26px 26px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 4px 4px 0;
}

button {
  border: none;
  border-radius: 16px;
  padding: 15px 22px;
  background: linear-gradient(135deg, var(--rust-500), var(--rust-600));
  color: #fff8f1;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(170, 87, 37, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px rgba(170, 87, 37, 0.34);
  filter: saturate(1.06);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: 3px solid rgba(200, 111, 52, 0.22);
  outline-offset: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  color: var(--ink-700);
  font-weight: 600;
}

.status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-500);
  box-shadow: 0 0 0 4px rgba(125, 114, 101, 0.15);
}

.status[data-state="working"]::before {
  background: var(--rust-500);
  box-shadow: 0 0 0 4px rgba(200, 111, 52, 0.18);
}

.status[data-state="ready"]::before {
  background: var(--sage-500);
  box-shadow: 0 0 0 4px rgba(139, 148, 97, 0.18);
}

.status[data-state="error"]::before {
  background: #a33c2f;
  box-shadow: 0 0 0 4px rgba(163, 60, 47, 0.16);
}

.results-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
}

.download {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink-500);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  pointer-events: none;
}

.download.ready {
  pointer-events: auto;
  border-color: rgba(24, 33, 23, 0.2);
  background: linear-gradient(135deg, var(--forest-800), var(--forest-900));
  color: #fffaf4;
  box-shadow: 0 16px 28px rgba(24, 33, 23, 0.24);
}

.download.ready:hover {
  transform: translateY(-1px);
}

.preview-frame {
  padding: 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(28, 38, 27, 0.92), rgba(20, 26, 20, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

iframe {
  display: block;
  width: 100%;
  min-height: 740px;
  border: none;
  border-radius: 16px;
  background: #d7d0c4;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .hero h1 {
    max-width: none;
  }

  iframe {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px 14px 48px;
    gap: 18px;
  }

  .hero-copy,
  .hero-card,
  .section-card,
  .results-panel {
    padding: 22px;
    border-radius: 24px;
  }

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

  .advanced summary {
    padding: 22px;
    flex-direction: column;
    align-items: flex-start;
  }

  .advanced > .grid {
    padding: 0 22px 22px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .actions {
    align-items: stretch;
  }

  button,
  .download {
    width: 100%;
    justify-content: center;
  }

  iframe {
    min-height: 420px;
  }
}

@media (max-width: 480px) {
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .hero-badges {
    gap: 8px;
  }

  .hero-badges span {
    width: 100%;
  }
}
