/* =========================================================
   Scan Foundry styles
   The colours are defined once here, so you can change the
   whole look by editing these few lines.
   ========================================================= */
:root {
  --background: #0e1013;   /* page background (near black) */
  --panel: #171a1f;        /* card background */
  --border: #2a2f37;       /* thin lines around cards */
  --text: #e8eaed;         /* main text */
  --text-dim: #9aa1ab;     /* secondary text */
  --accent: #ff7a1a;       /* molten orange highlight */
  --accent-hover: #ff9447;
}

/* ----- Basic page setup ----- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ----- Top bar ----- */
/* Light strip so the dark parts of the logo are readable */
.site-header {
  background: #f4f5f7;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  text-align: center;   /* centres the logo */
}

.logo {
  display: inline-block;
}

.logo img {
  display: block;
  height: 170px;   /* logo height on computers */
  width: auto;
  max-width: 100%; /* never wider than the screen */
  /* Soft light glow that follows the logo's shape, so the
     dark "Scan" lettering and tagline stand out on black.
     The first glow is a tight outline; the second is a wider haze. */
  filter:
    drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
}

@media (max-width: 600px) {
  .logo img {
    height: auto;  /* on phones, fit the screen width instead */
  }
}

/* ----- Intro section ----- */
.hero {
  padding: 64px 0 40px;
  background:
    linear-gradient(rgba(255, 122, 26, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 122, 26, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;   /* faint "blueprint" grid */
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.2;
  margin: 0 0 16px;
  max-width: 700px;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 0 20px;
}

.intro-banner {
  display: inline-block;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem !important;
}

/* ----- Shop grid ----- */
.section-title {
  margin: 48px 0 24px;
  font-size: 1.4rem;
}

.scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 64px;
}

.scan-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scan-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.scan-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.scan-info h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.description {
  color: var(--text-dim);
  margin: 0 0 16px;
}

/* "What's included" list */
.included {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-size: 0.92rem;
}

.included li {
  padding: 4px 0 4px 22px;
  position: relative;
}

.included li::before {
  content: "\2713";   /* tick mark */
  color: var(--accent);
  position: absolute;
  left: 0;
}

/* Price and Buy button */
.buy-row {
  margin-top: auto;   /* pushes this row to the bottom of the card */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.price {
  display: flex;
  flex-direction: column;
}

.price-amount {
  font-size: 1.5rem;
  font-weight: 700;
}

.price-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.buy-button {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.buy-button:hover {
  background: var(--accent-hover);
}

.buy-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ----- Navigation links under the logo ----- */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 6px;
}

.site-nav a {
  color: #1a1d22;   /* dark, to read on the light header strip */
  text-decoration: none;
  font-weight: 600;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

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

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* ----- Book a scan page ----- */
.book-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 64px;
}

@media (min-width: 900px) {
  .book-page {
    grid-template-columns: 2fr 3fr;   /* explanation beside the form */
    align-items: start;
  }
}

.book-intro h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 12px;
}

.book-lead {
  font-size: 1.15rem;
  margin: 0 0 20px;
}

.book-price {
  font-size: 1.3rem;
  margin: 8px 0;
}

.book-price strong {
  color: var(--accent);
  font-size: 1.6rem;
}

.book-note {
  color: var(--text-dim);
}

.book-form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.book-form-panel h2 {
  margin: 0 0 4px;
}

.form-hint {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}

legend {
  font-weight: 700;
  margin-bottom: 10px;
  padding: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid-3 {
    grid-template-columns: 1fr 1fr 0.6fr;
  }
}

.book-form-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.book-form-panel label.full-width {
  margin-bottom: 20px;
}

.book-form-panel input,
.book-form-panel textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.book-form-panel input:focus,
.book-form-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.book-form-panel textarea {
  resize: vertical;
}

.request-email {
  margin-top: 16px;
}

.field-note {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* "Can't find the vehicle?" box at the bottom of the shop */
.request-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin: 0 0 64px;
  padding: 18px 20px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
}

.request-prompt p {
  margin: 0;
}

/* The hidden spam trap */
.trap {
  position: absolute;
  left: -9999px;
}

.submit-button {
  width: 100%;
}

.form-status {
  margin: 14px 0 0;
  min-height: 1.5em;
}

.form-status.ok {
  color: #5fd38d;
}

.form-status.error {
  color: #ff6b6b;
}

/* ----- Search and filters ----- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.browse {
  margin: 40px 0 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-box {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

.filter-row[hidden] {
  display: none;
}

.filter-label {
  flex: 0 0 56px;
  padding-top: 7px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
  font-weight: 600;
}

.chip-count {
  opacity: 0.6;
  font-size: 0.85em;
  margin-left: 2px;
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin: 8px 0 8px;
}

.breadcrumb {
  font-size: 0.95rem;
  color: var(--text-dim);
}

.breadcrumb a {
  color: var(--text);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.crumb-sep {
  margin: 0 6px;
  color: var(--text-dim);
}

.result-count {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ----- Make and model groups ----- */
.make-group {
  margin: 32px 0 48px;
}

.make-heading {
  font-size: 1.6rem;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.make-heading a,
.model-heading a {
  color: var(--text);
  text-decoration: none;
}

.make-heading a:hover,
.model-heading a:hover {
  color: var(--accent);
}

.model-group {
  margin-top: 24px;
}

.model-heading {
  font-size: 1.2rem;
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.group-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
}

.model-group .scan-grid {
  margin-bottom: 0;
}

.no-results {
  padding: 48px 0;
  text-align: center;
  color: var(--text-dim);
}

/* Small "Toyota · Hi-Ace" line above titles */
.card-kicker {
  margin: 0 0 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.card-type {
  margin: -6px 0 10px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.card-type::first-letter {
  text-transform: uppercase;
}

/* Make / Model / Year / Variant on the product page */
.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.spec-list dt {
  color: var(--text-dim);
}

.spec-list dd {
  margin: 0;
}

/* ----- Links on the shop cards ----- */
.card-image-link {
  display: block;
}

.scan-info h3 a {
  color: var(--text);
  text-decoration: none;
}

.scan-info h3 a:hover {
  color: var(--accent);
}

.details-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 4px;
}

.details-link:hover {
  text-decoration: underline;
}

/* ----- Product page ----- */
.product-page {
  padding-top: 24px;
  padding-bottom: 64px;
}

.product-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .product-top {
    grid-template-columns: 3fr 2fr;   /* gallery wider than the details */
  }
}

.gallery-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;   /* show the whole photo, never crop it */
  display: block;
}

/* The big photo is a button that opens the enlarged view */
button.gallery-main {
  display: block;
  width: 100%;
  padding: 0;
  position: relative;
  cursor: zoom-in;
  font: inherit;
}

button.gallery-main:hover,
button.gallery-main:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.enlarge-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  opacity: 0.85;
  pointer-events: none;
}

/* ----- Enlarged photo view (lightbox) ----- */
body.no-scroll {
  overflow: hidden;
}

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(5, 6, 8, 0.92);
}

.lb-figure {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 16px 24px;
}

.lb-figure img {
  max-width: min(94vw, 1800px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 4px;
  touch-action: pan-y;   /* let our swipe handle left/right */
  user-select: none;
}

.lb-figure figcaption {
  font-size: 0.9rem;
  color: #c9ccd1;
}

.lb-close,
.lb-arrow {
  position: absolute;
  border: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close:hover,
.lb-arrow:hover,
.lb-close:focus-visible,
.lb-arrow:focus-visible {
  background: var(--accent);
  color: #111;
  outline: none;
}

.lb-close {
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
}

.lb-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2.2rem;
  line-height: 1;
  padding-bottom: 4px;
}

.lb-prev { left: 14px; }
.lb-next { right: 14px; }

@media (max-width: 600px) {
  .lb-arrow {
    top: auto;
    bottom: 16px;
    transform: none;
    width: 46px;
    height: 46px;
  }
}

/* Row of small pictures under the main photo, sharing the width evenly */
.thumbnails {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;   /* scrolls sideways if there are lots of photos */
}

.thumb {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
}

.thumb.active,
.thumb:hover {
  border-color: var(--accent);
}

.thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.product-info h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
  margin: 0 0 12px;
}

.small-heading {
  font-size: 1rem;
  margin: 8px 0;
}

.viewer-section {
  margin-top: 48px;
}

.viewer-section .section-title {
  margin-top: 0;
}

model-viewer,
.viewer-placeholder {
  width: 100%;
  height: min(70vh, 560px);
  background: radial-gradient(circle at 50% 40%, #3a3f47, #1a1d22);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.viewer-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.viewer-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Camera angle tuner (only shown with &tune in the address) */
.tune-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.tune-panel p {
  margin: 0;
  flex-basis: 100%;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.tune-panel code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.05rem;
  background: var(--panel);
  padding: 6px 10px;
  border-radius: 4px;
  user-select: all;
}

.tune-panel button {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ----- Mailing list sign-up ----- */
.newsletter-row {
  display: flex;
  gap: 8px;
  max-width: 460px;
}

.newsletter-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.newsletter-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-button {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 700;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
}

.newsletter-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.newsletter-heading {
  margin: 0 0 10px;
  color: var(--text);
}

.newsletter-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.newsletter-note a {
  color: var(--text-dim);
}

.newsletter-status {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

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

.newsletter-status.ok {
  color: #5fd38d;
}

.newsletter-status.error {
  color: #ff6b6b;
}

.footer-newsletter {
  padding-bottom: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.home-newsletter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 32px;
  align-items: center;
  margin: 0 0 64px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (min-width: 900px) {
  .home-newsletter {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .home-newsletter {
    padding: 20px 16px;
  }
}

.home-newsletter h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.home-newsletter p {
  margin: 0;
  color: var(--text-dim);
}

.home-newsletter .newsletter-note {
  margin-top: 8px;
}

.unsubscribe-form {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin-top: 20px;
}

.unsubscribe-form input {
  flex: 1;
  font: inherit;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

/* ----- Footer policy links ----- */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 8px;
}

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ----- Policy pages ----- */
.legal {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 64px;
}

.legal h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 0 0 4px;
}

.legal h2 {
  font-size: 1.2rem;
  margin: 32px 0 8px;
}

.legal p,
.legal li {
  color: #cfd3d8;
}

.legal li {
  margin-bottom: 6px;
}

.legal a {
  color: var(--accent);
}

.legal-updated {
  color: var(--text-dim) !important;
  font-size: 0.9rem;
  margin-top: 0;
}

.legal-summary {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 18px;
  margin: 24px 0;
}

.contact-email {
  font-size: 1.3rem;
  font-weight: 700;
}

.field-note a {
  color: var(--accent);
}

/* ----- Price, "I agree" tick box and Buy button ----- */
.buy-area {
  margin-top: auto;   /* sits at the bottom of each card */
}

.buy-area .buy-row {
  margin-top: 0;
}

.terms-tick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--text-dim);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.terms-tick input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.terms-tick a {
  color: var(--accent);
}

/* Highlight the box if Buy is clicked before ticking */
.needs-tick .terms-tick {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.25);
}

.buy-area .buy-button {
  width: 100%;
}

.buy-error {
  margin: 8px 0 0;
  min-height: 0;
  font-size: 0.88rem;
  color: #ff6b6b;
}

.buy-error:empty {
  display: none;
}

/* ----- Thank-you page ----- */
.thank-you {
  padding: 80px 16px;
  min-height: 60vh;
}

.thank-you h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 0 0 16px;
}

.thank-you p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 600px;
}

.download-button {
  display: inline-block;
  margin: 8px 0 16px;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 14px 32px;
}

.thank-you .download-note {
  font-size: 0.95rem;
  margin: 6px 0;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent);
  text-decoration: none;
}

/* ----- Bottom bar ----- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}
