﻿:root {
  --ink: #171717;
  --muted: #5d625d;
  --paper: #f7f4ed;
  --white: #ffffff;
  --line: #d7d0c3;
  --red: #b6252a;
  --red-dark: #7e1519;
  --green: #1f5b48;
  --gold: #c28c2c;
  --shadow: 0 18px 60px rgba(20, 18, 15, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 16px clamp(16px, 4vw, 48px);
  color: var(--ink);
  background: transparent;
  pointer-events: none;
  transition: padding 180ms ease;
}

.brand,
.site-header a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  width: clamp(180px, 22vw, 250px);
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(31, 91, 72, 0.22);
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 8px 22px rgba(20, 18, 15, 0.12);
  pointer-events: auto;
  transition: width 180ms ease, padding 180ms ease, box-shadow 180ms ease;
}

.brand img {
  width: 100%;
  height: auto;
}

.site-header.is-compact {
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-header.is-compact .brand {
  width: clamp(128px, 13vw, 158px);
  padding: 5px 7px;
  box-shadow: 0 7px 18px rgba(20, 18, 15, 0.14);
}

.hero {
  min-height: 86vh;
  display: grid;
  align-items: end;
  padding: 120px clamp(18px, 6vw, 76px) 64px;
  color: var(--white);
  background: url("assets/hero-historic-paddock.png") center right / cover;
}

.hero-content {
  width: min(760px, 100%);
}

.hero .eyebrow,
.hero h1,
.hero-text {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

.hero-text {
  max-width: 640px;
  margin: 24px 0 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-actions,
.form-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button.primary {
  color: var(--white);
  background: var(--red);
}

.button.primary:hover {
  background: var(--red-dark);
}

.button.secondary {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

.hero .button.secondary {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.44);
}

.button.ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.section {
  padding: 76px clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.service-section .section-heading {
  max-width: 1120px;
}

.section-heading.compact {
  margin-bottom: 26px;
}

.section-heading h2,
.result-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-heading p {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.service-section {
  position: relative;
  overflow: hidden;
  background: #f6f1e7;
}

.service-section::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(52vw, 760px);
  opacity: 0.36;
  pointer-events: none;
  background:
    linear-gradient(90deg, #f6f1e7 0%, rgba(246, 241, 231, 0.16) 36%, rgba(246, 241, 231, 0) 100%),
    url("assets/asphalt-tire-track-section.jpg") center right / cover no-repeat;
}

.service-section .section-heading,
.service-grid {
  position: relative;
  z-index: 1;
}

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

.service-item {
  min-height: 168px;
  padding: 22px;
  border: 1px solid rgba(31, 91, 72, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.92);
  box-shadow: 0 10px 24px rgba(20, 18, 15, 0.07);
}

.number {
  color: var(--red);
  font-weight: 700;
}

.service-item h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 1.24rem;
}

.service-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.video-section {
  background: #050505;
  color: var(--white);
}

.video-band {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: clamp(640px, 56.25vw, 900px);
  display: block;
  background: #050505;
}

.video-band-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #050505;
  object-fit: cover;
}

.builder-section {
  position: relative;
  overflow: hidden;
  background: #f6f1e7;
}

.builder-section::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(52vw, 760px);
  height: min(900px, 96vh);
  opacity: 0.28;
  pointer-events: none;
  background:
    linear-gradient(90deg, #f6f1e7 0%, rgba(246, 241, 231, 0.16) 36%, rgba(246, 241, 231, 0) 100%),
    url("assets/asphalt-tire-track-section.jpg") center right / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0) 100%);
}

.builder-section .section-heading,
.flow-panel {
  position: relative;
  z-index: 1;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 22px;
  align-items: start;
}

.question-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.question-panel {
  padding: clamp(18px, 3vw, 30px);
}

.result-panel {
  position: sticky;
  top: 86px;
  padding: clamp(18px, 3vw, 28px);
}

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

legend {
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  font-size: 1.25rem;
  font-weight: 700;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 700;
}

.form-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.app-status {
  scroll-margin-top: 110px;
  min-height: 46px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f7f4ed;
  font-weight: 400;
}

.app-status:empty {
  display: none;
}

.app-status.success {
  color: var(--green);
  border-color: rgba(31, 91, 72, 0.36);
  background: rgba(31, 91, 72, 0.08);
}

.app-status.error {
  color: var(--red-dark);
  border-color: rgba(182, 37, 42, 0.36);
  background: rgba(182, 37, 42, 0.08);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bbb2a4;
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fffdf8;
  font-weight: 400;
}

input::placeholder,
textarea::placeholder {
  color: #8a8f87;
  opacity: 1;
}

input[type="checkbox"] {
  width: auto;
}

.field-help {
  display: block;
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 400;
}

.inline-field {
  grid-template-columns: auto minmax(260px, 1fr);
  align-items: center;
  column-gap: 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(194, 140, 44, 0.28);
  border-color: var(--gold);
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-preview figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3efe6;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: var(--white);
  background: rgba(23, 23, 23, 0.76);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.photo-remove:hover {
  background: var(--red-dark);
}

.photo-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.photo-preview figcaption {
  padding: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.result-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

#generatedStory {
  min-height: 520px;
  line-height: 1.62;
}

.offer-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: #f5f1e8;
  font-weight: 700;
}

.print-story {
  display: none;
  white-space: pre-wrap;
  line-height: 1.62;
}

.site-footer {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 5vw, 72px);
  color: var(--paper);
  background: linear-gradient(135deg, #173d32 0%, #171717 72%);
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--paper);
  text-decoration: none;
}

.footer-brand-block {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.footer-contact-block {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 7px;
}

.footer-brand-block img {
  flex: 0 0 auto;
  width: 112px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 250, 242, 0.24);
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.footer-brand-block p,
.footer-contact-block p {
  max-width: 480px;
  color: rgba(247, 244, 237, 0.82);
  font-size: 0.9rem;
  line-height: 1.25;
}

.footer-email-row {
  min-height: 20px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  line-height: 1.2;
}

.footer-email {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 400;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0;
}

.footer-links a {
  color: rgba(247, 244, 237, 0.66);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-copy-status {
  min-width: 74px;
  text-align: right;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 400;
}

.legal-main {
  min-height: 100vh;
  padding: 120px clamp(18px, 6vw, 76px) 70px;
  background: #f6f1e7;
}

.legal-page {
  width: min(920px, 100%);
  margin: 0 auto;
}

.legal-page h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.02;
}

.legal-title-single {
  font-size: clamp(1.9rem, 4vw, 3.35rem);
  white-space: nowrap;
}

.legal-page h2 {
  margin: 34px 0 10px;
  color: var(--green);
  font-size: 1.35rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.legal-page section {
  padding: 22px 0;
  border-top: 1px solid rgba(31, 91, 72, 0.16);
}

.legal-note {
  padding: 14px 16px;
  border: 1px solid rgba(194, 140, 44, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(194, 140, 44, 0.1);
}

.legal-back-link {
  margin: 26px 0 0;
}

.legal-back-link a {
  color: var(--green);
  font-weight: 700;
  text-underline-offset: 4px;
}

@media (max-width: 920px) {
  .site-header {
    position: absolute;
  }

  .service-section::after {
    width: 100%;
    opacity: 0.18;
  }

  .builder-section::after {
    width: 100%;
    height: 620px;
    opacity: 0.14;
  }

  .service-grid,
  .builder-layout,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

@media (min-width: 921px) {
  .service-section .section-heading h2 {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .video-band {
    min-height: 360px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .site-footer {
    gap: 14px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .footer-brand-block {
    align-items: flex-start;
  }

  .footer-brand-block img {
    width: 96px;
  }

  .footer-contact-block {
    justify-items: end;
  }

  .footer-email-row {
    justify-content: flex-end;
  }

  .contact-copy-status {
    text-align: right;
  }

  .footer-links {
    justify-content: flex-end;
  }

  .site-header.is-compact {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .site-header.is-compact .brand {
    width: clamp(180px, 22vw, 250px);
    padding: 7px 10px;
    box-shadow: 0 8px 22px rgba(20, 18, 15, 0.12);
  }

  .hero {
    min-height: 84vh;
    padding-top: 142px;
    background-position: 56% center;
  }

  .legal-title-single {
    white-space: normal;
  }

  .section {
    padding-top: 54px;
    padding-bottom: 54px;
  }

  .service-item {
    min-height: auto;
  }

  .service-section::after {
    opacity: 0.1;
  }

  .builder-section::after {
    height: 500px;
    opacity: 0.08;
  }

  .button {
    width: 100%;
  }
}

@media print {
  .site-header,
  .hero,
  .service-section,
  .video-section,
  .question-panel,
  .result-actions,
  .app-status,
  .site-footer,
  .offer-summary,
  .eyebrow {
    display: none !important;
  }

  body {
    background: white;
  }

  .section,
  .result-panel {
    display: block;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  #generatedStory {
    display: none;
  }

  .print-story {
    display: block;
  }
}

/* Progressive video flow */
.flow-panel {
  width: min(940px, 100%);
  margin: 0 auto;
}

.step-card {
  scroll-margin-top: 110px;
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(31, 91, 72, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.95);
  box-shadow: 0 10px 24px rgba(20, 18, 15, 0.07);
}

.step-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.step-title h3 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.1;
}

.step-title p,
.validation-panel p {
  margin: 0;
  color: var(--muted);
}

.step-number {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--green);
  font-weight: 700;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question-list {
  display: grid;
  gap: 18px;
}

.compact-actions {
  margin-top: 18px;
}

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

.offer-card {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--ink);
  background: #fffdf8;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.offer-card:hover {
  transform: translateY(-1px);
}

.offer-card.selected {
  border-color: var(--red);
  background: rgba(182, 37, 42, 0.07);
}

.offer-card strong {
  font-size: 1.35rem;
}

.offer-card span {
  color: var(--muted);
  font-weight: 700;
}

.offer-card b {
  color: var(--red-dark);
  font-size: 1.3rem;
}

.generated-step textarea {
  min-height: 420px;
  line-height: 1.65;
}

.generated-step .form-actions {
  margin-bottom: 18px;
}

.validation-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(31, 91, 72, 0.24);
  border-radius: 8px;
  background: rgba(31, 91, 72, 0.07);
}

.validation-panel[hidden] {
  display: none;
}

.payment-panel {
  scroll-margin-top: 110px;
  width: min(940px, 100%);
  margin: 18px auto 0;
  background: rgba(255, 250, 242, 0.95);
  box-shadow: 0 10px 24px rgba(20, 18, 15, 0.07);
}

.validation-panel h3 {
  margin: 0;
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 700;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 400;
}

.checkbox-line input {
  flex: 0 0 auto;
  margin-top: 4px;
}

.checkbox-line a {
  color: var(--green);
  font-weight: 400;
}

@media (max-width: 760px) {
  .field-grid.two-cols,
  .offer-options {
    grid-template-columns: 1fr;
  }

  .step-title {
    gap: 10px;
  }

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

.research-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(31, 91, 72, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(31, 91, 72, 0.07);
}

.research-result strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
}

.research-result p {
  margin: 0 0 10px;
  color: var(--muted);
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
}

.source-links a {
  color: var(--green);
  font-weight: 700;
}

.compact-question-list textarea {
  min-height: 92px;
}





.extra-questions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.extra-questions[hidden] {
  display: none;
}

.test-example-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.test-example-button.active {
  color: var(--white);
  border-color: var(--green);
  background: var(--green);
}



.button.is-loading {
  gap: 10px;
  cursor: wait;
}

.button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.step-card {
  padding: 0;
}

.step-title {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.step-title:hover {
  background: rgba(31, 91, 72, 0.045);
}

.step-card.is-open .step-title {
  border-bottom: 1px solid rgba(31, 91, 72, 0.14);
  border-radius: 8px 8px 0 0;
}

.step-title-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.step-heading {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.step-description {
  color: var(--muted);
  font-weight: 400;
}

.step-body {
  padding: clamp(18px, 3vw, 30px);
}

.step-intro {
  margin: 0 0 18px;
  color: var(--muted);
}

.step-card:not(.is-open) .step-body {
  display: none;
}
