/* Mountain Water Architecture PLLC
   Palette drawn from the Hudson Valley: basalt, river mist, lichen, oak.
   Type system encodes the brand: Archivo (mountain: structure) for headings,
   nav, labels; Newsreader (water: flow) for prose and italic counterpoint. */

:root {
  --basalt: #252d2f;
  --ink: #1a2022;
  --mist: #eff1ee;
  --mist-deep: #e3e7e2;
  --water: #5f827d;
  --water-deep: #47645f;
  --timber: #a5865f;
  --text: #2a3234;
  --text-soft: #5c6867;
  --line: #c9d0cb;
  --white: #fbfcfa;

  --font-structure: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-flow: "Newsreader", Georgia, serif;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(4.5rem, 10vw, 8.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-flow);
  font-size: 1.125rem;
  font-optical-sizing: auto;
  line-height: 1.65;
  color: var(--text);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

::selection { background: var(--water); color: var(--white); }

:focus-visible {
  outline: 2px solid var(--water-deep);
  outline-offset: 3px;
}

/* ---------- type scale ---------- */

h1, h2, h3, .label {
  font-family: var(--font-structure);
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.6rem);
  font-weight: 600;
  font-stretch: 112%;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

h1 em, h2 em, .water-word {
  font-family: var(--font-flow);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.04em;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 600;
  font-stretch: 108%;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--water-deep);
}

.lede {
  font-size: clamp(1.25rem, 2vw, 1.45rem);
  line-height: 1.55;
  max-width: var(--measure);
}

p { max-width: var(--measure); }

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

/* ---------- the waterline: rule that becomes a wave ---------- */

.waterline {
  width: 100%;
  max-width: 30rem;
  height: 14px;
  color: var(--timber);
}

.waterline.tone-water { color: var(--water); }
.waterline.tone-mist { color: rgba(251, 252, 250, 0.7); }

/* ---------- header ---------- */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--gutter);
}

.site-header.on-light {
  position: static;
  border-bottom: 1px solid var(--line);
  background: var(--mist);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand svg { flex: none; }

.brand-name {
  font-family: var(--font-structure);
  font-weight: 600;
  font-stretch: 110%;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
}

.brand-name small {
  display: block;
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  color: var(--water);
}

.on-dark .brand-name { color: var(--white); }
.on-dark .brand-name small { color: #9fc0ba; }
.on-light .brand-name { color: var(--ink); }

.site-nav { display: flex; gap: 2rem; align-items: center; }

.site-nav a {
  font-family: var(--font-structure);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.on-dark .site-nav a { color: rgba(251, 252, 250, 0.85); }
.on-dark .site-nav a:hover, .on-dark .site-nav a[aria-current] { color: var(--white); border-bottom-color: var(--white); }
.on-light .site-nav a { color: var(--text-soft); }
.on-light .site-nav a:hover, .on-light .site-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--timber); }

.nav-cta {
  border: 1px solid currentColor;
  padding: 0.55rem 1.1rem !important;
  border-radius: 0;
}

@media (max-width: 720px) {
  .site-header { flex-direction: column; gap: 0.9rem; padding-top: 1.1rem; }
  .site-nav { gap: 0.7rem 1.1rem; flex-wrap: wrap; justify-content: center; }
  .site-nav a { font-size: 0.72rem; letter-spacing: 0.1em; }
  .nav-cta { padding: 0.45rem 0.85rem !important; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  isolation: isolate;
}

.hero-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(200deg, rgba(37, 45, 47, 0.18) 0%, rgba(37, 45, 47, 0.55) 62%, rgba(26, 32, 34, 0.88) 100%);
}

.hero-inner {
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5.5rem);
  max-width: 60rem;
}

.hero h1 { color: var(--white); margin: 1.1rem 0 1.3rem; }
.hero .label { color: #b8d0ca; }

.hero-sub {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  max-width: 44ch;
  color: rgba(251, 252, 250, 0.88);
  margin-bottom: 2.2rem;
}

.hero .waterline { margin-bottom: 0.4rem; }

/* staged hero entrance */
.hero [data-rise] { opacity: 0; transform: translateY(22px); animation: rise 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards; }
.hero [data-rise="2"] { animation-delay: 0.15s; }
.hero [data-rise="3"] { animation-delay: 0.3s; }
.hero [data-rise="4"] { animation-delay: 0.45s; }

@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- interior page head ---------- */

.page-head { padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) 0; }

.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); margin: 0.9rem 0 1.2rem; }

.page-head .lede { margin-bottom: 1.6rem; }

.page-head .waterline { margin-top: 0.4rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-structure);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 1.9rem;
  border: 1px solid var(--basalt);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.btn:hover { background: var(--basalt); color: var(--white); }

.btn.solid { background: var(--basalt); color: var(--white); }
.btn.solid:hover { background: var(--water-deep); border-color: var(--water-deep); }

.btn.ghost-light { border-color: rgba(251, 252, 250, 0.7); color: var(--white); }
.btn.ghost-light:hover { background: var(--white); color: var(--ink); }

.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- sections ---------- */

.section { padding: var(--section) var(--gutter); }
.section.tint { background: var(--mist-deep); }
.section.dark { background: var(--basalt); color: #d7ddd8; }
.section.dark h2, .section.dark h3 { color: var(--white); }
.section.dark .label { color: #9fc0ba; }
.section.dark .muted { color: #a7b1ac; }

.section-head { margin-bottom: clamp(2.2rem, 5vw, 3.8rem); }
.section-head h2 { margin: 0.9rem 0 0; }
.section-head .waterline { margin-top: 1.4rem; }

.wrap { max-width: 74rem; margin: 0 auto; }

/* two-column: stone column / water column */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.split .sticky-col { position: sticky; top: 2.5rem; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split .sticky-col { position: static; }
}

/* ---------- work grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: clamp(1.4rem, 3vw, 2.6rem);
}

.work-card { text-decoration: none; display: block; }

.work-card figure {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--mist-deep);
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.work-card:hover img { transform: scale(1.035); }

.work-meta { padding-top: 0.9rem; }

.work-meta h3 { font-size: 0.95rem; letter-spacing: 0.07em; }

.work-meta .muted {
  font-family: var(--font-structure);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.feature-card { grid-column: 1 / -1; }
.feature-card figure { aspect-ratio: 21 / 9; }

@media (max-width: 640px) {
  .feature-card figure { aspect-ratio: 3 / 2; }
}

/* ---------- services ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.6rem, 3.5vw, 3rem);
}

.service {
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
}

.section.dark .service { border-top-color: rgba(215, 221, 216, 0.25); }

.service h3 { margin-bottom: 0.7rem; }
.service p { font-size: 1.02rem; }

/* ---------- about portrait ---------- */

.portrait {
  margin: 0 0 1.8rem;
}

.portrait img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- project pages ---------- */

.credits {
  display: flex;
  gap: 1.4rem 3.5rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

.credits .label { margin-bottom: 0.25rem; }
.credits p { font-size: 1.02rem; }

/* Tiled gallery: full-width feature every third image, paired tiles between.
   Tiles crop to 4:3; the lightbox always shows the uncropped image. */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2.2rem);
}

.gallery figure { margin: 0; background: var(--mist-deep); cursor: zoom-in; }

.gallery img { width: 100%; height: auto; display: block; }

.gallery figure:nth-child(3n + 1) { grid-column: 1 / -1; }

.gallery figure:not(:nth-child(3n + 1)) { aspect-ratio: 4 / 3; overflow: hidden; }

.gallery figure:not(:nth-child(3n + 1)) img { height: 100%; object-fit: cover; }

@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery figure:not(:nth-child(3n + 1)) { aspect-ratio: auto; }
  .gallery figure:not(:nth-child(3n + 1)) img { height: auto; object-fit: contain; }
}

/* Lightbox: blurred site behind, click anywhere (or Esc) to close */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vmin;
  background: rgba(26, 32, 34, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}

.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.proj-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .proj-nav { justify-content: center; }
}

/* ---------- process ---------- */

.phases { counter-reset: phase; }

.phase {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.6rem;
  padding: 2.1rem 0;
  border-top: 1px solid var(--line);
}

.phase:last-child { border-bottom: 1px solid var(--line); }

.phase-num {
  font-family: var(--font-structure);
  font-weight: 600;
  font-stretch: 115%;
  font-size: 1.9rem;
  color: var(--timber);
  line-height: 1;
}

.phase h3 { margin-bottom: 0.55rem; }
.phase p { font-size: 1.05rem; }

.phase .you-get {
  margin-top: 0.8rem;
  font-family: var(--font-structure);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--water-deep);
}

@media (max-width: 560px) {
  .phase { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* mini process strip on home */
.phase-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.5rem 2rem;
}

.phase-strip .step h3 { font-size: 0.82rem; margin: 0.5rem 0 0.3rem; }
.phase-strip .step p { font-size: 0.95rem; }
.phase-strip .step .phase-num { font-size: 1.4rem; }

/* ---------- steps (working together) ---------- */

.steps { display: grid; gap: 0; }

.step-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.step-row:last-child { border-bottom: 1px solid var(--line); }

.step-row .phase-num { font-size: 1.15rem; }

.step-row p { font-size: 1.02rem; }
.step-row strong { font-family: var(--font-structure); font-size: 0.92rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; color: var(--ink); }

/* ---------- quote band ---------- */

.quote-band { text-align: center; }

.quote-band blockquote {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.4;
  font-style: italic;
  max-width: 34ch;
  margin: 0 auto;
  color: var(--white);
}

.quote-band .waterline { margin: 2rem auto 0; }

/* ---------- CTA band ---------- */

.cta-band { text-align: center; }

.cta-band h2 { max-width: 22ch; margin: 0.9rem auto 1.1rem; }
.cta-band p { margin: 0 auto 2.2rem; }
.cta-band .btn-row { justify-content: center; }

/* ---------- contact ---------- */

.contact-aside .label { margin-bottom: 0.35rem; }
.contact-aside p { margin-bottom: 1.4rem; font-size: 1.05rem; }
.contact-aside a { color: var(--water-deep); text-decoration-color: var(--line); }

form .field { margin-bottom: 1.5rem; }

form label {
  display: block;
  font-family: var(--font-structure);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

form label .opt { color: var(--text-soft); font-weight: 500; text-transform: none; letter-spacing: 0.02em; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  font-family: var(--font-flow);
  font-size: 1.05rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  border-radius: 0;
  transition: border-color 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--water);
  box-shadow: 0 0 0 1px var(--water);
}

textarea { min-height: 8.5rem; resize: vertical; }

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }

fieldset { border: none; }
fieldset legend {
  font-family: var(--font-structure);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.radio-row { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.radio-row label {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-flow);
  font-size: 1rem; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  margin: 0;
}

.form-note { font-size: 0.95rem; margin-top: 1.1rem; }

/* honeypot: invisible to people, present for bots */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- reveal on scroll ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
}

[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--ink);
  color: #aab4af;
  padding: 3.5rem var(--gutter) 2.5rem;
}

.footer-grid {
  max-width: 74rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

.site-footer .brand-name { color: var(--white); }
.site-footer .brand-name small { color: #8fb3ac; }

.site-footer h3 { color: #e6eae6; font-size: 0.78rem; letter-spacing: 0.16em; margin-bottom: 0.8rem; }

.site-footer a { color: #c3ccc7; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }

.site-footer p, .site-footer li { font-size: 0.98rem; list-style: none; margin-bottom: 0.4rem; }

.footer-legal {
  max-width: 74rem;
  margin: 2.8rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(170, 180, 175, 0.25);
  font-family: var(--font-structure);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d8783;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- motion safety ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero [data-rise] { animation: none; opacity: 1; transform: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .work-card img { transition: none; }
}
