/* Shared styles for the site entrance and the mockup pages. */

:root {
  --black: #000000;
  --white: #ffffff;
  --bar-height: 44px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--white);
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Shader background ---------- */

#tree {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--black);
}

.fallback {
  display: none;
  position: fixed;
  inset: 0;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: #6b6b6b;
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  z-index: 0;
}

.no-webgl .fallback {
  display: grid;
}

.no-webgl #tree {
  display: none;
}

#glcanvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--black);
}

.no-webgl #glcanvas {
  display: none;
}

/* ---------- Entrance ---------- */

.entrance {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px;
}

.entrance__options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 340px;
}

.option {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--white);
  background: rgba(0, 0, 0, 0.62);
  color: var(--white);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.option:hover,
.option:focus-visible {
  background: var(--white);
  color: var(--black);
  outline: none;
}

/* ---------- Wordmark (Mockup #1) ---------- */

@font-face {
  font-family: "Ishmeria";
  src: url("fonts/Ishmeria.woff") format("woff"),
    url("fonts/Ishmeria.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.brand {
  position: absolute;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--black);
  font-family: "Ishmeria", "Times New Roman", serif;
  font-size: 48px; /* pixel font: multiples of 16 keep the glyphs crisp */
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: 0.12em; /* room for the 3px outline around each letter */
  text-align: center;
  white-space: nowrap;
}

.brand__word {
  display: inline-block;
  white-space: nowrap;
}

/* the outline is a ring of hard white text-shadows, set in brand.js */
.brand__letter {
  display: inline-block;
  will-change: transform;
}

@media (max-width: 780px) {
  /* on a phone the hero group is centred in the viewport, so the wordmark
     sits over the canopy the way it does on desktop */
  .hero {
    justify-content: center;
    padding: 96px 20px 88px;
  }

  .brand {
    font-size: 26px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  /* the text sits inside the canopy on a phone, so the legibility wash is
     wider and centred on it */
  .hero::before {
    background: radial-gradient(
      124% 54% at 50% 44%,
      rgba(0, 0, 0, 0.88) 0%,
      rgba(0, 0, 0, 0.7) 44%,
      rgba(0, 0, 0, 0.18) 76%,
      rgba(0, 0, 0, 0) 88%
    );
  }
}

/* ---------- Mockup pages ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 10;
}

.topbar__back {
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.topbar__back:hover,
.topbar__back:focus-visible {
  text-decoration: underline;
  outline: none;
}

.mockup {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: calc(var(--bar-height) + 40px) 24px 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.mockup__label {
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Mockup #1: page ---------- */

html {
  scroll-behavior: smooth;
}

.site {
  position: relative;
  z-index: 1;
}

/* --- hero --- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 150px 24px 96px;
  text-align: center;
}

.hero .brand {
  position: static;
  transform: none;
}

.hero__where {
  margin: 34px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero__what {
  max-width: 38ch;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 34px 0 0;
}

.hero__trust {
  margin: 30px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero__cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
}

.hero__cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 30px;
  margin: 12px auto 0;
  background: linear-gradient(rgba(255, 255, 255, 0.5), transparent);
}

/* --- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 30px;
  border: 1px solid var(--white);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.btn--solid {
  background: var(--white);
  color: var(--black);
}

.btn--solid:hover,
.btn--solid:focus-visible {
  background: transparent;
  color: var(--white);
}

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

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--white);
  color: var(--black);
}

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

/* --- proof strip --- */

.proof {
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.proof__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 44px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 24px;
}

.proof__item {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* --- sections --- */

.section {
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 120px 24px;
  scroll-margin-top: var(--bar-height);
}

.section--first {
  border-top: 0;
  padding-top: 96px;
}

.section__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section__label {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section__lead {
  max-width: 62ch;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  line-height: 1.7;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 34px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.section__sub {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
}

.section__count {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* --- work cards --- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

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

.work-card__shot {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #070707;
}

.work-card__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 400ms ease, opacity 400ms ease;
}

.work-card:hover .work-card__shot img,
.work-card:focus-visible .work-card__shot img {
  transform: scale(1.03);
  opacity: 1;
}

.work-card__shot--type {
  display: grid;
  place-items: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}

.work-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 0;
}

.work-card__name {
  font-size: 15px;
}

.work-card__go {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.work-card:hover .work-card__go {
  color: var(--white);
}

.work-grid__more {
  margin: 44px 0 0;
}

/* --- steps --- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 44px;
}

.step {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 20px;
}

.step__num {
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.step__title {
  margin: 14px 0 10px;
  font-size: 18px;
  font-weight: 400;
}

.step__body {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  line-height: 1.65;
}

/* --- testimonial --- */

.quote {
  max-width: 780px;
  margin: 0;
}

.quote__text {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.45;
}

.quote__by {
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

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

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact__direct {
  margin: 28px 0 0;
}

.contact__direct a {
  display: block;
  width: fit-content;
  margin-bottom: 14px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  font-size: 18px;
  text-decoration: none;
}

.contact__direct a:hover,
.contact__direct a:focus-visible {
  border-color: var(--white);
  outline: none;
}

.contact__note {
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  line-height: 1.6;
}

.quote-form {
  display: grid;
  gap: 26px;
}

.field {
  display: block;
}

.field__label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 16px;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--white);
  outline: none;
}

.quote-form__done {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.6;
}

/* --- footer --- */

.foot {
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 34px 24px;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.foot__inner a {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
}

.foot__inner a:hover,
.foot__inner a:focus-visible {
  color: var(--white);
  outline: none;
}

/* --- extra topbar bits --- */

.topbar {
  justify-content: space-between;
  gap: 16px;
}

.topbar__home {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.topbar__home:hover,
.topbar__home:focus-visible {
  color: var(--white);
  outline: none;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.topbar__nav a {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.topbar__nav a:hover,
.topbar__nav a:focus-visible {
  color: var(--white);
  outline: none;
}

.topbar__cta {
  border: 1px solid var(--white);
  padding: 7px 14px;
  color: var(--white) !important;
}

.topbar__cta:hover,
.topbar__cta:focus-visible {
  background: var(--white);
  color: var(--black) !important;
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .contact {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .section {
    padding: 84px 20px;
  }
}

@media (max-width: 700px) {
  .topbar__nav {
    display: none;
  }
}

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

  .hero {
    justify-content: center;
    padding: 104px 20px 88px;
  }
}

/* --- hero legibility over the canopy --- */

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    58% 44% at 50% 31%,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.62) 40%,
    rgba(0, 0, 0, 0.22) 66%,
    rgba(0, 0, 0, 0) 82%
  );
  pointer-events: none;
}

.hero__where,
.hero__what,
/* these lines cross both the black sky and the white foliage, so they carry a
   tight dark halo as well as a bright fill */
.hero__where,
.hero__trust,
.hero__cue {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 1px 6px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(0, 0, 0, 0.75),
    0 0 34px rgba(0, 0, 0, 0.5);
}

/* --- root digits rain over the page --- */

#rain {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- portfolio rails --- */

.section--work {
  padding: 120px 0 96px;
  overflow: hidden;
}

.section--work .section__inner {
  padding: 0 24px;
}

.section__eyebrow {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* the work section is titled with one centered label, nothing else */
.section--work .section__head {
  display: block;
  text-align: center;
}

.section--work .section__eyebrow {
  margin: 0;
  color: var(--white);
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: 0.16em;
}

.work-hint {
  margin: 20px auto 0;
  max-width: 64ch;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.work-hint__touch {
  display: none;
}

.work-groups {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.work-group {
  margin-top: 64px;
}

.work-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.work-group__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.work-group__count {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.work-group__note {
  margin: 13px 0 0;
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  line-height: 1.65;
}

.rail {
  position: relative;
  overflow: hidden;
  padding: 6px 0 12px;
  margin-top: 24px;
}

.rail::before,
.rail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  z-index: 3;
  pointer-events: none;
}

.rail::before {
  left: 0;
  background: linear-gradient(90deg, var(--black), rgba(0, 0, 0, 0));
}

.rail::after {
  right: 0;
  background: linear-gradient(270deg, var(--black), rgba(0, 0, 0, 0));
}

.rail__track {
  display: flex;
  gap: 22px;
  width: max-content;
  will-change: transform;
}

.rail-card {
  display: block;
  flex: 0 0 auto;
  width: 240px;
  color: inherit;
  text-decoration: none;
}

.rail-card__shot {
  position: relative;
  display: block;
  overflow: hidden;
}

.rail-card .concept-preview,
.rail-card .niche-preview {
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: border-color 0.2s ease, transform 0.35s ease;
}

.rail-card:hover .concept-preview,
.rail-card:hover .niche-preview,
.rail-card:focus-visible .concept-preview,
.rail-card:focus-visible .niche-preview {
  border-color: rgba(255, 255, 255, 0.55);
}

.rail-card__cta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.74);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* the clinic headline is the one tile without a max-width in gallery.css, so at
   gallery width it runs under the photo — wrap it like its siblings do */
.rail-card .preview-chiropractor strong {
  max-width: 46%;
}

.rail-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rail-card:hover .rail-card__meta {
  color: var(--white);
}

@media (max-width: 900px) {
  .work-hint__mouse {
    display: none;
  }

  .work-hint__touch {
    display: inline;
  }

  /* thumbnails are drawn at a fixed design width and scaled down as a whole,
     so a smaller tile keeps its exact proportions */
  .rail {
    touch-action: pan-y;
  }

  .rail__track {
    gap: 14px;
  }

  .rail-card {
    --s: 0.8;
    width: calc(250px * var(--s));
  }

  .rail-card__shot {
    --shot-h: 240px;
    height: calc(var(--shot-h) * var(--s));
  }

  .rail-card__shot:has(.niche-preview) {
    --shot-h: 260px;
  }

  .rail-card__shot:has(.preview-burger-joint),
  .rail-card__shot:has(.preview-chiropractor) {
    --shot-h: 300px;
  }

  .rail-card__shot:has(.preview-cinema) {
    --shot-h: 330px;
  }

  .rail-card__shot > .concept-preview,
  .rail-card__shot > .niche-preview {
    width: calc(100% / var(--s));
    height: var(--shot-h);
    transform: scale(var(--s));
    transform-origin: top left;
    /* the scale is layout here, so it must not animate in on first paint */
    transition: border-color 0.2s ease;
  }

  /* the tile already carries its category, so the caption is one tidy line */
  .rail-card__meta {
    display: block;
    padding-top: 7px;
    font-size: 9px;
  }

  .rail-card__name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rail-card__cat {
    display: none;
  }

  /* a full "open mockup" chip swallows a phone-sized tile, so it becomes a
     corner badge */
  .rail-card__cta {
    opacity: 1;
    transform: none;
    transition: none;
    padding: 4px 5px;
    font-size: 0;
    line-height: 1;
  }

  .rail-card__cta > span {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .work-groups {
    padding: 0 18px;
  }

  .rail__track {
    gap: 12px;
  }

  .rail-card {
    --s: 0.7;
  }

  .rail-card__cta {
    left: 6px;
    bottom: 6px;
  }

  .rail::before,
  .rail::after {
    width: 30px;
  }
}

@media (min-width: 901px) {
  .rail {
    overflow: visible;
    padding: 0;
    margin-top: 24px;
  }

  .rail::before,
  .rail::after {
    display: none;
  }

  .rail__track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 28px;
    width: auto;
    transform: none !important;
    will-change: auto;
  }

  .rail--reverse .rail__track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }

  .rail-card {
    width: auto;
  }

  .rail-card--clone {
    display: none;
  }

  .rail-card:hover .concept-preview,
  .rail-card:hover .niche-preview {
    transform: translateY(-4px);
  }

  .rail-card__cta {
    opacity: 0;
    transform: translateY(4px);
  }

  .rail-card:hover .rail-card__cta,
  .rail-card:focus-visible .rail-card__cta {
    opacity: 1;
    transform: none;
  }
}
.rail__note {
  max-width: 62ch;
  margin: 44px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  line-height: 1.7;
}

.no-motion .rail {
  overflow-x: auto;
}

