* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #0a0f1a;
  --slate: #1a2035;
  --steel: #2a3550;
  --mist: #8892a8;
  --cloud: #c5cad6;
  --white: #f0f2f5;
  --amber: #e8a530;
  --amber-glow: #f4c35220;
  --amber-deep: #c78a1e;
  --risk-red: #e04848;
  --clear-green: #38b87c;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ink);
  color: var(--cloud);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(42, 53, 80, 0.4);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
}
.logo span { color: var(--amber); }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  color: var(--mist);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); text-decoration: none; }

.nav-cta {
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--amber-deep); text-decoration: none; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 40px 100px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--amber);
  border: 1px solid rgba(232, 165, 48, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
  width: fit-content;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -2px;
}

.hero h1 span { color: var(--amber); }

.hero p {
  font-size: 1.1rem;
  color: var(--mist);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 40px;
}

/* Address search */
.search-box {
  display: flex;
  gap: 0;
  max-width: 560px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  background: var(--slate);
  border: 1px solid var(--steel);
  border-right: none;
  color: var(--white);
  font-size: 1rem;
  padding: 14px 20px;
  border-radius: 8px 0 0 8px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input::placeholder { color: var(--mist); }
.search-box input:focus { border-color: var(--amber); }

.search-box button {
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 14px 28px;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.search-box button:hover { background: var(--amber-deep); }

.search-hint {
  font-size: 0.8rem;
  color: var(--mist);
}

/* Search results dropdown */
.search-results {
  background: var(--slate);
  border: 1px solid var(--steel);
  border-radius: 8px;
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--steel);
  transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--steel); }

.result-address strong { color: var(--white); font-size: 0.95rem; }
.result-meta { font-size: 0.8rem; color: var(--mist); margin-top: 2px; }
.result-value { font-size: 0.9rem; color: var(--amber); font-weight: 600; }

.search-error {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(224, 72, 72, 0.1);
  border: 1px solid rgba(224, 72, 72, 0.3);
  border-radius: 8px;
  color: var(--risk-red);
  font-size: 0.9rem;
}

/* Property profile page */
.property-page {
  min-height: 100vh;
  padding: 100px 40px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.property-header {
  margin-bottom: 36px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mist);
  font-size: 0.9rem;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--white); text-decoration: none; }

.property-address {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
  margin-bottom: 8px;
}

.property-location {
  font-size: 1rem;
  color: var(--mist);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  background: var(--slate);
  border: 1px solid var(--steel);
  border-radius: 12px;
  padding: 24px;
}

.card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--mist);
  margin-bottom: 16px;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--mist);
}

.card-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mist);
}
.card-field-value {
  font-size: 1rem;
  color: var(--white);
  font-weight: 500;
}

/* Risk flags */
.risk-section { grid-column: 1 / -1; }

.risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.risk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink);
  border-radius: 8px;
  border: 1px solid var(--steel);
}

.risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.risk-dot.high { background: var(--risk-red); box-shadow: 0 0 8px rgba(224, 72, 72, 0.5); }
.risk-dot.medium { background: #e8a530; box-shadow: 0 0 8px rgba(232, 165, 48, 0.4); }
.risk-dot.low { background: var(--clear-green); }

.risk-info strong { color: var(--white); font-size: 0.9rem; display: block; margin-bottom: 2px; }
.risk-info span { font-size: 0.8rem; color: var(--mist); }

/* Zoning */
.zoning-section { grid-column: 1 / -1; }

.zoning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.zoning-item {
  padding: 12px 16px;
  background: var(--ink);
  border-radius: 8px;
  border: 1px solid var(--steel);
}

.zoning-item-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mist);
  margin-bottom: 4px;
}
.zoning-item-value {
  font-size: 1rem;
  color: var(--white);
  font-weight: 600;
}

/* Sale history */
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mist);
  text-align: left;
  padding: 0 12px 12px 0;
  border-bottom: 1px solid var(--steel);
}
.history-table td {
  padding: 12px 12px 12px 0;
  font-size: 0.95rem;
  color: var(--white);
  border-bottom: 1px solid rgba(42, 53, 80, 0.4);
}
.history-table tr:last-child td { border-bottom: none; }

/* All-clear state */
.all-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--clear-green);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Loading state */
.search-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mist);
  font-size: 0.9rem;
  padding: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 120px 24px 80px; }
  nav { padding: 16px 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-row-grid { grid-template-columns: 1fr; }
  .search-box { flex-direction: column; }
  .search-box input, .search-box button { border-radius: 8px; }
  .search-box input { border-right: 1px solid var(--steel); margin-bottom: 8px; }
  .property-page { padding: 100px 24px 40px; }
}