/* ============================================================
   Urban Engineers — Home
   Brand tokens come from the logo SVGs (symbol / join us)
   ============================================================ */

@font-face {
  font-family: "Pompei Block";
  src: url("../assets/fonts/Pompei_Block_FS-VF.woff2") format("woff2-variations"),
       url("../assets/fonts/Pompei_Block_FS-VF.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* brand */
  --plum:        #2d0e1f;
  --plum-deep:   #1f0915;
  --plum-glow:   #4a1330;
  --pink:        #e9597b;
  --magenta:     #e355f6;
  --sand:        #cec1bb;
  --sand-dim:    rgba(206, 193, 187, .68); /* 5.2:1 on plum — AA for text */
  --line:        rgba(206, 193, 187, .5);  /* 3.4:1 — AA for UI borders */

  --font: "Pompei Block", "Assistant", "Heebo", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 350;
  color: var(--sand);
  background: var(--plum);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* the hidden attribute always wins over component display rules */
[hidden] { display: none !important; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 4px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: fixed; inset-inline-start: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--sand); color: var(--plum); text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ============================================================
   1. HERO
   ============================================================ */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: var(--plum-deep);
}

/* photo: parallax moves it down slower than the page, so the gap it leaves
   at the top is always already scrolled out of view — no oversizing needed */
.hero__media {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: grayscale(1);
  animation: hero-in 2.2s var(--ease-out) both;
}
@keyframes hero-in {
  from { transform: scale(1.08); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* plum tint + fade into the form section */
.hero__shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(45, 14, 31, .22) 100%),
    linear-gradient(180deg,
      rgba(45, 14, 31, .12) 0%,
      rgba(45, 14, 31, 0) 25%,
      rgba(45, 14, 31, 0) 55%,
      rgba(45, 14, 31, .35) 72%,
      rgba(45, 14, 31, .8) 88%,
      var(--plum) 100%);
  pointer-events: none;
}

/* the logo floating over the photo */
.hero__logo {
  position: absolute;
  top: 50%; left: 50%;
  width: 55%;
  aspect-ratio: 1;
  translate: -50% -50%;
  will-change: transform;
  pointer-events: none;
  /* nude symbol + color-dodge = copper lines on dark areas, white on light ones.
     The blend sits on the positioned layer (not the <img>) so it reaches the photo. */
  mix-blend-mode: color-dodge;
  opacity: .7;
}
.hero__logo img {
  width: 100%;
  height: 100%;
  animation: logo-in 1.8s .5s var(--ease-out) both;
}
@keyframes logo-in {
  from { opacity: 0; transform: scale(.9); filter: blur(12px); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* film grain — tiled noise, jittered in steps */
.grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-6%, 4%); }
  33%  { transform: translate(5%, -7%); }
  50%  { transform: translate(-3%, 8%); }
  67%  { transform: translate(8%, 2%); }
  83%  { transform: translate(-7%, -4%); }
  100% { transform: translate(0, 0); }
}

.hero__content img { filter: drop-shadow(0 1px 12px rgba(45, 14, 31, .55)); }

.hero__content {
  position: absolute;
  inset-inline: 0;
  bottom: clamp(88px, 14vh, 140px);
  z-index: 4;
  text-align: center;
  padding-inline: var(--gutter);
  will-change: transform;
}

.hero__welcome {
  width: min(70vw, 440px);
  height: auto;
  margin: 0 auto -.4rem;
  opacity: .95;
  animation: write 1.8s .8s var(--ease-out) both;
}
@keyframes write {
  from { clip-path: inset(-20% 100% -20% 0); }
  to   { clip-path: inset(-20% 0 -20% 0); }
}

.wordmark {
  margin: 0;
  line-height: 1;
  animation: rise 1.2s 1.4s var(--ease-out) both;
}
.wordmark img {
  width: min(78vw, 420px);
  height: auto;
  margin: 0 auto;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.hero__cue {
  position: absolute;
  bottom: 28px; left: 50%;
  z-index: 4;
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--sand);
  text-decoration: none;
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  opacity: .8;
  transition: opacity .3s;
  animation: rise 1s 1.6s var(--ease-out) both;
}
.hero__cue:hover { opacity: 1; }
.hero__cue svg { animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ============================================================
   2. JOIN
   ============================================================ */

.join {
  position: relative;
  padding: clamp(56px, 10vw, 110px) var(--gutter) clamp(40px, 6vw, 64px);
  margin-top: -1px; /* no hairline between hero and section */
  overflow-x: clip;
  background: var(--plum);
}

.join__inner {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* heading: eyebrow + script "join us" + subtitle */
.join__head {
  position: relative;
  text-align: center;
  width: 100%;
}
.join__eyebrow {
  margin: 0;
  font-size: clamp(1.1rem, 2.6vw, 1.55rem);
  font-weight: 250;
  letter-spacing: .08em;
  line-height: 1;
}
.join__eyebrow strong { font-weight: 550; }

.join__title {
  margin: -.3rem auto 0;
  width: min(100%, 400px);
}
.join__title img {
  width: 100%;
  height: auto;
  /* the script's tail hangs off the left, so the letters sit right of the
     SVG's center — shift them back under the eyebrow */
  translate: -9% 0;
}

.join__sub {
  position: relative;
  margin: -1.6rem 0 0;
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  font-weight: 350;
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- form ---------- */
.join__pending {
  margin: 0 0 6px;
  padding: 12px 16px;
  font-size: .95rem;
  text-align: center;
  color: #ffd3df;
  background: rgba(233, 89, 123, .12);
  border-radius: 12px;
}

.form {
  width: 100%;
  margin-top: clamp(20px, 4vw, 36px);
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 40px;
}
@media (min-width: 640px) {
  .form__grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
}

.field {
  position: relative;
  padding-top: 26px;
}
.field input {
  width: 100%;
  padding: 14px 0 12px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--sand);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  transition: border-color .3s;
}
.field input:focus { border-color: var(--sand); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--sand);
  transition: background-color 9999s;
}

/* floating label — sits in the field, lifts on focus / filled */
.field label {
  position: absolute;
  inset-inline-start: 0;
  top: 40px;
  font-size: 1.05rem;
  color: var(--sand-dim);
  pointer-events: none;
  transform-origin: right center;
  transition: transform .3s var(--ease-out), color .3s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  transform: translateY(-26px) scale(.78);
  color: var(--sand);
}

/* animated underline */
.field::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--magenta), var(--pink));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.field:focus-within::after { transform: scaleX(1); }

.field.is-invalid input { border-color: var(--pink); }
.field.is-invalid label { color: var(--pink); }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }

/* consent checkbox */
.consent {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  font-size: .98rem;
  cursor: pointer;
  text-align: start;
}
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent__box {
  flex: none;
  width: 18px; height: 18px;
  margin-top: 3px;
  border: 1px solid var(--sand-dim);
  border-radius: 4px;
  transition: background .2s, border-color .2s;
  position: relative;
}
.consent__box::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--plum);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .2s var(--ease-out);
}
.consent input:checked + .consent__box { background: var(--sand); border-color: var(--sand); }
.consent input:checked + .consent__box::after { transform: rotate(45deg) scale(1); }
.consent input:focus-visible + .consent__box { outline: 2px solid var(--pink); outline-offset: 3px; }
.consent.is-invalid .consent__box { border-color: var(--pink); }

.link {
  color: var(--pink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .3s;
}
.link:hover { background-size: 100% 1px; }

.form__error {
  margin: 16px 0 0;
  text-align: center;
  color: var(--pink);
  font-size: .95rem;
}

/* submit */
.btn-join {
  position: relative;
  display: block;
  margin: 28px auto 0;
  padding: 10px 18px;
  font: inherit;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--sand);
  background: none;
  border: 0;
  cursor: pointer;
}
.btn-join__label {
  background: linear-gradient(90deg, var(--magenta), var(--pink), var(--sand), var(--sand)) 100% 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position .6s var(--ease-out);
}
.btn-join:hover .btn-join__label,
.btn-join:focus-visible .btn-join__label { background-position: 0 0; }

.btn-join__spinner {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid var(--line);
  border-top-color: var(--pink);
  border-radius: 50%;
  opacity: 0;
}
.btn-join.is-loading .btn-join__label { opacity: 0; }
.btn-join.is-loading .btn-join__spinner { opacity: 1; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* success state */
.form__success {
  margin-top: 36px;
  text-align: center;
  outline: none;
}
.form__success-mark { width: 72px; margin: 0 auto 12px; }
.form__success-title {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 650;
}
.form__success p:last-child { margin: 0; opacity: .85; }

/* mark + follow */
.join__mark {
  width: 72px;
  margin-top: clamp(32px, 5vw, 44px);
  transition: transform .8s var(--ease-out);
}
.join__mark:hover { transform: rotateY(180deg); }

.btn-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 10px 20px;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--sand);
  border: 1px solid var(--sand-dim);
  border-radius: 10px;
  direction: ltr;
  transition: background .3s, color .3s, border-color .3s;
}
.btn-follow:hover {
  background: var(--sand);
  color: var(--plum);
  border-color: var(--sand);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px var(--gutter) 40px;
  font-size: .95rem;
  color: var(--pink);
  background: var(--plum);
}

/* ============================================================
   Mobile tuning
   ============================================================ */
@media (max-width: 640px) {
  .hero__logo { width: min(95vw, 60vh); translate: -50% -58%; }
  .hero__media img { object-position: 50% 50%; } /* the portrait crop is already centred on the group */
  .join__title { width: min(82%, 300px); }
  .join__sub { margin-top: -1rem; }
  .consent { justify-content: flex-start; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .grain { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
