:root {
  --ar-ink: #1b1915;
  --ar-ink-soft: rgba(27, 25, 21, 0.68);
  --ar-paper: #f7f3ea;
  --ar-paper-warm: #fbf8ef;
  --ar-fiber: rgba(91, 75, 50, 0.12);
  --ar-vermilion: #bb3f24;
  --ar-indigo: #27384c;
  --ar-moss: #64724c;
  --ar-gold: #b99754;
  --ar-line: rgba(27, 25, 21, 0.16);
  --ar-display: "Cerro Bonete", "Cormorant Garamond", Georgia, serif;
  --ar-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  background: var(--ar-paper);
}

html.ar-is-snapping,
html.ar-is-snapping body {
  overscroll-behavior: none;
}

body.ar-body {
  margin: 0;
  background: var(--ar-paper);
  color: var(--ar-ink);
  font-family: var(--ar-sans);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.ar-site,
.ar-site * {
  box-sizing: border-box;
}

.ar-site {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background: transparent;
}

.ar-snap-section {
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ar-site::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)),
    url("../img/references-fondo-primaria.png") center / cover repeat;
  mix-blend-mode: multiply;
}

.ar-site::after {
  position: fixed;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: rgba(251, 248, 239, 0.42);
}

.ar-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 22px;
  color: var(--ar-ink);
  transition: color 260ms cubic-bezier(0.33, 1, 0.68, 1);
}

html.ar-on-dark .ar-header,
html.ar-on-hero .ar-header {
  color: var(--ar-ink);
}

.ar-mark,
.ar-nav a {
  color: inherit;
  text-decoration: none;
}

.ar-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ar-line);
  border-radius: 50%;
  font-family: var(--ar-display);
  font-size: 18px;
  font-weight: 700;
  transition: border-color 260ms cubic-bezier(0.33, 1, 0.68, 1);
}

html.ar-on-dark .ar-mark,
html.ar-on-hero .ar-mark {
  border-color: var(--ar-line);
}

html.ar-on-dark .ar-nav a,
html.ar-on-hero .ar-nav a {
  opacity: 1;
}

.ar-nav {
  display: flex;
  gap: 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.ar-nav a {
  opacity: 0.68;
  transition: opacity 220ms cubic-bezier(0.33, 1, 0.68, 1);
}

.ar-nav a:hover,
.ar-nav a:focus-visible {
  opacity: 1;
}

.ar-hero {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 92px 22px 72px;
  background: transparent;
  color: var(--ar-ink);
  isolation: isolate;
  overflow: hidden;
}

.ar-textile {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ar-hero-art {
  position: absolute;
  z-index: 0;
  inset: 50% auto auto 50%;
  width: max(100vw, 100svh);
  height: max(100vw, 100svh);
  opacity: 0.32;
  object-fit: cover;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0) scale(1.02);
  mix-blend-mode: multiply;
}

.ar-hero-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 1080px);
  perspective: 980px;
  text-align: center;
}

.ar-kicker,
.ar-section-label {
  margin: 0 0 18px;
  color: var(--ar-vermilion);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ar-hero h1 {
  margin: 0;
  color: var(--ar-ink);
  font-family: var(--ar-display);
  font-size: clamp(68px, 20vw, 230px);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 18px 48px rgba(27, 25, 21, 0.12);
}

.ar-tilt-plane {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  display: inline-grid;
  transform:
    perspective(720px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    translate3d(0, 0, 0);
  transform-style: preserve-3d;
  transform-origin: center;
  padding: 0;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.ar-tilt-plane h1 {
  position: relative;
  transform: translateZ(34px);
}

.ar-tilt-plane.is-tilting {
  transition-duration: 70ms;
}

.ar-scroll-cue {
  position: absolute;
  z-index: 4;
  bottom: 30px;
  left: 50%;
  display: grid;
  width: 24px;
  height: 34px;
  transform: translateX(-50%);
  color: var(--ar-ink);
  place-items: center;
}

.ar-scroll-cue span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.78;
  transform: rotate(45deg);
  animation: ar-cue 1.7s ease-in-out infinite;
}

.ar-scroll-cue span:nth-child(2) {
  margin-top: 12px;
  animation-delay: 160ms;
}

@keyframes ar-cue {
  0% {
    opacity: 0;
    translate: 0 -8px;
  }
  45% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    translate: 0 8px;
  }
}

.ar-story {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: 78px 22px 42px;
  background: transparent;
  color: var(--ar-ink);
  isolation: isolate;
  overflow: hidden;
}

.ar-story-stage {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
}

.ar-story-demon {
  position: absolute;
  z-index: 1;
  top: 50svh;
  left: 50%;
  width: auto;
  height: 100svh;
  max-height: none;
  opacity: 0.22;
  pointer-events: none;
  transform: translate3d(-50%, 0, 0);
  transform-origin: top center;
  transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

html.ar-story-revealed .ar-story-demon {
  opacity: 0.22;
  transform: translate3d(-50%, -100svh, 0);
}

.ar-story-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ar-story-bg img {
  position: absolute;
  right: -36vw;
  top: 18svh;
  width: min(82vw, 620px);
  opacity: 0.08;
  filter: sepia(0.2);
  transform: rotate(-8deg);
}

.ar-story-inner {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(100%, 760px);
  min-height: calc(100svh - 120px);
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: clamp(74px, 15svh, 154px);
  text-align: center;
}

.ar-brand-lockup {
  margin-top: 0;
  transform: translateY(0) scale(1);
  transition: transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

html.ar-story-revealed .ar-brand-lockup {
  transform: translateY(calc(-100svh + clamp(390px, 52svh, 500px))) scale(0.9);
}

.ar-story h2,
.ar-contact h2 {
  margin: 0;
  font-family: var(--ar-display);
  font-size: clamp(42px, 11vw, 112px);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: 0;
}

.ar-brand-lockup h2 {
  color: var(--ar-ink);
  font-size: clamp(50px, 13vw, 132px);
  line-height: 0.84;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.42),
    0 18px 44px rgba(27, 25, 21, 0.12);
}

.ar-brand-lockup .ar-brand-caption {
  margin: clamp(12px, 2svh, 18px) 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--ar-sans);
  font-size: clamp(13px, 3.2vw, 18px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ar-motion-gif {
  position: absolute;
  z-index: 3;
  top: clamp(360px, 56svh, 500px);
  left: 50%;
  width: clamp(170px, 58vw, 300px);
  height: auto;
  margin-top: 0;
  border-radius: 0;
  opacity: 0;
  transform: translate(-50%, 58px) scale(0.88);
  transition:
    opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

html.ar-story-revealed .ar-motion-gif {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.ar-story p:not(.ar-section-label):not(.ar-brand-caption),
.ar-contact p:not(.ar-section-label):not(.ar-form-status) {
  max-width: 680px;
  margin: 26px auto 0;
  color: var(--ar-ink-soft);
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1.55;
}

.ar-story-line {
  width: 1px;
  height: 132px;
  margin-top: 34px;
  background: repeating-linear-gradient(180deg, var(--ar-ink) 0 3px, transparent 3px 7px);
}

.ar-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

.ar-values span {
  border: 1px solid rgba(27, 25, 21, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.26);
  color: var(--ar-ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ar-contact {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(26px, 5vw, 76px);
  padding: 104px 22px 80px;
  background: transparent;
  isolation: isolate;
}

.ar-contact > * {
  position: relative;
  z-index: 2;
}

.ar-contact-art {
  position: absolute;
  z-index: 1;
  inset: auto -28vw 5vh auto;
  width: min(74vw, 620px);
  opacity: 0.07;
  pointer-events: none;
  transform: rotate(8deg);
}

.ar-contact-art img {
  width: 100%;
  height: auto;
}

.ar-contact-copy {
  display: flex;
  max-width: 680px;
  flex-direction: column;
  justify-content: center;
  justify-self: end;
}

.ar-portrait {
  width: min(100%, 430px);
  margin-top: 34px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 24px 80px rgba(27, 25, 21, 0.16);
}

.ar-form {
  display: grid;
  align-self: center;
  width: min(100%, 620px);
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(27, 25, 21, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 80px rgba(27, 25, 21, 0.08);
}

.ar-form label {
  display: grid;
  gap: 7px;
  color: var(--ar-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ar-field-wide,
.ar-form button,
.ar-form-status {
  grid-column: 1 / -1;
}

.ar-form input,
.ar-form textarea {
  width: 100%;
  border: 1px solid rgba(27, 25, 21, 0.18);
  border-radius: 6px;
  padding: 13px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ar-ink);
  font: 500 16px / 1.25 var(--ar-sans);
  outline: none;
  transition:
    border-color 180ms cubic-bezier(0.33, 1, 0.68, 1),
    background-color 180ms cubic-bezier(0.33, 1, 0.68, 1);
}

.ar-form textarea {
  resize: vertical;
}

.ar-form input:focus,
.ar-form textarea:focus {
  border-color: rgba(187, 63, 36, 0.62);
  background: #fff;
}

.ar-form button {
  min-height: 54px;
  border: 1px solid var(--ar-ink);
  border-radius: 6px;
  background: var(--ar-ink);
  color: var(--ar-paper);
  cursor: pointer;
  font: 800 14px / 1 var(--ar-sans);
  text-transform: uppercase;
  transition:
    transform 180ms cubic-bezier(0.33, 1, 0.68, 1),
    background-color 180ms cubic-bezier(0.33, 1, 0.68, 1),
    color 180ms cubic-bezier(0.33, 1, 0.68, 1);
}

.ar-form button:hover,
.ar-form button:focus-visible {
  background: var(--ar-vermilion);
  color: #fff;
  transform: translateY(-2px);
}

.ar-form-status {
  margin: 0;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
}

.ar-form-status-ok {
  background: rgba(100, 114, 76, 0.16);
  color: #3f4b2e;
}

.ar-form-status-error {
  background: rgba(187, 63, 36, 0.14);
  color: #8b2d1d;
}

@media (min-width: 900px) {
  .ar-header {
    height: 84px;
    padding-inline: 56px;
  }

  .ar-nav {
    gap: 34px;
    font-size: 13px;
  }

  .ar-mark {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .ar-hero {
    padding-inline: 56px;
  }

}

@media (max-width: 760px) {
  html {
    scroll-snap-type: none;
    scroll-padding-top: 0;
  }

  .ar-snap-section {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  html.ar-mobile-scene,
  html.ar-mobile-scene body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.ar-mobile-scene .ar-site {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  html.ar-mobile-scene .ar-snap-section {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-height: 100dvh;
    max-width: 100vw;
    backface-visibility: hidden;
    transition:
      opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
  }

  html.ar-mobile-scene .ar-hero {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  html.ar-mobile-scene .ar-story,
  html.ar-mobile-scene .ar-contact {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 100dvh, 0);
  }

  html.ar-mobile-scene[data-mobile-step="1"] .ar-hero,
  html.ar-mobile-scene[data-mobile-step="2"] .ar-hero,
  html.ar-mobile-scene[data-mobile-step="3"] .ar-hero {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, -18dvh, 0);
  }

  html.ar-mobile-scene[data-mobile-step="1"] .ar-story,
  html.ar-mobile-scene[data-mobile-step="2"] .ar-story {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  html.ar-mobile-scene[data-mobile-step="3"] .ar-story {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, -18dvh, 0);
  }

  html.ar-mobile-scene[data-mobile-step="3"] .ar-contact {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  .ar-nav {
    gap: 12px;
    font-size: 11px;
  }

  .ar-mark {
    width: 38px;
    height: 38px;
  }

  .ar-hero h1 {
    font-size: clamp(72px, 23vw, 116px);
  }

  .ar-tilt-plane {
    padding: 0;
  }

  .ar-story {
    min-height: 100dvh;
    padding: 0 18px;
  }

  .ar-story-stage {
    position: relative;
    min-height: 100dvh;
    padding: 74px 0 28px;
    overflow: hidden;
  }

  .ar-story-inner {
    min-height: calc(100dvh - 102px);
    padding-bottom: clamp(88px, 20svh, 148px);
  }

  html.ar-story-revealed .ar-brand-lockup {
    transform: translateY(calc(-100svh + 360px)) scale(0.88);
  }

  .ar-brand-lockup h2 {
    font-size: clamp(46px, 15vw, 82px);
  }

  .ar-story-demon {
    top: 50dvh;
    width: auto;
    height: 100dvh;
    max-height: none;
    opacity: 0.22;
  }

  html.ar-story-revealed .ar-story-demon {
    opacity: 0.22;
    transform: translate3d(-50%, -100dvh, 0);
  }

  .ar-motion-gif {
    top: clamp(330px, 54svh, 410px);
    width: clamp(178px, 64vw, 270px);
  }

  .ar-contact {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 72px 16px 18px;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
  }

  .ar-contact-copy {
    justify-self: stretch;
  }

  .ar-contact h2 {
    font-size: clamp(32px, 10vw, 48px);
  }

  .ar-contact p:not(.ar-section-label):not(.ar-form-status) {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.35;
  }

  .ar-portrait {
    display: none;
  }

  .ar-form {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .ar-form label {
    gap: 4px;
    font-size: 10px;
  }

  .ar-form input,
  .ar-form textarea {
    padding: 9px 10px;
    font-size: 14px;
  }

  .ar-form textarea {
    min-height: 70px;
  }

  .ar-form button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
