@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/barlow-600.ttf") format("truetype");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/barlow-700.ttf") format("truetype");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/public-400.ttf") format("truetype");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/public-500.ttf") format("truetype");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/public-600.ttf") format("truetype");
}

:root {
  --ink: #e8ece4;
  --muted: rgba(232, 236, 228, 0.72);
  --faint: rgba(232, 236, 228, 0.48);
  --paper: #f3eee2;
  --forest: #102d27;
  --forest-2: #0c1c22;
  --good: #9dcea8;
  --warn: #e2c07a;
  --danger: #e08b7c;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --sans: "Public Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { height: 100%; overflow-x: hidden; }
body {
  min-height: 100%;
  min-height: 100dvh;
  font: 16px/1.45 var(--sans);
  color: var(--ink);
  background: var(--forest-2);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, a, .btn, .text-btn, .aiq-suggest-item { touch-action: manipulation; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-photo,
.hero-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.hero-photo {
  background: url("/media/hero.jpg") 72% 58% / cover no-repeat;
  filter: saturate(1.04) brightness(1);
  transition: filter 2.8s cubic-bezier(0.22, 1, 0.36, 1), background-image 0.9s ease;
}
.sun {
  position: fixed;
  left: 18%;
  top: 36%;
  z-index: 0;
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translateY(90px) scale(0.55);
  background: radial-gradient(circle, #fff6d4 0%, #ffc56a 28%, rgba(255, 120, 48, 0.35) 52%, rgba(255, 90, 20, 0) 70%);
  filter: blur(1px);
  transition: opacity 2.8s ease, transform 2.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-veil {
  background:
    linear-gradient(90deg, rgba(6, 10, 14, 0.88) 0%, rgba(6, 10, 14, 0.72) 38%, rgba(6, 10, 14, 0.28) 62%, rgba(6, 10, 14, 0.45) 100%),
    linear-gradient(180deg, rgba(6, 10, 14, 0.45) 0%, transparent 30%, rgba(6, 10, 14, 0.62) 100%);
  transition: background 2.8s ease;
}
body.sunrise .hero-photo {
  filter: saturate(1.18) brightness(1.32) sepia(0.28) hue-rotate(-22deg) contrast(1.06);
}
body.sunrise .sun {
  opacity: 1;
  transform: translateY(0) scale(1);
}
body.sunrise .hero-veil {
  background:
    linear-gradient(90deg, rgba(18, 10, 8, 0.82) 0%, rgba(28, 14, 8, 0.58) 36%, rgba(40, 18, 10, 0.22) 64%, rgba(18, 10, 8, 0.4) 100%),
    linear-gradient(180deg, rgba(255, 176, 92, 0.18) 0%, transparent 36%, rgba(12, 8, 6, 0.55) 100%);
}

.frame {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    max(20px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  max-width: 1280px;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.place {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f4f1ea;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}
.product {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.top-link {
  color: inherit;
  text-decoration: none;
}
.top-link:hover { text-decoration: underline; }

.body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 32px;
  max-width: 720px;
}

h1 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 600;
  font-style: normal;
  font-size: clamp(56px, 8.2vw, 104px);
  line-height: 0.88;
  letter-spacing: -0.014em;
  text-transform: uppercase;
  color: #f4f1ea;
  text-wrap: pretty;
  max-width: 11ch;
  hyphens: none;
  overflow-wrap: normal;
  word-break: keep-all;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}
.lede {
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.5;
  color: rgba(244, 241, 234, 0.88);
  max-width: 38ch;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.5);
}

.lookup {
  display: flex;
  gap: 0;
  width: min(560px, 100%);
  background: var(--paper);
  border-radius: 2px;
  padding: 6px;
  position: relative;
}
.lookup input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  padding: 0 14px;
  font: 500 16px/1.2 var(--sans);
  color: var(--forest);
}
.lookup input::placeholder { color: rgba(16, 45, 39, 0.45); opacity: 1; }
.lookup input:focus { outline: none; }
.btn {
  border: 0;
  border-radius: 1px;
  height: 48px;
  padding: 0 22px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--forest);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: #163830; }
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn.full {
  width: 100%;
  max-width: 560px;
  margin-top: 8px;
}
.btn:focus-visible,
.lookup:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.text-btn {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 14px;
  font: 500 13px var(--sans);
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(232, 236, 228, 0.35);
}
.text-btn:hover { text-decoration-color: currentColor; }
.err { color: var(--danger); font-size: 13.5px; margin: 10px 0 0; }

.found { font-size: 13px; color: var(--faint); margin: 0 0 6px; }
.found b { color: var(--ink); font-weight: 600; }
.found.meta { margin-top: 6px; }

.meter { margin: 16px 0 8px; max-width: 560px; }
.meter-row { margin: 0 0 16px; }
.meter-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
}
.meter-top span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.meter-top b {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.9;
  color: var(--ink);
}
.track {
  height: 2px;
  background: rgba(232, 236, 228, 0.18);
}
.fill {
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.fill.sale { background: var(--warn); }

.status {
  display: inline-block;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warn);
  margin: 4px 0 8px;
}
.status.not_high { color: var(--good); }
.status.facts { color: var(--faint); }
.status.close { color: var(--muted); }

.result-card {
  background: var(--paper);
  color: var(--forest);
  padding: 20px 20px 18px;
  max-width: 480px;
  border-radius: 2px;
}
.result-card .found,
.result-card .why,
.result-card .found.meta { color: rgba(16, 45, 39, 0.62); }
.result-card .found b { color: var(--forest); }
.result-card .meter-top span { color: rgba(16, 45, 39, 0.55); }
.result-card .meter-top b { color: var(--forest); }
.result-card .track { background: rgba(16, 45, 39, 0.12); }
.result-card .fill { background: var(--forest); }
.result-card .fill.sale { background: #8a6a32; }
.result-card .delta { color: var(--forest); }
.result-card .status {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 6px 10px;
  border-radius: 2px;
  letter-spacing: 0.1em;
  color: var(--forest);
  background: rgba(16, 45, 39, 0.08);
}
.result-card .status.maybe_high { background: #e8c56a; color: #3a2a08; }
.result-card .status.not_high,
.result-card .status.close { background: #c5d9c4; color: #14301c; }
.result-card .status.not_found { background: #ddd6c8; color: #3a3428; }
.result-card .status.facts { background: #d7e0dc; color: #1a332c; }
.result-card .text-btn { color: var(--forest); }
.result-card .btn { margin-top: 8px; }

.why { margin: 0 0 16px; color: var(--muted); font-size: 15px; max-width: 42ch; }
.delta {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.fields {
  display: grid;
  gap: 12px;
  max-width: 420px;
}
.fields label { display: grid; gap: 6px; }
.fields label span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.fields input,
.fields select {
  height: 48px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(232, 236, 228, 0.22);
  border-radius: 2px;
  font: 500 16px var(--sans);
  background: rgba(8, 16, 20, 0.45);
  color: var(--ink);
}
.fields input:focus,
.fields select:focus {
  outline: none;
  border-color: var(--ink);
}
.fields select option { color: #102d27; }

.wait {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wait-card {
  background: var(--paper);
  color: var(--forest);
  padding: 22px 22px 20px;
  max-width: 420px;
  border-radius: 2px;
}
.wait-kicker {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(16, 45, 39, 0.5);
}
.wait-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.wait-steps li {
  position: relative;
  padding-left: 28px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(16, 45, 39, 0.32);
  transition: color 0.35s ease;
}
.wait-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(16, 45, 39, 0.18);
}
.wait-steps li.is-on {
  color: var(--forest);
}
.wait-steps li.is-on::before {
  background: #c9a227;
  animation: pulse 1.1s ease-in-out infinite;
}
.wait-steps li.is-done {
  color: rgba(16, 45, 39, 0.55);
}
.wait-steps li.is-done::before {
  background: #2f6b4a;
  animation: none;
}

.thanks h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(48px, 8vw, 72px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.thanks p { color: var(--muted); margin: 0 0 18px; max-width: 32ch; }

.foot {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(244, 241, 234, 0.7);
  max-width: 52ch;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.aiq-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  background: var(--paper);
  border: 1px solid rgba(16, 45, 39, 0.16);
  border-radius: 2px;
  overflow: auto;
  max-height: min(50vh, 320px);
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 12px 32px rgba(8, 16, 20, 0.28);
}
.aiq-suggest-item {
  padding: 12px 14px;
  min-height: 44px;
  font-size: 14px;
  color: var(--forest);
  cursor: pointer;
  border-bottom: 1px solid rgba(16, 45, 39, 0.08);
}
.aiq-suggest-item:last-child { border-bottom: none; }
.aiq-suggest-item:hover,
.aiq-suggest-item.is-active { background: rgba(16, 45, 39, 0.08); }

.door-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}
.door-form label { display: grid; gap: 6px; }
.door-form label span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.door-form select {
  height: 48px;
  width: 100%;
  padding: 0 12px;
  border: 0;
  border-radius: 2px;
  font: 500 16px var(--sans);
  background: var(--paper);
  color: var(--forest);
}
.door-form select:disabled { opacity: 0.55; }
.door-note { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.spin {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8c56a;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.rec {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 12px;
  font-size: 13px;
}
.rec th, .rec td {
  padding: 6px 0;
  border-bottom: 1px solid rgba(16, 45, 39, 0.1);
  text-align: left;
  vertical-align: top;
}
.rec th {
  width: 38%;
  font-weight: 600;
  color: rgba(16, 45, 39, 0.55);
}
.rec td { font-weight: 650; color: var(--forest); }
.rec td span { font-weight: 500; color: rgba(16, 45, 39, 0.5); }
.reasons {
  margin: 0 0 14px;
  padding-left: 18px;
  color: rgba(16, 45, 39, 0.72);
  font-size: 13px;
  line-height: 1.45;
}
.reasons li { margin: 3px 0; }

@media (max-width: 700px) {
  .frame {
    padding:
      max(14px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .hero-photo { background-position: 80% 55%; }
  .hero-veil {
    background:
      linear-gradient(180deg, rgba(6, 10, 14, 0.28) 0%, rgba(6, 10, 14, 0.08) 22%, rgba(6, 10, 14, 0.55) 58%, rgba(6, 10, 14, 0.88) 100%);
  }
  h1 {
    font-size: clamp(36px, 10vw, 48px);
    max-width: none;
    line-height: 0.92;
    hyphens: none;
    overflow-wrap: normal;
    word-break: keep-all;
  }
  .body { padding: 8px 0 10px; justify-content: flex-end; }
  .lede {
    font-size: 15px;
    line-height: 1.35;
    margin: 0 0 16px;
    max-width: 34ch;
  }
  .lookup { flex-direction: row; width: 100%; align-items: stretch; }
  .lookup input { height: 48px; font-size: 16px; padding: 0 12px; }
  .lookup .btn {
    width: auto;
    min-width: 92px;
    flex: 0 0 auto;
    padding: 0 16px;
    min-height: 48px;
  }
  .btn.full { width: 100%; max-width: 100%; }
  .top { align-items: flex-start; }
  .place { font-size: 12px; }
  .product { display: block; font-size: 11px; }
  .result-card { max-width: 100%; padding: 16px 14px 14px; }
  .rec th { width: 32%; }
  .rec td { word-break: break-word; }
  .fields { max-width: 100%; }
  .door-form { max-width: 100%; }
  .wait { font-size: 18px; }
  .foot { font-size: 10px; max-width: none; }
}

@media (max-width: 390px) {
  h1 { font-size: clamp(32px, 9.5vw, 40px); }
}

@media (prefers-reduced-motion: reduce) {
  .fill,
  .hero-photo,
  .hero-veil,
  .sun { transition: none; }
}
