/* Dwellings.TV — shared styles for every page. Page-specific rules live in
   each page's <style> block. */

:root {
  --bg: #070B14;
  --bg-elev: #0E1524;
  --accent: #2B8CFF;
  --accent-light: #4FC3FF;
  --accent-deep: #1565D8;
  --ice: #D6E9FF;
  --white: #FFFFFF;
  --silver: #C8D1DE;
  --muted: #8892A6;
  --line: rgba(255, 255, 255, 0.08);
  --line-accent: rgba(43, 140, 255, 0.28);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --brand-blue: #2B8CFF;
  --brand-blue-soft: #3B8EE0;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: 'Playfair Display', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --brand: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--silver);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

.tm { font-size: 0.45em; vertical-align: super; font-family: var(--sans); font-style: normal; letter-spacing: 0; }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--white);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); margin-top: 18px; }
h1 em, h2 em { font-style: italic; color: var(--accent-light); font-weight: 400; }

.section-lead {
  max-width: 620px;
  margin-top: 18px;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--muted);
  font-weight: 300;
}

.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section-head { margin-bottom: clamp(44px, 6vw, 72px); }
.section-head.center { text-align: center; }
.section-head.center .section-lead { margin-left: auto; margin-right: auto; }
.section-head.center .eyebrow::after {
  content: '';
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  padding: 18px 34px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  box-shadow: 0 10px 30px -10px rgba(43, 140, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.8s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -12px rgba(43, 140, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover::after { left: 140%; }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  padding: 11px 22px;
  font-size: 0.85rem;
  color: var(--accent-light);
  background: rgba(43, 140, 255, 0.06);
  border: 1px solid var(--line-accent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-outline:hover { background: var(--accent); color: #FFFFFF; border-color: var(--accent); transform: translateY(-1px); }

.btn-ghost {
  padding: 18px 28px;
  color: var(--white);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.25); background: var(--glass-strong); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 14px; color: var(--white); }
.logo-mark { width: 58px; height: 58px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-word {
  font-family: var(--brand);
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}
.logo-word span { color: var(--brand-blue); }
.logo-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-family: var(--brand);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brand-blue-soft);
  white-space: nowrap;
}
.logo-tag::before, .logo-tag::after { content: ''; width: 16px; height: 1px; background: var(--brand-blue-soft); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 18px 0;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, padding 0.4s var(--ease);
}
.site-header.scrolled, .site-header.menu-open {
  padding: 12px 0;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 30px);
  list-style: none;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
}
.nav-links a { position: relative; padding: 4px 0; color: var(--silver); transition: color 0.3s; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass);
  cursor: pointer;
  place-items: center;
}
.menu-toggle svg { width: 20px; height: 20px; color: var(--white); }
.menu-toggle .i-close { display: none; }
.menu-open .menu-toggle .i-open { display: none; }
.menu-open .menu-toggle .i-close { display: block; }

/* ---------- Glass card ---------- */
.glass-card {
  position: relative;
  padding: clamp(28px, 3vw, 40px);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  transition: transform 0.6s var(--ease), border-color 0.4s, box-shadow 0.6s var(--ease);
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(43, 140, 255, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.glass-card:hover { transform: translateY(-6px); border-color: var(--line-accent); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.glass-card:hover::before { opacity: 1; }
.glass-card h3 { font-size: 1.45rem; margin-bottom: 12px; }
.glass-card p { color: var(--muted); font-weight: 300; }

.icon-tile {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border: 1px solid var(--line-accent);
  background: linear-gradient(145deg, rgba(43, 140, 255, 0.16), rgba(43, 140, 255, 0.02));
  color: var(--accent);
}
.icon-tile svg { width: 26px; height: 26px; }

/* ---------- Inner pages ---------- */
.page-hero {
  position: relative;
  padding: 170px 0 clamp(48px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 70% at 85% 0%, rgba(43, 140, 255, 0.12), transparent 65%),
    linear-gradient(180deg, #0A101C, var(--bg));
}
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin-top: 18px; }
.page-hero .section-lead { margin-top: 20px; }
.page-meta { margin-top: 22px; font-size: 0.85rem; color: var(--muted); }
.page-body { padding: clamp(48px, 7vw, 90px) 0 clamp(80px, 10vw, 120px); }

.prose { max-width: 760px; color: var(--silver); font-weight: 300; font-size: 1.02rem; }
.prose p + p { margin-top: 1.1em; }
.prose a, .link { color: var(--accent-light); border-bottom: 1px solid var(--line-accent); transition: border-color 0.3s; }
.prose a:hover, .link:hover { border-color: var(--accent-light); }

/* Legal documents */
.legal { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(40px, 6vw, 90px); align-items: start; }
.toc { position: sticky; top: 110px; font-size: 0.84rem; }
.toc p { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.toc ol { list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); transition: color 0.3s, border-color 0.3s; }
.toc a:hover { color: var(--white); border-left-color: var(--accent); }
.legal-doc { max-width: 760px; font-weight: 300; }
.legal-doc .lead-caps { color: var(--ice); font-weight: 400; font-size: 0.92rem; letter-spacing: 0.02em; padding: 20px 24px; border-radius: 12px; border: 1px solid var(--line-accent); background: rgba(43, 140, 255, 0.05); margin-bottom: 44px; }
.legal-doc section { scroll-margin-top: 110px; padding-bottom: 34px; margin-bottom: 34px; border-bottom: 1px solid var(--line); }
.legal-doc section:last-child { border-bottom: none; margin-bottom: 0; }
.legal-doc h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); margin: 0 0 16px; }
.legal-doc h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--ice); margin: 22px 0 10px; letter-spacing: 0.01em; }
.legal-doc p + p { margin-top: 1em; }
.legal-doc ul { margin: 14px 0 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.legal-doc li { position: relative; padding-left: 22px; }
.legal-doc li::before { content: ''; position: absolute; left: 2px; top: 0.72em; width: 7px; height: 1px; background: var(--accent); }
.legal-doc .caps { font-size: 0.92rem; letter-spacing: 0.01em; }
.legal-doc a { color: var(--accent-light); border-bottom: 1px solid var(--line-accent); }

/* ---------- CTA band (inner pages) ---------- */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: clamp(56px, 7vw, 90px);
  padding: clamp(28px, 4vw, 44px);
  border-radius: 22px;
  border: 1px solid var(--line-accent);
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, rgba(43, 140, 255, 0.16), transparent 60%),
    linear-gradient(160deg, #0C1730, #0F0F0F 60%);
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.cta-band p { color: var(--muted); font-weight: 300; margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 52px 0 44px; font-size: 0.85rem; color: var(--muted); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand p { margin-top: 18px; font-size: 0.84rem; letter-spacing: 0.02em; }
.footer-brand p span { color: #5A6378; margin: 0 8px; }
.footer-brand a { transition: color 0.3s; }
.footer-brand a:hover { color: var(--accent-light); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; max-width: 520px; }
.footer-links a { transition: color 0.3s; }
.footer-links a:hover { color: var(--accent-light); }
.footer-legal { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.76rem; color: #66708A; line-height: 1.7; }
.footer-legal p + p { margin-top: 6px; }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .menu-toggle { display: grid; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(7, 11, 20, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .menu-open .site-nav { display: block; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 18px; font-size: 1rem; }
  .nav-links a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-links a::after { display: none; }
  .nav-links a[aria-current="page"] { color: var(--accent-light); }
}

@media (max-width: 960px) {
  .legal { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { padding: 14px 0; }
  .logo { gap: 10px; }
  .logo-mark { width: 46px; height: 46px; }
  .logo-word { font-size: 1.35rem; }
  .logo-tag { font-size: 0.42rem; }
  .btn-outline { padding: 10px 16px; font-size: 0.8rem; }
  .page-hero { padding-top: 130px; }
  .cta-band .btn { width: 100%; }
}

@media (max-width: 460px) {
  .btn-outline .btn-label-long { display: none; }
  .menu-toggle { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
