@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-normal.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0c2a30;          /* deep teal from the logo hue: text, dark grounds */
  --ink-soft: #3b5559;     /* secondary text on light */
  --paper: #ffffff;
  --stone: #edf4f4;        /* teal-tinted off-white section ground */
  --teal: #00a1b0;         /* the Cedar Crest logo teal */
  --teal-text: #00737e;    /* logo teal darkened to pass 4.5:1 on white */
  --on-dark: #f1f7f7;
  --on-dark-soft: #b9d0d2;
  --rule: rgba(12, 42, 48, 0.16);
  --rule-dark: rgba(241, 247, 247, 0.28);
  --error: #9b2c2c;

  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 5vw, 4.5rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(5rem, 11vw, 9rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  scrollbar-color: var(--ink-soft) var(--stone);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  caret-color: var(--teal-text);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: var(--paper); }

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

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; text-wrap: pretty; }

.skip {
  position: absolute;
  left: var(--space-2);
  top: -3rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
}
.skip:focus { top: var(--space-2); }

/* Masthead: transparent over the hero, solid once scrolled. */
.masthead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.85rem var(--gutter);
  color: var(--on-dark);
  transition: background-color 0.5s var(--ease-out), color 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.masthead.is-solid {
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--rule), 0 8px 24px -18px rgba(12, 42, 48, 0.35);
}
.brand img { height: clamp(3.2rem, 2.4rem + 2.6vw, 4.75rem); width: auto; filter: drop-shadow(0 2px 10px rgba(6, 30, 35, 0.25)); }
.masthead.is-solid .brand img { filter: none; }

.masthead__nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }
.masthead__nav a {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding-block: 0.4rem;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 0.4s var(--ease-out);
}
.masthead__nav a:hover { background-size: 100% 1px; }

/* Plates: photographs that move against the scroll. JS sets --ov (overscan
   in px) from each plate's own size and speed, so translation never shows an
   edge at any viewport. */
.plate {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
  --ov: 0px;
}
.plate img {
  position: absolute;
  left: 0;
  top: calc(-1 * var(--ov));
  width: 100%;
  height: calc(100% + 2 * var(--ov));
  object-fit: cover;
  will-change: transform;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--ink);
  color: var(--on-dark);
}
.hero .plate img { top: 0; height: 100%; object-position: 50% 62%; }
.hero .plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 30, 35, 0.6) 0%, rgba(6, 30, 35, 0) 24%),
    linear-gradient(0deg, rgba(6, 30, 35, 0.9) 0%, rgba(6, 30, 35, 0.62) 38%, rgba(6, 30, 35, 0.15) 72%),
    linear-gradient(90deg, rgba(6, 30, 35, 0.45) 0%, rgba(6, 30, 35, 0) 60%);
}
.hero__copy {
  position: relative;
  padding: 0 var(--gutter) clamp(3rem, 10vh, 6.5rem);
  max-width: 64rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 1.5rem + 4.8vw, 5.25rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-shadow: 0 2px 30px rgba(6, 30, 35, 0.45);
}
.hero p {
  margin-top: var(--space-3);
  max-width: 38rem;
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  color: var(--on-dark);
  text-shadow: 0 1px 12px rgba(6, 30, 35, 0.5);
}

/* Primary action: text with a drawn rule, no pill. */
.action {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: var(--space-4);
  padding: 0.35rem 0;
  border: 0;
  background: none;
  font: 600 0.95rem/1 var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.action::after {
  content: "";
  width: 4.75rem;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0.63);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.action:hover::after, .action:focus-visible::after { transform: scaleX(1); }
.action--light { color: var(--on-dark); }
.action--dark { color: var(--ink); margin-top: 0; }
.action[disabled] { opacity: 0.45; cursor: progress; }
.action[disabled]::after { transform: scaleX(0.63); }

.record {
  padding: var(--space-6) var(--gutter);
  display: grid;
  gap: var(--space-4);
  max-width: 76rem;
}
.record__figure {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 1.4rem + 4vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.record__figure em { font-style: italic; font-weight: 400; color: var(--teal-text); }
.record__text { display: grid; gap: var(--space-2); max-width: 44rem; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-soft); }
@media (min-width: 900px) {
  .record { grid-template-columns: 6fr 5fr; align-items: end; gap: clamp(3rem, 7vw, 7rem); }
}

.band {
  position: relative;
  height: clamp(16rem, 52vh, 34rem);
  overflow: hidden;
  background: var(--ink);
}

.approach h2, .ownership h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }

/* Feature sections: lending and syndications carry the page. */
.feature {
  padding: var(--space-6) var(--gutter);
  display: grid;
  gap: var(--space-5);
}
.feature--stone { background: var(--stone); }
.feature h2 {
  font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.2rem);
  letter-spacing: -0.02em;
}
.feature h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: var(--space-3);
  background: var(--teal);
}
.feature__lead { display: grid; gap: var(--space-2); max-width: 46rem; }
.feature__lead p { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-soft); }
.feature__lead p:first-of-type { margin-top: var(--space-2); color: var(--ink); }
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}
.facts > div { padding: var(--space-3) 0 var(--space-4); border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem); }
.facts dd { margin: var(--space-1) 0 0; color: var(--ink-soft); max-width: 30rem; }
.feature .action { margin-top: 0; justify-self: start; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 5fr 6fr; column-gap: clamp(3rem, 7vw, 7rem); align-items: start; }
  .feature .action { grid-column: 1; }
  .facts { grid-row: span 2; }
}

.ownership { padding: var(--space-6) var(--gutter); max-width: 62rem; }
.ownership p { margin-top: var(--space-3); max-width: 46rem; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-soft); }

.footer__note { max-width: 46rem; font-size: 0.82rem; opacity: 0.85; }

.approach {
  background: var(--stone);
  padding: var(--space-6) var(--gutter);
}
.principles {
  margin: var(--space-5) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}
.principles > div { padding: var(--space-4) 0; border-bottom: 1px solid var(--rule); }
.principles dt { font-family: var(--display); font-weight: 600; font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem); }
.principles dd { margin: var(--space-1) 0 0; color: var(--ink-soft); max-width: 30rem; }
@media (min-width: 900px) {
  .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
  .principles > div { padding: var(--space-4) var(--space-4) var(--space-5) 0; border-bottom: 0; }
  .principles > div + div { padding-left: var(--space-4); border-left: 1px solid var(--rule); }
}

.contact {
  padding: var(--space-6) var(--gutter);
  display: grid;
  gap: var(--space-5);
}
.contact h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }
.contact__intro p { margin-top: var(--space-2); max-width: 26rem; color: var(--ink-soft); }
@media (min-width: 900px) {
  .contact { grid-template-columns: 4fr 7fr; gap: clamp(3rem, 7vw, 7rem); align-items: start; }
}

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
}
@media (min-width: 640px) {
  .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide, .form__foot { grid-column: 1 / -1; }
}
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.85rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.optional { color: var(--ink-soft); opacity: 0.75; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.3s var(--ease-out);
  appearance: none;
}
.field select {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230c2a30' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat right 0.2rem center;
  padding-right: 1.5rem;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-bottom-color: var(--ink-soft); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom: 1px solid var(--teal); box-shadow: 0 1px 0 var(--teal); }
.field [aria-invalid="true"] { border-bottom-color: var(--error); box-shadow: 0 1px 0 var(--error); }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-1);
}
.cf-turnstile { min-height: 65px; flex: 1 1 18rem; max-width: 22rem; }
.form__status { flex-basis: 100%; min-height: 1.6em; font-size: 0.95rem; }
.form__status[data-state="error"] { color: var(--error); }
.form__status[data-state="sent"] { color: var(--teal-text); }
.form.is-sent .field, .form.is-sent .cf-turnstile, .form.is-sent button { display: none; }
.form.is-sent .form__status { font-family: var(--display); font-size: 1.6rem; color: var(--ink); }

.footer {
  background: var(--ink);
  color: var(--on-dark-soft);
  padding: var(--space-5) var(--gutter);
  display: grid;
  gap: var(--space-2);
  font-size: 0.9rem;
}
.footer__logo { height: 4.5rem; width: auto; margin-bottom: var(--space-2); }
.footer p { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer a { color: var(--on-dark); }

/* Legal page */
.legal { max-width: 44rem; margin: 0 auto; padding: 9rem var(--gutter) var(--space-6); }
.legal h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); margin-bottom: var(--space-4); }
.legal h2 { font-size: 1.5rem; margin: var(--space-4) 0 var(--space-1); }
.legal p { color: var(--ink-soft); margin-bottom: var(--space-2); }
.masthead--static { position: sticky; background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--rule); }

/* Entrance: one authored moment, hero copy rising from an already-visible state. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: rise 1.4s var(--ease-out) both; }
  .hero__copy > :nth-child(2) { animation-delay: 0.12s; }
  .hero__copy > :nth-child(3) { animation-delay: 0.24s; }
}
@keyframes rise {
  from { transform: translateY(1.25rem); opacity: 0.001; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 560px) {
  .masthead__nav { gap: 0.9rem; }
  .masthead__nav a { font-size: 0.85rem; letter-spacing: 0.02em; }
}
