/* Coastal Linen - CMR Construction Group
   Marine-navy masthead, sand/linen ground, sea-glass teal, double-rule language. */

:root {
  --navy: #12263a;
  --navy-deep: #0b1a29;
  --linen: #f4eee3;
  --shell: #fbf8f2;
  --sand: #e4d7c1;
  --sand-deep: #c9b693;
  --ink: #1d2830;
  --muted: #4a5760;
  --teal: #246a66;
  --teal-soft: #9fcfc6;
  --glass: #d5e9e4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Gill Sans", "Gill Sans MT", Avenir, "Segoe UI", system-ui, sans-serif;
  --wrap: 1200px;
  --gut: clamp(1.1rem, 4vw, 2.5rem);
  --rule: 3px double var(--sand-deep);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ---------- Masthead ---------- */
.masthead {
  background: var(--navy);
  box-shadow: 0 4px 0 -1px var(--linen), 0 5px 0 -1px var(--sand-deep);
  position: relative;
  z-index: 2;
}
.masthead-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.9rem var(--gut) 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 2rem;
}
.brand { display: inline-block; line-height: 0; }
.brand-logo { height: 34px; width: auto; }

.site-nav { width: 100%; border-top: 1px solid rgba(159, 207, 198, 0.22); padding-top: 0.35rem; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.1rem 1.4rem;
}
.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  color: #e9e2d4;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--teal-soft);
  border-bottom-color: var(--teal-soft);
}
.site-nav a:focus-visible { outline-color: var(--teal-soft); }

@media (min-width: 860px) {
  .masthead-inner { flex-wrap: nowrap; padding-block: 1.15rem; }
  .brand-logo { height: 40px; }
  .site-nav { width: auto; border-top: 0; padding-top: 0; }
  .site-nav ul { gap: 0 2.2rem; justify-content: flex-end; }
}

/* ---------- Hero (split: text left, image right) ---------- */
.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.2rem, 6vw, 4.5rem) var(--gut) clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  gap: 2.25rem;
}
.hero-text { max-width: 36rem; align-self: center; }
.hero-mark {
  display: block;
  width: 4.5rem;
  height: 7px;
  border-top: 1px solid var(--teal);
  border-bottom: 1px solid var(--teal);
  margin-bottom: 1.4rem;
}
.hero-title {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.05rem, 1.3rem + 3vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--navy);
  text-wrap: balance;
}
.hero-intro p { margin: 0 0 1em; color: var(--muted); font-size: 1.1rem; }
.hero-intro p:last-child { margin-bottom: 0; }

.hero-media { position: relative; padding: 0 0 14px 14px; }
.hero-media::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 78%; height: 80%;
  background: var(--glass);
  border: 1px solid var(--teal-soft);
}
.hero-img {
  position: relative;
  width: 100%;
  height: clamp(240px, 58vw, 540px);
  object-fit: cover;
  border: 8px solid var(--shell);
  outline: 1px solid var(--sand-deep);
  box-shadow: 0 18px 40px -26px rgba(18, 38, 58, 0.55);
}

@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 5vw, 4.5rem); }
  .hero-media { padding: 0 0 22px 22px; }
}

/* ---------- Body flow ---------- */
.body-flow { counter-reset: sec; border-top: var(--rule); }

.sec {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.75rem, 7vw, 5rem) var(--gut);
  position: relative;
}
.sec + .sec { border-top: 1px solid var(--sand); }
.sec + .sec::before {
  content: "\25C7";
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -54%);
  padding: 0 0.7rem;
  background: var(--linen);
  color: var(--teal);
  font-size: 0.9rem;
  line-height: 1;
}

.sec-title {
  counter-increment: sec;
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 1.15rem + 1.5vw, 2.15rem);
  line-height: 1.2;
  color: var(--navy);
  text-wrap: balance;
}
.sec-title::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  width: max-content;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: var(--rule);
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  color: var(--teal);
}

.sec-body { max-width: 68ch; }
.sec-body p { margin: 0 0 1.05em; }
.sec-body p:last-child, .sec-body ul:last-child { margin-bottom: 0; }
.sec-body strong { color: var(--navy); font-weight: 600; }
.sec-body em { color: var(--muted); }
.sec-body ul { margin: 0 0 1.2em; padding: 0; list-style: none; }
.sec-body li { position: relative; padding-left: 1.6rem; margin-bottom: 0.45em; }
.sec-body li::before {
  content: "";
  position: absolute;
  left: 0.15rem; top: 0.72em;
  width: 0.7rem; height: 4px;
  border-top: 1px solid var(--teal);
  border-bottom: 1px solid var(--teal);
}

/* ---------- Alternate split sections ---------- */
.sec--split { display: grid; gap: 2.25rem; align-items: center; }
.sec-media { position: relative; max-width: 600px; width: 100%; margin-right: 12px; }
.sec-media::after {
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 3px double var(--teal-soft);
  pointer-events: none;
}
.sec-img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 6px solid var(--shell);
  outline: 1px solid var(--sand-deep);
}

@media (min-width: 900px) {
  .sec--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(2.5rem, 5vw, 5rem); }
  .sec--right { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
  .sec--right .sec-media { order: 2; justify-self: end; margin-right: 0; margin-left: 12px; }
  .sec--right .sec-media::after { inset: 12px 12px -12px -12px; }
  .sec--right .sec-text { order: 1; }
}

/* ---------- Plain sections (no image) ---------- */
.sec--plain .sec-title, .sec--plain .sec-body { max-width: 68ch; margin-left: auto; margin-right: auto; }

.page-index .sec--plain {
  max-width: none;
  background: var(--shell);
  border-top: var(--rule);
}
.page-index .sec--plain .sec-title { text-align: center; }
.page-index .sec--plain .sec-title::before { margin-left: auto; margin-right: auto; }
.page-index .sec--plain::before { background: var(--shell); }

.page-support .body-flow { background: var(--shell); }
.page-support .sec + .sec::before { background: var(--shell); }

/* ---------- Footer ---------- */
.site-foot {
  background: var(--navy);
  color: #ddd5c6;
  border-top: 6px double var(--sand-deep);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.65;
}
.foot-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gut) 2rem;
  display: grid;
  gap: 2.25rem;
}
.foot-name {
  margin: 0 0 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px double rgba(159, 207, 198, 0.45);
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.2;
  color: #fbf8f2;
}
.site-foot address { font-style: normal; margin-bottom: 1.2rem; }
.foot-lines { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1.2rem; }
.foot-lines dt {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--teal-soft); padding-top: 0.2em;
}
.foot-lines dd { margin: 0; overflow-wrap: anywhere; }
.site-foot a { color: #fbf8f2; text-decoration-color: var(--teal-soft); }
.site-foot a:hover { color: var(--teal-soft); }
.site-foot a:focus-visible { outline-color: var(--teal-soft); }
.foot-map { padding: 6px; background: var(--navy-deep); outline: 1px solid rgba(159, 207, 198, 0.3); }
.foot-map iframe { display: block; }
.foot-copy {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.1rem var(--gut) 1.6rem;
  border-top: 1px solid rgba(221, 213, 198, 0.15);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #b9b2a5;
}

@media (min-width: 860px) {
  .foot-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 4rem; }
}

@media (max-width: 400px) {
  .foot-lines { grid-template-columns: 1fr; gap: 0; }
  .foot-lines dd { margin-bottom: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
