/* =========================================================
   AERIE — Shared design system
   ========================================================= */

:root {
  /* Dark is default — cool charcoal with a navy tilt.
     Light theme (kept for the tweaks panel) lives on html[data-theme="light"]. */
  --bg: oklch(0.16 0.015 245);
  --bg-deep: oklch(0.12 0.015 245);
  --surface: oklch(0.20 0.018 245);
  --surface-2: rgba(255,255,255,0.04);
  --ink: oklch(0.96 0.005 245);
  --ink-muted: oklch(0.66 0.012 245);
  --ink-soft: oklch(0.46 0.014 245);
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.18);
  --glass: rgba(20,22,28,0.55);
  --glass-strong: rgba(20,22,28,0.78);
  --glass-border: rgba(255,255,255,0.12);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.4), 0 8px 40px rgba(0,0,0,.4);
  --shadow-card: 0 1px 2px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.45);

  /* Accent default = navy. Light enough to carry CTAs on dark. */
  --accent: oklch(0.62 0.13 245);
  --accent-ink: oklch(0.99 0 0);
  --accent-soft: oklch(0.62 0.13 245 / 0.16);

  /* Type — single committed grotesk family for display; Manrope for body. */
  --font-display: "Bricolage Grotesque", "Familjen Grotesk", system-ui, sans-serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

html[data-theme="light"] {
  --bg: oklch(0.97 0.008 245);
  --bg-deep: oklch(0.94 0.012 245);
  --surface: oklch(1 0 0);
  --surface-2: rgba(20,30,55,0.04);
  --ink: oklch(0.22 0.02 245);
  --ink-muted: oklch(0.48 0.015 245);
  --ink-soft: oklch(0.62 0.012 245);
  --line: rgba(20,30,55,0.08);
  --line-strong: rgba(20,30,55,0.18);
  --glass: rgba(255,255,255,0.55);
  --glass-strong: rgba(255,255,255,0.78);
  --glass-border: rgba(255,255,255,0.6);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.04), 0 8px 40px rgba(0,0,0,.06);
  --shadow-card: 0 1px 2px rgba(0,0,0,.06), 0 24px 60px rgba(0,0,0,.10);
}

html[data-accent="navy"]    { --accent: oklch(0.62 0.13 245); --accent-soft: oklch(0.62 0.13 245 / 0.16); }
html[data-accent="sage"]    { --accent: oklch(0.66 0.08 155); --accent-soft: oklch(0.66 0.08 155 / 0.16); }
html[data-accent="slate"]   { --accent: oklch(0.62 0.05 235); --accent-soft: oklch(0.62 0.05 235 / 0.16); }
html[data-accent="gold"]    { --accent: oklch(0.78 0.11 80);  --accent-soft: oklch(0.78 0.11 80 / 0.16); }
html[data-accent="ember"]   { --accent: oklch(0.70 0.14 45);  --accent-soft: oklch(0.70 0.14 45 / 0.16); }

/* =========================================================
   Reset
   ========================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s var(--ease), color .35s var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

h1,h2,h3,h4 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

/* =========================================================
   Shell — the rounded outer frame matches the reference
   ========================================================= */
.shell {
  min-height: 100vh;
  padding: 14px;
}
.frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
@media (max-width: 720px) {
  .shell { padding: 0; }
  .frame { border-radius: 0; }
}

/* =========================================================
   Nav — three variants driven by data-nav on <html>
   ========================================================= */
.nav {
  position: absolute;
  top: 28px;
  left: 28px;
  right: 28px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-on-photo { color: #fff; }

.brand {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.01em;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-mark {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { width: 100%; height: 100%; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 999px;
  transition: all .3s var(--ease);
}
.nav-on-photo .nav-links {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
}
.nav-links a {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: inherit;
  opacity: 0.85;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.nav-on-photo .nav-links a:hover { background: rgba(255,255,255,0.18); }
.nav-links a.is-active {
  background: var(--ink);
  color: var(--bg);
  opacity: 1;
}
.nav-on-photo .nav-links a.is-active {
  background: #fff;
  color: #1a1d1f;
}

/* Flat variant */
html[data-nav="flat"] .nav-links {
  background: transparent;
  border: 0;
  backdrop-filter: none;
  padding: 0;
  gap: 28px;
}
html[data-nav="flat"] .nav-links a {
  padding: 8px 0;
  border-radius: 0;
  position: relative;
}
html[data-nav="flat"] .nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor; opacity: 0; transition: opacity .2s var(--ease);
}
html[data-nav="flat"] .nav-links a:hover { background: transparent; }
html[data-nav="flat"] .nav-links a:hover::after,
html[data-nav="flat"] .nav-links a.is-active::after { opacity: 0.6; }
html[data-nav="flat"] .nav-links a.is-active { background: transparent; color: inherit; }

/* Floating variant — detached pill, shifted down slightly */
html[data-nav="floating"] .nav-links {
  position: relative;
  top: 6px;
  box-shadow: var(--shadow-soft);
}

.nav-cta {
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  background: #fff;
  color: #1a1d1f;
  border: 1px solid rgba(0,0,0,0.06);
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.15); }

/* Mobile menu */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  align-items: center; justify-content: center;
}
.nav-on-photo .nav-burger { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); color: #fff; }
.nav-burger svg { width: 18px; height: 18px; }

@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: inline-flex; }
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 28px;
  transform: translateY(-100%);
  transition: transform .4s var(--ease);
  pointer-events: none;
}
.mobile-drawer.is-open { transform: translateY(0); pointer-events: auto; }
.mobile-drawer-top { display: flex; justify-content: space-between; align-items: center; }
.mobile-drawer-links { display: flex; flex-direction: column; gap: 4px; margin-top: 48px; }
.mobile-drawer-links a {
  font-family: var(--font-display);
  font-size: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-drawer-cta { margin-top: auto; }

/* =========================================================
   Hero (home page)
   ========================================================= */
.hero {
  position: relative;
  height: calc(100vh - 28px);
  min-height: 720px;
  color: #fff;
  overflow: hidden;
}
@media (max-width: 720px) {
  .hero { height: 100vh; min-height: 640px; }
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,17,20,0.35) 0%, rgba(14,17,20,0.1) 35%, rgba(14,17,20,0.7) 100%);
}
.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 64px;
  z-index: 2;
}
@media (max-width: 720px) {
  .hero-content { padding: 32px 22px; }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  max-width: 11ch;
  margin: 0 0 24px;
}
.hero-title em { font-style: italic; font-weight: 400; opacity: 0.92; }
.hero-sub {
  max-width: 520px;
  font-size: 15px;
  line-height: 1.55;
  opacity: 0.85;
  margin: 0 0 32px;
}
.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all .2s var(--ease);
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-light { background: #fff; color: #1a1d1f; }
.btn-light:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; opacity: 0.9; }
.btn-ghost:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { transform: translateY(-1px); }
.btn-arrow { width: 14px; height: 14px; }

/* Stats card on hero */
.stats {
  display: inline-flex;
  gap: 36px;
  padding: 20px 28px;
  border-radius: 18px;
  background: rgba(14,17,20,0.45);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
}
.stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 6px;
}

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: 96px 64px;
}
@media (max-width: 720px) {
  .section { padding: 64px 22px; }
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  gap: 32px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1;
  max-width: 16ch;
}
.section-lead {
  max-width: 380px;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.55;
}

/* =========================================================
   Property cards
   ========================================================= */
.grid {
  display: grid;
  gap: 32px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.card-photo {
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-badge {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: #1a1d1f;
}
.card-fav {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  display: inline-flex;
  align-items: center; justify-content: center;
  color: #1a1d1f;
}
.card-fav svg { width: 16px; height: 16px; }
.card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-location {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.card-name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.card-meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 22px;
}
.card-price {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.card-price small { font-family: var(--font-sans); font-size: 12px; color: var(--ink-muted); margin-left: 4px; }
.card-arrow {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease);
}
.card-arrow:hover { background: var(--accent); color: var(--accent-ink); }
.card-arrow svg { width: 14px; height: 14px; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: var(--bg-deep);
  padding: 80px 64px 32px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .footer { padding: 56px 22px 24px; }
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.footer-tagline { color: var(--ink-muted); max-width: 28ch; font-size: 14px; line-height: 1.55; }
.footer-col h5 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--ink-muted); transition: color .2s; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 16px;
}

/* =========================================================
   Tweaks panel
   ========================================================= */
.tweaks-toggle { display: none; } /* Hidden by default; activated by host */

.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 18px;
  z-index: 1000;
  font-family: var(--font-sans);
  font-size: 13px;
  display: none;
}
.tweaks-panel.is-open { display: block; }
.tweaks-panel h6 {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-weight: 500;
}
.tweaks-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tweaks-head strong { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.tweaks-close { width: 28px; height: 28px; border-radius: 999px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.tweaks-group { margin-bottom: 16px; }
.tweaks-options { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks-options button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  background: transparent;
  transition: all .2s var(--ease);
}
.tweaks-options button.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tweaks-swatches { display: flex; gap: 8px; }
.tweaks-swatches button {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  padding: 0;
  position: relative;
}
.tweaks-swatches button.is-active { border-color: var(--ink); }
.tweaks-swatches button::after { content: ""; position: absolute; inset: 2px; border-radius: 999px; background: var(--swatch); }

/* =========================================================
   Forms
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
  transition: border-color .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 120px; resize: vertical; }
.field.has-error input, .field.has-error textarea { border-color: #c84a3a; }
.field-error { color: #c84a3a; font-size: 12px; margin-top: -8px; }

/* =========================================================
   Utility
   ========================================================= */
.container { max-width: 1280px; margin: 0 auto; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.row { display: flex; gap: 16px; align-items: center; }
.row-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pill-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
