/* ==========================================================================
   Footer: dark rounded panel — stair title, contacts, form, wordmark.
   Desktop ≥1200 · tablet 810–1199 · phone ≤809
   ========================================================================== */

.footer {
  padding: 0 clamp(10px, 1.6vw, 25px) 10px;
  background: var(--c-panel);
  /* the "Reality" particle canvas is larger than the footer: keep it (and its
     pointer area) inside the footer so it never covers the Start a Project block */
  overflow: clip;
}

/* ---- grid: left column (title, mail, form, credits) + right stack ---- */
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  width: 100%;
  padding-right: 60px;
}
.footer__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
  min-width: 0;
}
.footer__side {
  grid-column: span 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(26px, 2.4vw, 40px);
  width: clamp(275px, 22vw, 345px);
  max-width: 100%;
  padding-top: clamp(10px, 1.2vw, 18px);
  text-align: right;
}

/* The "Reality" particle canvas is much larger than the word (it scatters
   across the panel); every block after the title sits above it. */
.footer__mail,
.footer__form-block,
.footer__credits,
.footer__side {
  position: relative;
  z-index: 2;
}

/* ---- mono labels ---- */
.footer__label {
  font: 600 12.8px/1.15 var(--f-mono);
  letter-spacing: .3px;
  color: rgba(255, 255, 255, .7);
  white-space: pre;
}

/* ---- stair title "Let's Build / Reality / with AMLGM Lab" ---- */
.footer__title {
  min-height: clamp(178px, 18vw, 252px);
  padding-top: clamp(10px, 1.2vw, 18px);
}
.amlgm-footer-stair {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(3px, .5vw, 8px);
  width: max-content;
  max-width: min(42vw, 620px);
  font-weight: 500;
}
.amlgm-footer-stair-line { display: block; width: max-content; max-width: 100%; }
.amlgm-footer-stair-line-2 { margin-left: clamp(110px, 8.9vw, 172px); }
.amlgm-footer-stair-line-3 { margin-left: clamp(160px, 14vw, 248px); }
.amlgm-footer-title-base,
.amlgm-footer-title-accent {
  display: block;
  font-family: var(--f-sans);
  font-weight: 500;
  line-height: .88;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.amlgm-footer-title-base {
  font-size: clamp(42px, 4.8vw, 76px);
  color: #fff;
}
.amlgm-footer-title-accent {
  font-size: clamp(82px, 7.9vw, 132px);
  font-style: italic;
  color: var(--c-blue);
  text-shadow: 0 8px 28px rgba(75, 86, 216, .1);
}

/* ---- links with the rolling-letter hover ---- */
.footer__link {
  display: inline-flex;
  font: 500 19.2px/1.15 var(--f-sans);
  letter-spacing: -.8px;
  color: #fff;
  white-space: pre;
}
.roll__char {
  display: inline-block;
  height: 1.15em;
  overflow: hidden;
  vertical-align: top;
}
.roll__rail {
  display: flex;
  flex-direction: column;
  transition: transform .48s cubic-bezier(.2, .78, .24, 1);
  transition-delay: calc(var(--i, 0) * 28ms);
  will-change: transform;
}
.roll__rail > span { display: block; height: 1.15em; }
.footer__link:hover .roll__rail,
.footer__link:focus-visible .roll__rail,
.roll-host:hover .roll__rail,
.roll-host:focus-visible .roll__rail { transform: translate3d(0, -50%, 0); }

.footer__mail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.footer__mail .footer__link { padding-bottom: 2px; }

/* ---- form: opens a ready-to-send email draft ---- */
.footer__form-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}
.footer__phone-break { display: none; }
.footer__form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 414px;
  max-width: 100%;
  padding: 5px 5px 5px 20px;
  border-radius: 14px;
  background: rgba(173, 173, 173, .25);
}
.footer__input {
  flex: 1 1 0;
  min-width: 0;
  height: 50px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 16px/1.2 var(--f-sans);
  color: #fff;
}
.footer__input::placeholder { color: #a9a9a9; }
.footer__submit {
  flex: none;
  height: 50px;
  padding: 12px 24px;
  border-radius: 14px;
  background: var(--c-blue);
  font: 400 14px/1.2 "Inter", sans-serif;
  color: #fff;
  white-space: pre;
  transition: background .25s ease;
}
.footer__submit {
  transition: background .25s ease, transform .45s cubic-bezier(.2, .8, .3, 1);
}
.footer__submit:hover { background: #3644ce; transform: scale(1.055); }
.footer__submit .roll__char,
.footer__submit .roll__rail > span { height: 1.2em; }

.footer__credits {
  display: flex;
  flex-direction: column;
  line-height: 1.9;
  white-space: normal;
}
.footer__credit--studio { order: 1; }
.footer__credit--global { order: 2; }

/* ---- right stack ---- */
.footer__block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  width: 100%;
}
.footer__block--nav { gap: 10px; }
.footer__block--follow { gap: 8px; }
.footer__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.footer__nav .footer__link { align-items: center; height: 24px; }
.footer__block--phone .footer__link { padding-bottom: 2px; }
.footer__address {
  font: 600 16px/1.3 var(--f-sans);
  font-style: normal;
  letter-spacing: -.6px;
  color: #fff;
  white-space: pre;
}
.footer__social { display: block; padding: 1px 0 0 1px; }
.footer__social img { width: 16px; height: 18px; }

/* ---- big AMLGM LAB wordmark ---- */
.footer__wordmark {
  width: 100%;
  height: auto;
  aspect-ratio: 327.238 / 53.502;
  object-fit: contain;
  object-position: left center;
}

/* ---- studio credit: the site is our own work ---- */
.footer__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(96px, 6.6vw, 108px);
    padding: clamp(94px, 7.1vw, 116px) 20px 40px;
    border-radius: 34px;
    background: var(--c-ink);
    color: #fff;
    position: relative; }
.footer__made {
  position: absolute;
  right: 20px;
  bottom: 14px;
  font: 500 10px/1.2 var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  white-space: nowrap;
}

/* ===== tablet ===== */
@media (max-width: 1199.98px) {
  .footer__label { font-size: 16px; }
  .footer__side { width: clamp(245px, 28vw, 325px); }
  .footer__title { min-height: clamp(154px, 18vw, 210px); }
  .amlgm-footer-stair { max-width: 100%; }
  .amlgm-footer-title-base { font-size: clamp(32px, 3.6vw, 44px); }
  .amlgm-footer-title-accent { font-size: clamp(54px, 5.8vw, 72px); }
  .amlgm-footer-stair-line-2 { margin-left: clamp(56px, 5.8vw, 84px); }
  .amlgm-footer-stair-line-3 { margin-left: clamp(82px, 8vw, 116px); }
  .footer__form { width: 346px; }
}

/* ===== phone: form → mail → links → title → credits, no wordmark ===== */
@media (max-width: 809.98px) {
  .footer { padding: 0 12px 5px; overflow-x: clip; }
  .footer__wordmark { display: none; }
  .footer__panel {
    gap: 20px;
    padding: 66px 18px 28px;
    border-radius: 24px;
    overflow: hidden;
    padding-bottom: 46px; }
  .footer__made { left: 18px; right: auto; bottom: 16px; font-size: 9px; letter-spacing: .05em; }

  .footer__grid { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 0; }
  .footer__main { display: contents; }
  .footer__form-block { order: 1; width: 100%; }

  .footer__label {
    font-size: clamp(11px, 3.25vw, 14px);
    line-height: 1.3;
    letter-spacing: .035em;
    white-space: nowrap;
  }
  /* links stay plain text on touch screens */
  .roll__rail { transition: none; transform: none !important; }

  .footer__prompt {
    font-size: clamp(17px, 4.5vw, 21px);
    line-height: 1.24;
    letter-spacing: -.025em;
    white-space: normal;
  }
  .footer__phone-break { display: inline; }
  .footer__form { width: 100%; }
  .footer__submit {
    padding: 12px;
    font-size: clamp(12px, 3.4vw, 15px);
    line-height: 1.35;
    letter-spacing: .015em;
  }
  .footer__submit .roll__char,
  .footer__submit .roll__rail > span { height: 1.35em; }

  .footer__mail {
    order: 2;
    margin-top: 12px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px; }
  .footer__mail .footer__label { font-size: clamp(10.5px, 3.35vw, 14px); line-height: 1.2; letter-spacing: -.018em; }
  .footer__mail .footer__link { padding: 0; font-size: clamp(11px, 3.35vw, 14px); line-height: 1.25; letter-spacing: -.035em; }

  .footer__side {
    order: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
    column-gap: clamp(14px, 4vw, 24px);
    row-gap: clamp(12px, 3.2vw, 18px);
    width: 100%;
    padding-top: 6px;
    justify-self: stretch;
  }
  .footer__block { align-self: start; }
  .footer__block--nav { grid-column: 1; grid-row: 1 / 4; align-items: flex-start; text-align: left; }
  .footer__nav { align-items: flex-start; }
  .footer__nav .footer__link { font-size: clamp(17px, 4.4vw, 20px); }
  .footer__block--address { grid-column: 2; grid-row: 1; }
  .footer__block--phone { grid-column: 2; grid-row: 2; }
  .footer__block--follow { grid-column: 2; grid-row: 3; }
  .footer__address {
    font-size: clamp(12px, 3.2vw, 14px);
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: -.3px;
    white-space: normal;
  }
  .footer__block--phone .footer__link { padding: 0; font-size: clamp(10px, 3.1vw, 15px); letter-spacing: -.02em; }

  .footer__title {
    order: 4;
    display: flex;
    align-items: center;
    min-height: 154px;
    margin-top: 2px;
    padding: 0;
  }
  .amlgm-footer-stair { gap: 8px; width: 100%; }
  .amlgm-footer-title-base { font-size: clamp(25px, 7.4vw, 36px); }
  .amlgm-footer-title-accent { font-size: clamp(32px, 8.5vw, 42px); }
  .amlgm-footer-stair-line-2 { margin-left: clamp(18px, 6vw, 27px); }
  .amlgm-footer-stair-line-3 { margin-left: clamp(32px, 10vw, 46px); }

  .footer__credits {
    order: 5;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: space-between;
    column-gap: 6px;
    margin-top: calc(2px + clamp(10px, 3vw, 18px));
    font-size: clamp(8px, 2.4vw, 11px);
    line-height: 1.7;
    letter-spacing: 0;
  }
  .footer__credit--copy { order: 0; }
  .footer__credit--global { order: 1; text-align: right; }
  .footer__credit--studio { order: 2; grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .roll__rail { transition: none; }
}

/* ---- "Reality" particle surface (footer-particles.js) ---- */
.amlgm-footer-particle-shell {
  position: relative;
  isolation: isolate;
  width: max-content;
  max-width: 100%;
  overflow: visible;
}
.amlgm-footer-particle-canvas {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  opacity: 0;
  touch-action: auto;
}
.amlgm-footer-particle-shell.amlgm-particles-visible { color: transparent; text-shadow: none; }
.amlgm-footer-particle-shell.amlgm-particles-visible .amlgm-footer-particle-canvas { opacity: 1; }
.amlgm-footer-particle-shell.amlgm-particles-static .amlgm-footer-particle-canvas { opacity: 0; }
.amlgm-footer-static-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
img.amlgm-footer-static-fallback { transform: translate(-50%, -50%); object-fit: contain; }
@media (max-width: 809.98px) {
  .amlgm-footer-particle-canvas { pointer-events: none !important; touch-action: auto !important; }
}
