/* ============================================================
   Terraform Studio — shared stylesheet (all four pages)
   Canvas:  #F2F5F4 (cool gray-green)
   Ink:     #1E2A26
   Accent:  #4A6B57 (moss)
   Type:    EB Garamond (headings) / Work Sans (body)
   ============================================================ */

/* ------------------------------------------------------------
   SIGNATURE TECHNIQUE: cross-document View Transitions (MPA).
   The single rule below opts every same-origin navigation into
   the View Transitions API. The header wordmark carries a named
   transition (view-transition-name: studio-logo) so it morphs
   smoothly from its position on one page to its position on
   the next, while the rest of the page cross-fades.

   FALLBACK NOTE: there is no @supports test for at-rules, and
   @view-transition is itself the opt-in — browsers that do not
   implement cross-document view transitions (or MPA navigation
   capture) simply ignore this block and perform an ordinary
   instant navigation. Nothing breaks, nothing is hidden behind
   the feature; the site is fully usable without it. Where we DO
   feature-test (the ::view-transition pseudo tree styling), we
   guard with @supports (view-transition-name: none) so
   non-supporting parsers skip the whole block cleanly.
   ------------------------------------------------------------ */
@view-transition {
  navigation: auto;
}

@supports (view-transition-name: none) {
  .brand {
    view-transition-name: studio-logo;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.45s;
  }
  ::view-transition-group(studio-logo) {
    animation-duration: 0.55s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* Respect reduced motion: kill every view-transition animation,
   which degrades navigation back to an instant swap. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-image-pair(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ---------- base ---------- */
:root {
  --canvas: #F2F5F4;
  --ink: #1E2A26;
  --moss: #4A6B57;
  --moss-deep: #3A5646;
  --line: rgba(30, 42, 38, 0.16);
  --line-soft: rgba(30, 42, 38, 0.09);
  --ink-60: rgba(30, 42, 38, 0.68);
  --max: 72rem;
}

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

html {
  background: var(--canvas);
}

body {
  font-family: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.35rem; }

p { max-width: 62ch; }

a { color: inherit; }

img { max-width: 100%; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-60);
}

/* ---------- header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line-soft);
  background: var(--canvas);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand .brand-mark {
  width: 0.68em;
  height: 0.68em;
  border-radius: 50% 50% 50% 0;
  background: var(--moss);
  transform: translateY(0.04em);
}

.site-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-60);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--moss);
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--moss); }

/* Mobile: nav collapses into a toggled drawer under the header bar. */
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
    z-index: 20;
  }

  .site-header { position: relative; }

  .site-nav.open { display: block; }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 1.25rem;
  }

  .site-nav li { border-top: 1px solid var(--line-soft); }

  .site-nav a {
    display: block;
    padding: 0.9rem 0;
    font-size: 1.05rem;
    border-bottom: none;
  }

  .site-nav a[aria-current="page"] {
    color: var(--moss);
    font-weight: 600;
  }
}

/* ---------- sections ---------- */
.section {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}

.section + .section { border-top: 1px solid var(--line-soft); }

.section-head {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(4rem, 11vw, 8rem) 0 clamp(3.5rem, 9vw, 6.5rem);
}

.hero h1 { max-width: 16ch; margin-bottom: 1.5rem; }

.hero .lede { max-width: 46ch; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-60);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--moss);
  color: #F6F9F7;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  border: 1px solid var(--moss);
}

.btn:hover, .btn:focus-visible { background: var(--moss-deep); border-color: var(--moss-deep); }

.btn.ghost {
  background: transparent;
  color: var(--moss);
}

.btn.ghost:hover, .btn.ghost:focus-visible {
  background: rgba(74, 107, 87, 0.1);
}

/* ---------- project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 2rem;
}

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

.project-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 0.5rem;
  border: 1px solid var(--line-soft);
  margin-bottom: 1rem;
}

/* Intentional gradient "site plans" standing in for photography. */
.thumb-marsh   { background: linear-gradient(160deg, #DDE7E1 0%, #9FB8A8 55%, #4A6B57 130%); }
.thumb-terrace { background: linear-gradient(200deg, #E8EEEA 0%, #B9CBBF 50%, #5E7D6B 120%); }
.thumb-court   { background: conic-gradient(from 220deg at 70% 30%, #E3EBE6, #A8BFB1, #4A6B57, #E3EBE6); }
.thumb-ridge   { background: linear-gradient(120deg, #EDF2EF 10%, #8FA99A 70%, #3A5646 140%); }
.thumb-basin   { background: radial-gradient(circle at 30% 20%, #E8EEEA 0%, #9FB8A8 60%, #46655331 100%), #7E9A8B; }
.thumb-meadow  { background: linear-gradient(20deg, #4A6B57 -30%, #A8BFB1 45%, #EDF2EF 100%); }

/* Deep links from the homepage: keep the anchored card clear of the
   header bar, and mark the target with the moss accent. */
.project-card[id] { scroll-margin-top: 5rem; }

.project-card:target {
  border-left: 3px solid var(--moss);
  padding-left: 1rem;
}

.project-card h3 { margin-bottom: 0.25rem; }

.project-card:hover h3 { color: var(--moss); }

.project-meta {
  font-size: 0.83rem;
  color: var(--ink-60);
}

/* ---------- two-column feature ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

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

/* ---------- lists / values ---------- */
.value-list {
  list-style: none;
  counter-reset: value;
}

.value-list li {
  counter-increment: value;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
}

.value-list li::before {
  content: "0" counter(value);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.4rem;
  color: var(--moss);
}

/* ---------- team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 2rem;
}

.team-card .portrait {
  aspect-ratio: 1;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line-soft);
}

.portrait-1 { background: linear-gradient(150deg, #C9D8CF, #4A6B57); }
.portrait-2 { background: linear-gradient(150deg, #DCE6E0, #6B8A78); }
.portrait-3 { background: linear-gradient(150deg, #B9CBBF, #3A5646); }
.portrait-4 { background: linear-gradient(150deg, #E3EBE6, #57755F); }

.team-card h3 { font-size: 1.2rem; }

.team-card .role {
  font-size: 0.83rem;
  color: var(--moss);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-card p { font-size: 0.92rem; color: var(--ink-60); margin-top: 0.5rem; }

/* ---------- stats ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.5rem;
}

.stat b {
  display: block;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 500;
}

.stat span { font-size: 0.85rem; color: var(--ink-60); }

/* ---------- contact form ---------- */
.contact-form {
  display: grid;
  gap: 1.4rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #FBFCFB;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.75rem 0.9rem;
}

.field textarea { min-height: 9rem; resize: vertical; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
  border-color: var(--moss);
}

/* validation states (class toggled by JS on submit/blur) */
.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: #A0522D;
  background: #FBF4F0;
}

.field .error {
  display: none;
  font-size: 0.8rem;
  color: #8A4423;
  margin-top: 0.35rem;
}

.field.invalid .error { display: block; }

.form-status {
  display: none;
  border: 1px solid var(--moss);
  background: rgba(74, 107, 87, 0.09);
  color: var(--moss-deep);
  border-radius: 0.4rem;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
}

.form-status.visible { display: block; }

.contact-details {
  list-style: none;
  display: grid;
  gap: 1.2rem;
  font-size: 0.95rem;
}

.contact-details b {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 0.2rem;
}

.contact-details a { color: var(--ink); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 3.5rem;
  margin-top: clamp(3rem, 8vw, 5rem);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: baseline;
}

.footer-nav {
  display: flex;
  gap: 1.6rem;
  list-style: none;
}

.footer-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--ink-60);
}

.footer-nav a:hover { color: var(--moss); }

.site-footer small {
  font-size: 0.78rem;
  color: var(--ink-60);
}
