/* =========================================================
   MERIDIAN RESIDENCES — Project Showcase Template
   Design tokens
   ========================================================= */
:root {
  /* Color — White & Blue theme */
  --charcoal: #0B2545;      /* deep navy — dark bg + body text */
  --charcoal-soft: #3A5A80; /* muted navy — secondary text */
  --porcelain: #FFFFFF;     /* main light background */
  --taupe: #E7F0FA;         /* pale blue — alt section background */
  --brass: #2F6FED;         /* primary blue accent */
  --brass-light: #5C93F2;   /* lighter blue — hover states */
  --forest: #1B4D7A;        /* secondary blue accent (icons) */
  --white: #FFFFFF;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  /* Layout */
  --max-width: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-pad: clamp(64px, 10vw, 140px);
  --radius: 2px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body, h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

body {
  font-family: var(--font-body);
  background: var(--porcelain);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brass);
  color: var(--charcoal);
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus {
  left: var(--gutter);
  top: 12px;
}

/* =========================================================
   Typography
   ========================================================= */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #E8B84B;
  display: inline-block;
  margin-bottom: 14px;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; }

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 500; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(36px, 6vw, 64px);
}
.section-head p { margin-top: 16px; color: var(--charcoal-soft); font-size: 1.05rem; }
.section-head.center { margin-inline: auto; text-align: center; }

.lede { font-size: 1.1rem; color: var(--charcoal-soft); }

/* =========================================================
   Blueprint corner-mark signature element
   Used to frame key sections like an architect's drawing sheet
   ========================================================= */
.blueprint-frame {
  position: relative;
}
.blueprint-frame::before,
.blueprint-frame::after,
.blueprint-frame .corner-tl,
.blueprint-frame .corner-br {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--brass);
  opacity: 0.75;
}
.blueprint-frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.blueprint-frame::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--brass);
  color: var(--charcoal);
}
.btn-primary:hover { background: var(--brass-light); }
.btn-outline {
  border-color: currentColor;
  background: transparent;
}
.btn-outline:hover { background: var(--charcoal); color: var(--porcelain); border-color: var(--charcoal); }
.btn-outline.on-dark { color: var(--porcelain); }
.btn-outline.on-dark:hover { background: var(--porcelain); color: var(--charcoal); }

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  background: rgba(11, 37, 69, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(47, 111, 237, 0.25);
  transition: transform 0.4s var(--ease);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.logo img { height: 34px; width: auto; }

.nav-list {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
}
.nav-list a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--porcelain);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.nav-list a:hover,
.nav-list a:focus-visible { border-color: var(--brass); color: var(--brass-light); }

.nav-actions { display: flex; align-items: center; gap: 18px; }
.nav-cta { display: none; }
@media (min-width: 860px) { .nav-cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--porcelain); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
@media (min-width: 860px) { .nav-toggle { display: none; } }

.primary-nav { display: none; }
@media (min-width: 860px) { .primary-nav { display: block; } }

.primary-nav.open {
  display: block;
  position: fixed;
  inset: 84px 0 0 0;
  background: var(--charcoal);
  padding: 40px var(--gutter);
}
.primary-nav.open .nav-list { flex-direction: column; gap: 26px; }
.primary-nav.open .nav-list a { font-size: 1.1rem; }
@media (min-width: 860px) { .primary-nav.open { position: static; inset: auto; padding: 0; background: none; } }

body.nav-open { overflow: hidden; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--porcelain);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,37,69,0.35) 0%, rgba(11,37,69,0.55) 55%, rgba(11,37,69,0.92) 100%);
}
.hero-content {
  padding-block: 120px clamp(56px, 9vw, 100px);
  max-width: 900px;
}
.hero-title { margin-bottom: 22px; }
.hero-title em { font-style: italic; color: #E8B84B; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--taupe);
}
.hero-meta span { display: block; }
.hero-meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--porcelain);
  margin-top: 4px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 42px; }

.hero-scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 40px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--taupe);
  display: none;
  align-items: center;
  gap: 12px;
}
.hero-scroll::after { content: ""; width: 1px; height: 50px; background: var(--brass); display: block; }
@media (min-width: 700px) { .hero-scroll { display: inline-flex; } }

/* =========================================================
   Sections general
   ========================================================= */
section { padding-block: var(--section-pad); }
.alt-bg { background: var(--taupe); }
.dark-bg { background: var(--charcoal); color: var(--porcelain); }
.dark-bg .section-head p { color: var(--taupe); }

/* About */
.about-grid {
  display: grid;
  gap: clamp(28px, 5vw, 70px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.1fr 0.9fr; } }
.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--charcoal);
  border: 1px solid var(--charcoal);
}
.about-stats div {
  background: var(--porcelain);
  padding: 26px 22px;
}
.about-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--brass);
}
.about-stats span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
}

/* Amenities */
.amenity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(11,37,69,0.10);
  border: 1px solid rgba(11,37,69,0.10);
}
@media (min-width: 620px) { .amenity-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .amenity-grid { grid-template-columns: repeat(4, 1fr); } }
.amenity-card {
  background: var(--porcelain);
  padding: 34px 24px;
  text-align: center;
  transition: background 0.3s var(--ease);
}
.amenity-card:hover { background: var(--white); }
.amenity-card img { width: 48px; height: 48px; margin-inline: auto 12px; margin-bottom: 16px; }
.amenity-card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.amenity-card p { font-size: 0.88rem; color: var(--charcoal-soft); }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--charcoal);
}
.gallery-item:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: 1 / 1; }
@media (min-width: 700px) { .gallery-item:first-child { aspect-ratio: 4 / 3; } }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item button {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: none; border: none; padding: 0;
}
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(0deg, rgba(11,37,69,0.85), transparent);
  color: var(--porcelain);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-align: left;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.gallery-item:hover .gallery-caption,
.gallery-item:focus-within .gallery-caption { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 16, 17, 0.94);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--gutter);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 82vh; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 24px; right: var(--gutter);
  background: none; border: 1px solid var(--taupe); color: var(--porcelain);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.2rem;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid var(--taupe); color: var(--porcelain);
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.1rem;
}
.lightbox-prev { left: var(--gutter); }
.lightbox-next { right: var(--gutter); }

/* Floor plans */
.plan-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.plan-tab {
  padding: 12px 22px;
  border: 1px solid var(--charcoal);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plan-tab[aria-selected="true"] { background: var(--charcoal); color: var(--porcelain); }
.plan-panel { display: none; }
.plan-panel.active { display: grid; gap: clamp(24px, 5vw, 60px); grid-template-columns: 1fr; }
@media (min-width: 880px) { .plan-panel.active { grid-template-columns: 1.05fr 0.95fr; align-items: center; } }
.plan-image { background: var(--porcelain); padding: 18px; border: 1px solid rgba(11,37,69,0.15); }
.plan-specs dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; margin: 26px 0 32px; }
.plan-specs dt { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); }
.plan-specs dd { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }

/* Location */
.location-grid {
  display: grid;
  gap: clamp(24px, 5vw, 56px);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .location-grid { grid-template-columns: 1.15fr 0.85fr; } }
.map-embed { border: 1px solid rgba(255,255,255,0.18); overflow: hidden; }
.map-embed iframe, .map-embed img { width: 100%; height: 100%; min-height: 340px; }
.landmark-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  font-size: 0.96rem;
}
.landmark-list li span:last-child { color: var(--brass-light); font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; }

/* Contact */
.contact-grid {
  display: grid;
  gap: clamp(28px, 5vw, 60px);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .contact-grid { grid-template-columns: 0.85fr 1.15fr; } }
.contact-info dl { margin-top: 30px; }
.contact-info dt {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brass); margin-top: 22px;
}
.contact-info dd { margin: 6px 0 0; font-size: 1.02rem; }

.form-row { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 620px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--charcoal-soft);
}
.field input, .field textarea, .field select {
  border: 1px solid rgba(11,37,69,0.25);
  background: var(--white);
  padding: 13px 15px;
  border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 120px; }
.field.consent { flex-direction: row; align-items: flex-start; gap: 10px; }
.field.consent input { width: 18px; height: 18px; margin-top: 3px; }
.field.consent label { text-transform: none; letter-spacing: 0; font-size: 0.88rem; }
.form-note { font-size: 0.82rem; color: var(--charcoal-soft); margin-top: 14px; }
.honeypot { position: absolute; left: -9999px; opacity: 0; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--charcoal);
  color: var(--taupe);
  padding-block: 64px 30px;
}
.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.footer-grid h4 {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--porcelain); margin-bottom: 16px;
}
.footer-grid li { margin-bottom: 10px; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--brass-light); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 26px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.6);
}
.footer-bottom a:hover { color: var(--brass-light); }

/* =========================================================
   Utility
   ========================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

.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;
}

/* Thank-you page */
.thanks-hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--charcoal);
  color: var(--porcelain);
  padding: var(--gutter);
}
.thanks-card { max-width: 560px; }
.thanks-icon { margin-bottom: 26px; }
