/* ==========================================================================
   Echelon at Valley Children's
   ========================================================================== */

:root {
  --color-orange: #c8762f;
  --color-orange-deep: #b55d2b;
  --color-blue: #58a7cc;
  --color-green: #819247;
  --color-purple: #946bd7;
  --color-sky-top: #687d80;
  --color-sky-bottom: #8ba7ad;
  --color-sand: #cdccbb;
  --color-stone: #6c6e61;
  --color-cta: #8da849;
  --color-cta-hover: #7c9540;
  --color-charcoal: #383838;
  --color-muted: #9a9a9a;
  --color-mist: #dbddd9;
  --color-link: #2f6cbf;
  --color-white: #fff;

  --font-heading: "sweet-sans-pro", "Arial Black", sans-serif;
  --font-body: "museo-sans", "Museo Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.5rem, 6.5vw, 3rem);
  --section-pad: clamp(3rem, 12vw, 5rem);
}

/* Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-charcoal);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.25rem);
  font-weight: 300;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

p {
  margin: 0 0 0.65em;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  padding: 0.75rem 1.25rem;
  background: var(--color-white);
  color: var(--color-charcoal);
  font-weight: 700;
  transform: translateY(-100%);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: 100%;
  padding-inline: var(--gutter);
}

.heading {
  margin: 0 0 0.9em;
  font-family: var(--font-heading);
  font-size: clamp(1.1875rem, 0.95rem + 1.1vw, 1.375rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.heading br {
  display: none;
}

.tagline {
  margin: 0;
  color: var(--color-muted);
  font-weight: 300;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

/* Header
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--color-charcoal);
}

.site-header__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
}

.site-header__logo img {
  width: clamp(9rem, 49vw, 15rem);
  opacity: 0.6;
}

.site-header__tagline {
  order: 3;
  flex-basis: 100%;
  font-size: clamp(1.0625rem, 5vw, 1.625rem);
}

/* Sections
   Small screens stack copy above its photo; wide screens overlay them.
   ========================================================================== */

.section {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section__inner {
  position: relative;
  z-index: 1;
  padding-block: var(--section-pad) 2rem;
}

.section__content > :last-child {
  margin-bottom: 0;
}

/* Short copy on small screens, full copy on wide ones */

.copy > :last-child {
  margin-bottom: 0;
}

.copy--full {
  display: none;
}

.section__media {
  width: 100%;
  max-width: none;
}

/* Hero */

.hero {
  background: var(--color-orange);
}

.hero::before {
  content: "";
  position: absolute;
  top: 22%;
  left: -75.8vw;
  width: 215vw;
  height: 215vw;
  border-radius: 50%;
  background: linear-gradient(var(--color-orange-deep), transparent 60vw);
  pointer-events: none;
}

.hero .section__inner {
  padding-block: clamp(4rem, 16vw, 6rem);
}

.hero__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 58%;
  min-height: 80vw;
}

/* The hero logo only appears on wide screens. */
.hero__logo {
  display: none;
}

.hero .heading {
  margin-bottom: 0;
}

@media (max-width: 47.99em) {
  .hero .section__media {
    position: absolute;
    top: 0;
    right: -6vw;
    width: 62vw;
    height: 104vw;
    object-fit: cover;
    object-position: 50% 0;
    -webkit-mask-image: linear-gradient(#000 78%, transparent);
    mask-image: linear-gradient(#000 78%, transparent);
  }
}

/* Care */

.care {
  background: var(--color-blue);
}

@media (max-width: 47.99em) {
  .care .section__media {
    width: 105%;
  }
}

/* Discover */

.discover {
  background: var(--color-green);
}

@media (max-width: 47.99em) {
  .discover .section__media {
    margin-top: -4vw;
    -webkit-mask-image: linear-gradient(transparent, #000 30%);
    mask-image: linear-gradient(transparent, #000 30%);
  }
}

/* Moments */

.moments {
  background: var(--color-purple);
}

@media (max-width: 47.99em) {
  .moments .section__media {
    margin-top: -8vw;
    -webkit-mask-image: linear-gradient(transparent, #000 40%);
    mask-image: linear-gradient(transparent, #000 40%);
  }
}

/* Valley life */

.valley-life {
  background: linear-gradient(var(--color-sky-top) 20%, var(--color-sky-bottom));
}

.valley-life .heading {
  color: var(--color-sand);
}

@media (max-width: 47.99em) {
  .valley-life .section__media {
    -webkit-mask-image: linear-gradient(transparent, #000 12%);
    mask-image: linear-gradient(transparent, #000 12%);
  }
}

/* Taking shape */

.taking-shape {
  background: var(--color-stone);
}

.taking-shape .section__inner {
  padding-bottom: 0;
}

@media (max-width: 47.99em) {
  .taking-shape .section__media {
    margin-top: -22vw;
  }
}

/* Button
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3rem;
  margin-top: 1.25rem;
  padding: 0.9em 1.4em;
  border-radius: 0.5em;
  background: var(--color-cta);
  box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 0.2);
  color: var(--color-white);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

.button:hover {
  background: var(--color-cta-hover);
}

.button__icon {
  flex: none;
  width: 1.5em;
  height: 1.5em;
  transition: transform 0.2s ease;
}

.button:hover .button__icon {
  transform: translateX(0.25em);
}

/* Scroll reveal
   Copy fades and slides up as its section enters view (see motion.js).
   ========================================================================== */

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
  }

  .js .is-visible .reveal {
    animation: reveal 1.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    animation-delay: calc(var(--reveal-index, 0) * 165ms);
  }
}

/* Leasing page
   ========================================================================== */

.leasing {
  background: linear-gradient(var(--color-mist) 45%, #9dbfe0 82%, var(--color-mist));
  color: #000;
}

.leasing .section__inner {
  padding-top: 3rem;
}

.leasing__back {
  margin-top: 2em;
  font-size: 0.85em;
}

.leasing__back a {
  display: inline-block;
  padding-block: 0.25em;
  color: var(--color-link);
  font-weight: 700;
  text-decoration: none;
}

.leasing__back a:hover {
  text-decoration: underline;
}

.leasing .heading {
  margin-bottom: 0.4em;
  color: var(--color-link);
}

.leasing__label {
  margin: 1.75em 0 0.9em;
  font-family: var(--font-heading);
  font-size: 0.9em;
  font-weight: 800;
  text-transform: uppercase;
}

.contact {
  margin-bottom: 0.9em;
  font-style: normal;
}

.contact__name {
  display: block;
  font-weight: inherit;
}

.contact a {
  display: inline-block;
  padding-block: 0.2em;
}

.contact__phone {
  text-decoration: none;
}

.contact__email {
  color: var(--color-link);
  font-style: italic;
  overflow-wrap: anywhere;
}

@media (max-width: 47.99em) {
  .leasing .section__media {
    margin-top: -4vw;
    -webkit-mask-image: linear-gradient(transparent, #000 35%);
    mask-image: linear-gradient(transparent, #000 35%);
  }
}

/* Footer
   ========================================================================== */

.site-footer {
  padding-block: clamp(3rem, 5vw, 5rem);
  background: var(--color-charcoal);
  color: var(--color-muted);
  text-align: center;
}

.site-footer__home {
  display: inline-block;
}

.site-footer__logo {
  width: clamp(11rem, 27vw, 24rem);
  margin-inline: auto;
  opacity: 0.6;
}

.site-footer__tagline {
  margin-top: clamp(1.375rem, 2.2vw, 2.125rem);
  font-size: clamp(1.125rem, 1.75vw, 1.625rem);
}

.site-footer__legal {
  margin: clamp(1.5rem, 2.5vw, 2.5rem) 0 0;
  font-size: clamp(0.8125rem, 1.2vw, 1.0625rem);
}

.site-footer__legal small {
  font-size: inherit;
}

/* Wide layout
   Positions follow the 2048px desktop comp, expressed in viewport units.
   ========================================================================== */

@media (min-width: 48em) {
  :root {
    --gutter: 12.5vw;
  }

  body {
    font-size: clamp(1.125rem, 1.56vw, 2rem);
  }

  .heading {
    font-size: clamp(1.1875rem, 1.85vw, 2.375rem);
  }

  .heading br {
    display: inline;
  }

  .hero .heading br,
  .taking-shape .heading br {
    display: none;
  }

  /* Header */

  .site-header__inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 3.7vw;
    padding-block: 0.85vw;
  }

  .site-header__logo img {
    width: clamp(8rem, 12.9vw, 16.5rem);
  }

  .site-header__tagline {
    order: 0;
    flex-basis: auto;
    padding-left: 3.7vw;
    border-left: 1px solid rgb(255 255 255 / 0.15);
    font-size: clamp(1rem, 1.9vw, 2.375rem);
    line-height: 2.3;
    white-space: nowrap;
  }

  /* Sections */

  .section {
    justify-content: center;
    min-height: 56.25vw;
  }

  .section__inner {
    padding-block: 5vw;
  }

  .section__content {
    margin-left: 2.3vw;
  }

  .copy--short {
    display: none;
  }

  .copy--full {
    display: block;
  }

  .section__media {
    position: absolute;
  }

  .cover {
    background: #111;
  }

  .cover .section__media {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .cover::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  /* Hero */

  .hero {
    min-height: 50.2vw;
  }

  .hero .section__inner {
    padding-block: 7.5vw;
  }

  .hero::before {
    top: 46%;
    background: linear-gradient(var(--color-orange-deep), transparent 22vw);
  }

  .hero .section__content {
    max-width: 33em;
    margin-left: 0;
  }

  .hero__intro {
    display: block;
    max-width: none;
    min-height: 0;
  }

  .hero__logo {
    display: block;
    width: 42.1vw;
    margin-top: 5.5vw;
  }

  .hero .heading {
    margin-bottom: 0.9em;
  }

  .hero .section__media {
    top: -10.06vw;
    right: auto;
    left: 41.36vw;
    width: 67.1vw;
    height: auto;
  }

  /* Care */

  .care .section__content {
    max-width: 25em;
    margin-left: 38.3vw;
  }

  .care .section__media {
    bottom: 0;
    left: -8.06vw;
    width: 62.5vw;
    max-height: 96%;
    object-fit: contain;
    object-position: 0 100%;
  }

  .care::before,
  .discover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: no-repeat center / 100% 100%;
    pointer-events: none;
  }

  .care::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 788' preserveAspectRatio='none'%3E%3Cpath d='M0 330C330 300 560 90 930 80c200-5 350 50 470 100' fill='none' stroke='%233d97d3' stroke-width='5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  }

  /* Discover */

  .discover .section__content {
    max-width: 24.5em;
  }

  .discover .section__media {
    top: 0;
    right: 0;
    width: 62vw;
    height: 100%;
    object-fit: cover;
    object-position: 0 35%;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 38%);
    mask-image: linear-gradient(to right, transparent, #000 38%);
  }

  .discover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 788' preserveAspectRatio='none'%3E%3Cpath d='M0 712c230 20 380-130 600-135 200-5 330 110 520 120 110 6 200-20 280-50' fill='none' stroke='%2374843b' stroke-width='3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  }

  /* Moments */

  .moments .section__content {
    max-width: 26.5em;
  }

  .moments::after {
    background: linear-gradient(to right, rgb(0 0 0 / 0.6), rgb(0 0 0 / 0.2) 75%);
  }

  /* Valley life */

  .valley-life .section__content {
    max-width: 20.5em;
  }

  .valley-life .heading {
    color: inherit;
  }

  .valley-life::after {
    background: linear-gradient(to right, rgb(0 0 0 / 0.6), transparent 55%);
  }

  /* Taking shape */

  .taking-shape {
    justify-content: flex-start;
  }

  .taking-shape .section__inner {
    padding-top: 6.6vw;
  }

  .taking-shape .section__content {
    max-width: 31em;
  }

  .taking-shape::after {
    background: linear-gradient(to right, rgb(0 0 0 / 0.3), transparent 66%);
  }

  .button {
    min-width: 19em;
    font-size: 0.72em;
  }

  /* Leasing */

  .leasing {
    justify-content: flex-start;
    min-height: 58vw;
    background: var(--color-mist);
  }

  .leasing .section__inner {
    padding-top: 6.5vw;
  }

  .leasing .section__content {
    max-width: none;
    margin-left: 0;
  }

  .leasing .section__media {
    right: 0;
    bottom: 0;
    width: 82.9vw;
    -webkit-mask-image: linear-gradient(to right, transparent 4%, #000 60%), linear-gradient(transparent 5%, #000 50%);
    mask-image: linear-gradient(to right, transparent 4%, #000 60%), linear-gradient(transparent 5%, #000 50%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
}

/* Parallax
   Photos drift against the scroll on wide screens. motion.js sets
   --parallax-shift from -1 to 1 as each section crosses the viewport.
   ========================================================================== */

@media (min-width: 48em) and (prefers-reduced-motion: no-preference) {
  .js .hero .section__media,
  .js .discover .section__media,
  .js .cover .section__media {
    transform: translateY(calc(var(--parallax-shift, 0) * var(--parallax)));
    will-change: transform;
  }

  .js .hero .section__media {
    --parallax: 4vw;
  }

  /* Swooshes move the opposite way to the photos, so the layers separate. */
  .js .hero::before,
  .js .care::before,
  .js .discover::before {
    transform: translateY(calc(var(--parallax-shift, 0) * -6vw));
    will-change: transform;
  }

  /* Oversize the photo so its edges never show while it moves. */
  .js .discover .section__media,
  .js .cover .section__media {
    --parallax: 9%;
    top: -12%;
    bottom: auto;
    height: 124%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
