:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

body { margin: 0; }

#atelier-precision {
  --ap-x: 69%;
  --ap-reveal: 0;
  --ap-focus: 0;
  isolation: isolate;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 100vh;
  height: 100svh;
  color: #f3f0e9;
  background: #090a0c;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}

#atelier-precision button,
#atelier-precision a { font: inherit; }

#atelier-precision .ap-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

#atelier-precision .ap-media,
#atelier-precision .ap-finish-layer,
#atelier-precision .ap-grain {
  position: absolute;
  inset: 0;
}

#atelier-precision .ap-image {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.012);
}

#atelier-precision .ap-image--base {
  filter: saturate(.72) brightness(.8) contrast(1.08);
}

#atelier-precision .ap-finish-layer {
  opacity: calc(.18 + var(--ap-reveal) * .82);
  -webkit-mask-image: linear-gradient(104deg,
    transparent 0%,
    transparent calc(var(--ap-x) - 15%),
    rgba(0,0,0,.18) calc(var(--ap-x) - 8%),
    #000 var(--ap-x),
    #000 100%);
  mask-image: linear-gradient(104deg,
    transparent 0%,
    transparent calc(var(--ap-x) - 15%),
    rgba(0,0,0,.18) calc(var(--ap-x) - 8%),
    #000 var(--ap-x),
    #000 100%);
  transition: opacity 700ms cubic-bezier(.2,.75,.25,1);
  will-change: mask-image, opacity;
}

/* When the pointer reaches the product itself, show the complete finished ring.
   The two source images are pixel aligned, so the surrounding scene stays still. */
#atelier-precision[data-product-focus="true"] .ap-finish-layer {
  -webkit-mask-image: linear-gradient(104deg, #000, #000);
  mask-image: linear-gradient(104deg, #000, #000);
  opacity: 1;
}

#atelier-precision[data-state="finished"] .ap-finish-layer {
  -webkit-mask-image: linear-gradient(104deg, #000, #000);
  mask-image: linear-gradient(104deg, #000, #000);
  opacity: 1;
}

#atelier-precision .ap-scan {
  position: absolute;
  top: -20%;
  left: var(--ap-x);
  width: clamp(58px, 6.5vw, 118px);
  height: 140%;
  opacity: calc(.34 + var(--ap-reveal) * .52);
  transform: translateX(-52%) rotate(14deg);
  background: linear-gradient(90deg, transparent 0%, rgba(202,221,255,.12) 22%, rgba(241,247,255,.48) 44%, rgba(255,255,255,.96) 50%, rgba(218,232,255,.28) 62%, transparent 100%);
  filter: blur(7px) drop-shadow(0 0 18px rgba(220,233,255,.42));
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 400ms ease;
}

#atelier-precision[data-product-focus="true"] .ap-scan {
  opacity: .72;
  filter: blur(6px) drop-shadow(0 0 26px rgba(235,243,255,.62));
}

#atelier-precision[data-state="finished"] .ap-scan { opacity: 0; }

#atelier-precision .ap-grain {
  opacity: .13;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

#atelier-precision .ap-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.58) 0%, rgba(0,0,0,.18) 43%, transparent 66%),
    linear-gradient(180deg, rgba(0,0,0,.28), transparent 25%, transparent 75%, rgba(0,0,0,.48));
}

#atelier-precision .ap-topline {
  position: absolute;
  z-index: 5;
  top: clamp(24px, 4.2vw, 64px);
  left: clamp(22px, 5.4vw, 86px);
  right: clamp(22px, 5.4vw, 86px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(-12px);
  animation: ap-enter 900ms 120ms cubic-bezier(.2,.8,.25,1) forwards;
}

#atelier-precision .ap-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
}

#atelier-precision .ap-brand i {
  width: 5px;
  height: 5px;
  border: 1px solid #f3f0e9;
  transform: rotate(45deg);
}

#atelier-precision .ap-edition {
  margin: 0;
  color: rgba(255,255,255,.58);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

#atelier-precision .ap-copy {
  position: absolute;
  z-index: 5;
  left: clamp(22px, 8.2vw, 132px);
  top: 50%;
  width: min(43vw, 610px);
  transform: translateY(-45%);
}

#atelier-precision .ap-kicker,
#atelier-precision .ap-deck,
#atelier-precision .ap-cta {
  opacity: 0;
  transform: translateY(16px);
  animation: ap-enter 900ms cubic-bezier(.2,.8,.25,1) forwards;
}

#atelier-precision .ap-kicker {
  margin: 0 0 22px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  animation-delay: 220ms;
}

#atelier-precision h1 {
  margin: 0;
  max-width: 700px;
  color: #f6f3ec;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 7.1vw, 118px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .82;
  opacity: 0;
  transform: translateY(28px);
  animation: ap-enter 1100ms 280ms cubic-bezier(.16,.82,.22,1) forwards;
}

#atelier-precision h1 em {
  color: #d7dce4;
  font-weight: 400;
}

#atelier-precision .ap-deck {
  max-width: 420px;
  margin: 30px 0 28px;
  color: rgba(255,255,255,.67);
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.65;
  animation-delay: 440ms;
}

#atelier-precision .ap-cta {
  min-height: 48px;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.52);
  color: #fff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  animation-delay: 540ms;
}

#atelier-precision .ap-cta svg {
  width: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  transition: transform 300ms ease;
}

#atelier-precision .ap-cta:hover svg,
#atelier-precision .ap-cta:focus-visible svg { transform: translateX(6px); }

#atelier-precision .ap-cta:focus-visible,
#atelier-precision .ap-touch-controls button:focus-visible,
#atelier-precision .ap-brand:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}

#atelier-precision .ap-status {
  position: absolute;
  z-index: 5;
  right: clamp(22px, 5.4vw, 86px);
  bottom: clamp(25px, 4.5vw, 66px);
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(255,255,255,.6);
  font-size: 9px;
  letter-spacing: .17em;
  text-transform: uppercase;
}

#atelier-precision .ap-status-line {
  position: relative;
  width: clamp(58px, 7vw, 112px);
  height: 1px;
  overflow: hidden;
  background: rgba(255,255,255,.24);
}

#atelier-precision .ap-status-line i {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: translateX(calc(-100% + var(--ap-reveal) * 100%));
  transition: transform 400ms ease;
}

#atelier-precision[data-state="finished"] .ap-status-line i { transform: none; }

#atelier-precision .ap-hint {
  position: absolute;
  z-index: 5;
  left: clamp(22px, 5.4vw, 86px);
  bottom: clamp(25px, 4.5vw, 66px);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.58);
  font-size: 9px;
  letter-spacing: .17em;
  text-transform: uppercase;
}

#atelier-precision .ap-hint span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px #fff;
  animation: ap-pulse 1.8s infinite;
}

#atelier-precision .ap-touch-controls { display: none; }

@keyframes ap-enter {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ap-pulse {
  50% { opacity: .35; transform: scale(.65); }
}

@media (max-width: 760px) {
  #atelier-precision {
    --ap-x: 58%;
    touch-action: none;
  }

  #atelier-precision .ap-image {
    object-position: 62% center;
    transform: scale(1.04);
  }

  #atelier-precision .ap-media::after {
    background:
      linear-gradient(180deg, rgba(0,0,0,.37), transparent 25%, rgba(0,0,0,.08) 50%, rgba(0,0,0,.82) 100%),
      linear-gradient(90deg, rgba(0,0,0,.18), transparent 70%);
  }

  #atelier-precision .ap-topline {
    top: max(20px, env(safe-area-inset-top));
  }

  #atelier-precision .ap-edition,
  #atelier-precision .ap-status,
  #atelier-precision .ap-hint { display: none; }

  #atelier-precision .ap-copy {
    left: 22px;
    right: 22px;
    top: auto;
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 70px));
    width: auto;
    transform: none;
  }

  #atelier-precision .ap-kicker { margin-bottom: 12px; }

  #atelier-precision h1 {
    font-size: clamp(47px, 14vw, 68px);
    line-height: .86;
  }

  #atelier-precision .ap-deck {
    max-width: 330px;
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.45;
  }

  #atelier-precision .ap-cta { display: none; }

  #atelier-precision .ap-touch-controls {
    position: absolute;
    z-index: 8;
    left: 22px;
    right: 22px;
    bottom: max(18px, env(safe-area-inset-bottom));
    height: 44px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    backdrop-filter: blur(12px);
    background: rgba(10,10,12,.34);
  }

  #atelier-precision .ap-touch-controls button {
    border: 0;
    border-radius: 999px;
    color: rgba(255,255,255,.62);
    background: transparent;
    font-size: 9px;
    letter-spacing: .15em;
    text-transform: uppercase;
  }

  #atelier-precision .ap-touch-controls button[aria-pressed="true"] {
    color: #111;
    background: #f0ede7;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  #atelier-precision .ap-copy { transform: translateY(-39%); }
  #atelier-precision .ap-deck { margin: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  #atelier-precision *,
  #atelier-precision *::before,
  #atelier-precision *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
