:root {
  --bg: #f3f5f8;
  --bg-soft: #ffffff;
  --ink: #142033;
  --ink-soft: #5f6c7f;
  --line: rgba(20, 32, 51, 0.1);
  --brand: #1f4f91;
  --brand-deep: #153665;
  --accent: #0f766e;
  --accent-soft: #d9f0ec;
  --gold: #c9a45c;
  --card: rgba(255, 255, 255, 0.9);
  --card-strong: #ffffff;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.05);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 79, 145, 0.08), transparent 16%),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fa 48%, #eef2f7 100%);
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 100% 72px;
  content: "";
  opacity: 0.18;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 75%);
}

.shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.topbar,
.site-footer,
.panel,
.mini-panel,
.hero-card,
.listing-card,
.message-card,
.chart-card,
.stat-card {
  backdrop-filter: blur(18px);
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(20, 32, 51, 0.06);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), #3d6fb4);
  color: #f8fbff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(31, 79, 145, 0.22);
}

.brand strong,
h1,
h2,
h3 {
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.brand small {
  display: block;
  color: var(--ink-soft);
}

.desktop-nav {
  display: inline-flex;
  gap: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 32, 51, 0.04);
}

.desktop-nav a,
.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
}

.desktop-nav a.active-link,
.mobile-nav a.active-link {
  color: var(--brand-deep);
  font-weight: 700;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 51, 0.06);
}

.desktop-nav a:hover,
.footer-links a:hover {
  color: var(--brand-deep);
}

.topbar-actions {
  display: inline-flex;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.primary-button,
.ghost-button,
.pill {
  padding: 12px 18px;
  min-height: 46px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), #295ea9);
  color: #f7fbff;
  box-shadow: 0 14px 28px rgba(31, 79, 145, 0.2);
}

.ghost-button {
  background: rgba(20, 32, 51, 0.05);
  color: var(--ink);
  border: 1px solid rgba(20, 32, 51, 0.08);
}

.app-grid {
  display: grid;
  gap: 26px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: stretch;
}

.hero-card,
.panel,
.mini-panel,
.chart-card,
.stat-card,
.listing-card,
.message-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 254, 0.95));
  border: 1px solid rgba(20, 32, 51, 0.06);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 44px;
  border-radius: var(--radius-xl);
}

.hero-card::after {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 44px;
  background:
    radial-gradient(circle at 35% 35%, rgba(31, 79, 145, 0.12), transparent 50%),
    radial-gradient(circle at 65% 65%, rgba(201, 164, 92, 0.1), transparent 44%);
  transform: rotate(8deg);
  content: "";
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 79, 145, 0.06);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 20px 0 18px;
  max-width: 10ch;
  font-size: clamp(2.8rem, 4.2vw, 5rem);
  line-height: 0.98;
}

.hero p {
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.hero-actions,
.stack,
.chip-row,
.stat-grid,
.dual-grid,
.triple-grid,
.quad-grid,
.mobile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 24px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.mini-panel,
.stat-card {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.mini-panel strong,
.stat-card strong {
  display: block;
  font-size: 1.55rem;
  margin-top: 10px;
}

.hero-preview {
  display: grid;
  gap: 18px;
}

.phone-mock {
  min-height: 540px;
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(180deg, #172235, #0f1827);
  color: #f4f7fb;
  box-shadow: 0 24px 56px rgba(8, 15, 28, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-header,
.bar,
.price-line,
.message-line,
.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.camera-box,
.listing-thumb {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 28% 34%, rgba(31, 79, 145, 0.5), transparent 42%),
    radial-gradient(circle at 72% 64%, rgba(201, 164, 92, 0.32), transparent 34%),
    linear-gradient(180deg, #243247, #121c2b);
}

.camera-box {
  position: relative;
  min-height: 210px;
  margin: 18px 0;
  overflow: hidden;
}

.camera-box::after {
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 250, 242, 0.62);
  border-radius: 14px;
  content: "";
}

.camera-box::before {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 66px;
  height: 66px;
  margin: -33px 0 0 -33px;
  border: 1px solid rgba(255, 250, 242, 0.75);
  border-radius: 999px;
  content: "";
}

.phone-pill,
.status-badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
}

.phone-pill {
  background: rgba(255, 255, 255, 0.1);
}

.status-badge.available {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
}

.status-badge.hold {
  background: rgba(232, 187, 74, 0.18);
  color: #8c5a00;
}

.status-badge.sold {
  background: rgba(146, 34, 52, 0.12);
  color: var(--brand-deep);
}

.layout-section {
  display: grid;
  gap: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 0 4px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.section-head h1,
.section-head h2 {
  margin: 0;
}

.panel {
  padding: 30px;
  border-radius: var(--radius-xl);
}

.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.triple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.search-shell {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(245, 248, 252, 0.92);
  border: 1px solid rgba(20, 32, 51, 0.08);
}

.search-shell input,
.search-shell select,
.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chart-card,
.listing-card,
.message-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.chart {
  position: relative;
  height: 180px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(20, 32, 51, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 51, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(240, 244, 249, 0.6));
  background-size: 100% 33%, 20% 100%, 100% 100%;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 51, 0.06);
}

.chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.listing-card {
  display: grid;
  gap: 14px;
}

.listing-thumb {
  min-height: 168px;
}

.market-row,
.price-line,
.message-line {
  gap: 14px;
}

.tag {
  background: rgba(20, 32, 51, 0.06);
  color: var(--ink);
}

.muted {
  color: var(--ink-soft);
}

h1,
h2,
h3,
p {
  text-wrap: balance;
}

p {
  margin: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 30px;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(17, 28, 45, 0.96), rgba(11, 20, 34, 0.98));
  color: #f3f7fc;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(243, 247, 252, 0.8);
}

.mobile-nav {
  display: none;
}

.mobile-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
}

@media (max-width: 980px) {
  .hero,
  .dual-grid,
  .triple-grid,
  .quad-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .desktop-nav,
  .topbar-actions {
    display: none;
  }

  .topbar {
    border-radius: 28px;
  }

  .mobile-nav {
    display: flex;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 100%);
    padding-top: 10px;
  }

  .hero-card,
  .panel,
  .site-footer {
    padding: 20px;
  }

  .phone-mock {
    min-height: 480px;
  }

  .search-shell {
    flex-direction: column;
  }
}
