/* ============================================
   1. Reset
   ============================================ */

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

html,
body {
  height: 100%;
}

html {
  background: var(--cream);
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

/* ============================================
   2. Variables
   ============================================ */

:root {
  --ivory: #f6f1e8;
  --cream: #efe8dc;
  --stone: #e6dccf;
  --sand: #d8cbb8;
  --ink: #1c1916;
  --charcoal: #2a2622;
  --taupe: #8d8174;
  --mist: #a89c8f;
  --champagne: #c6b6a2;
  --line: rgba(28, 25, 22, 0.1);
  --line-strong: rgba(28, 25, 22, 0.16);

  --font-serif: "Bodoni Moda", "Didot", "Bodoni MT", "Times New Roman", serif;
  --font-sans: "Outfit", "Futura", "Century Gothic", "Helvetica Neue", sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --frame: clamp(0.85rem, 2vw, 1.35rem);

  --ease-lux: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-sway: 12.4s;
  --dur-sleeve-l: 13.6s;
  --dur-sleeve-r: 10.8s;
  --dur-hem: 8.7s;
  --dur-collar: 14.2s;
  --dur-enter: 1.7s;

  --hook-x: 53.6%;
  --hook-y: 7.2%;
  --shirt-w: min(40vw, 440px);
  --shirt-h: min(62vh, 720px);
}

/* ============================================
   3. Typography
   ============================================ */

body {
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.wordmark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 48;
  font-size: clamp(1.15rem, 1.7vw, 1.42rem);
  font-style: normal;
  letter-spacing: 0.48em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
  margin-right: -0.48em;
}

.copy__soon {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.52em;
  text-transform: uppercase;
  color: var(--ink);
  margin-right: -0.52em;
}

.copy__line {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-right: -0.28em;
}

.masthead__index,
.masthead__studio,
.colophon {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mist);
}

/* ============================================
   4. Layout
   ============================================ */

body {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  min-height: 100dvh;
}

.scene {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 2;
  width: var(--shirt-w);
  height: var(--shirt-h);
  transform: translate(-50%, -46%);
}

.masthead {
  position: fixed;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(1.55rem + env(safe-area-inset-top)) clamp(1.4rem, 3.5vw, 2.4rem) 0;
  pointer-events: none;
}

.masthead__index {
  justify-self: start;
}

.masthead__studio {
  justify-self: end;
}

.colophon {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 clamp(1.4rem, 3.5vw, 2.4rem) calc(1.25rem + env(safe-area-inset-bottom));
  pointer-events: none;
}

.frame {
  position: fixed;
  inset: var(--frame);
  z-index: 5;
  border: 1px solid var(--line);
  pointer-events: none;
}

.suspension {
  position: absolute;
  z-index: 1;
  top: calc(4.6rem + env(safe-area-inset-top));
  left: 50%;
  width: 1px;
  height: 11vh;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(28, 25, 22, 0.07) 30%,
    rgba(28, 25, 22, 0.12) 100%
  );
  pointer-events: none;
}

/* ============================================
   5. Background
   ============================================ */

.studio {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 62% at 50% 40%, var(--ivory) 0%, transparent 58%),
    linear-gradient(180deg, #f3ece1 0%, var(--cream) 46%, var(--stone) 100%);
}

.studio__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 48% at 48% 36%, rgba(255, 252, 247, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 62% 58%, rgba(198, 182, 162, 0.12) 0%, transparent 70%);
}

.studio__light {
  position: absolute;
  inset: -10%;
  background: radial-gradient(
    ellipse 46% 42% at 50% 44%,
    rgba(255, 250, 242, 0.55) 0%,
    rgba(255, 247, 236, 0.18) 34%,
    transparent 68%
  );
  will-change: transform;
}

.studio__glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(52vw, 560px);
  height: min(58vh, 620px);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 252, 246, 0.42) 0%,
    rgba(232, 220, 200, 0.08) 48%,
    transparent 72%
  );
  pointer-events: none;
}

.studio__floor {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: min(48vw, 520px);
  height: 12vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(90, 72, 52, 0.1) 0%, transparent 72%);
  filter: blur(10px);
}

.studio__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 78% 72% at 50% 42%,
    transparent 42%,
    rgba(92, 74, 54, 0.07) 100%
  );
  pointer-events: none;
}

.studio__grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: multiply;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ============================================
   6. Logo
   ============================================ */

.wordmark {
  position: relative;
}

/* ============================================
   7. Shirt
   ============================================ */

.garment {
  position: relative;
  width: var(--shirt-w);
  height: var(--shirt-h);
  transform-origin: 50% 8%;
  will-change: transform;
}

.garment__sway {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: var(--hook-x) var(--hook-y);
  will-change: transform;
}

.garment__figure {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 28px 38px rgba(62, 48, 32, 0.14));
}

.shirt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("assets/linen-shirt.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  user-select: none;
}

.shirt--base {
  position: relative;
  inset: auto;
  object-fit: contain;
  object-position: center;
  background: none;
}

.garment__shadow {
  position: absolute;
  left: 50%;
  bottom: 3.5%;
  z-index: -1;
  width: 46%;
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(70, 54, 38, 0.2) 0%, transparent 70%);
  filter: blur(9px);
  pointer-events: none;
}

.placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  width: min(72vw, 360px);
  min-height: 42vh;
  padding: var(--space-lg) var(--space-md);
  border: 1px solid var(--line);
  color: var(--taupe);
}

.placeholder[hidden] {
  display: none;
}

.placeholder__label,
.placeholder__path,
.placeholder__note {
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.placeholder__label {
  font-size: 0.58rem;
  color: var(--mist);
  margin-bottom: 0.85rem;
}

.placeholder__path {
  font-size: 0.72rem;
  color: var(--charcoal);
  margin-bottom: 1.1rem;
}

.placeholder__note {
  font-size: 0.58rem;
  max-width: 22ch;
  line-height: 1.8;
}

/* ============================================
   8. Fabric animation
   ============================================ */

.garment__sway {
  animation: sway var(--dur-sway) ease-in-out 1.8s infinite;
}

.shirt--sleeve-l,
.shirt--sleeve-r,
.shirt--hem,
.shirt--collar {
  will-change: transform;
}

.shirt--sleeve-l {
  transform-origin: 30% 24%;
  -webkit-mask-image: radial-gradient(ellipse 34% 62% at 16% 54%, #000 0%, #000 48%, transparent 74%);
  mask-image: radial-gradient(ellipse 34% 62% at 16% 54%, #000 0%, #000 48%, transparent 74%);
  animation: sleeve-l var(--dur-sleeve-l) ease-in-out 2.1s infinite;
}

.shirt--sleeve-r {
  transform-origin: 70% 24%;
  -webkit-mask-image: radial-gradient(ellipse 34% 62% at 84% 54%, #000 0%, #000 48%, transparent 74%);
  mask-image: radial-gradient(ellipse 34% 62% at 84% 54%, #000 0%, #000 48%, transparent 74%);
  animation: sleeve-r var(--dur-sleeve-r) ease-in-out 2.35s infinite;
}

.shirt--hem {
  transform-origin: 50% 72%;
  -webkit-mask-image: linear-gradient(180deg, transparent 68%, #000 80%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 68%, #000 80%, #000 100%);
  animation: hem var(--dur-hem) ease-in-out 2s infinite;
}

.shirt--collar {
  transform-origin: 50% 20%;
  -webkit-mask-image: radial-gradient(ellipse 20% 14% at 50% 23%, #000 0%, #000 46%, transparent 74%);
  mask-image: radial-gradient(ellipse 20% 14% at 50% 23%, #000 0%, #000 46%, transparent 74%);
  animation: collar var(--dur-collar) ease-in-out 2.6s infinite;
}

.garment__shadow {
  animation: shadow-drift var(--dur-sway) ease-in-out 1.8s infinite;
}

@keyframes sway {
  0% {
    transform: rotate(-0.55deg) translate3d(-7px, 0, 0);
  }
  18% {
    transform: rotate(0.28deg) translate3d(4px, 1px, 0);
  }
  42% {
    transform: rotate(-0.22deg) translate3d(-3px, 0.5px, 0);
  }
  68% {
    transform: rotate(0.72deg) translate3d(8px, 1.5px, 0);
  }
  86% {
    transform: rotate(0.12deg) translate3d(1px, 0, 0);
  }
  100% {
    transform: rotate(-0.55deg) translate3d(-7px, 0, 0);
  }
}

@keyframes sleeve-l {
  0% {
    transform: rotate(0.15deg) translate3d(0, 0, 0);
  }
  27% {
    transform: rotate(-0.7deg) translate3d(-3px, 1px, 0) skewX(-0.25deg);
  }
  61% {
    transform: rotate(0.55deg) translate3d(2px, 0, 0) skewX(0.2deg);
  }
  100% {
    transform: rotate(0.15deg) translate3d(0, 0, 0);
  }
}

@keyframes sleeve-r {
  0% {
    transform: rotate(-0.1deg) translate3d(0, 0, 0);
  }
  33% {
    transform: rotate(0.65deg) translate3d(3px, 1px, 0) skewX(0.28deg);
  }
  70% {
    transform: rotate(-0.5deg) translate3d(-2px, 0.5px, 0) skewX(-0.18deg);
  }
  100% {
    transform: rotate(-0.1deg) translate3d(0, 0, 0);
  }
}

@keyframes hem {
  0% {
    transform: translate3d(0, 0, 0) skewX(0deg) rotate(0deg);
  }
  24% {
    transform: translate3d(4px, 1px, 0) skewX(0.45deg) rotate(0.25deg);
  }
  52% {
    transform: translate3d(-3px, 0, 0) skewX(-0.35deg) rotate(-0.2deg);
  }
  78% {
    transform: translate3d(5px, 1.5px, 0) skewX(0.4deg) rotate(0.18deg);
  }
  100% {
    transform: translate3d(0, 0, 0) skewX(0deg) rotate(0deg);
  }
}

@keyframes collar {
  0% {
    transform: rotate(0deg) scale(1);
  }
  40% {
    transform: rotate(-0.35deg) scale(1.004);
  }
  75% {
    transform: rotate(0.3deg) scale(1.002);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes shadow-drift {
  0% {
    transform: translate3d(-54%, 0, 0) scaleX(1);
    opacity: 0.9;
  }
  68% {
    transform: translate3d(-42%, 0, 0) scaleX(1.06);
    opacity: 1;
  }
  100% {
    transform: translate3d(-54%, 0, 0) scaleX(1);
    opacity: 0.9;
  }
}

/* ============================================
   9. Hero typography
   ============================================ */

.copy {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: calc(5.7rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
  padding: 0 var(--space-md);
}

.copy__rule {
  display: block;
  width: 2.4rem;
  height: 1px;
  background: var(--line-strong);
}

/* ============================================
   10. Micro-interactions
   ============================================ */

.studio,
.frame,
.suspension,
.wordmark,
.masthead__index,
.masthead__studio,
.garment,
.copy__soon,
.copy__rule,
.copy__line,
.colophon {
  opacity: 0;
}

.is-ready .studio {
  animation: fade-in 1.35s var(--ease-lux) forwards;
}

.is-ready .frame {
  animation: fade-in 1.8s var(--ease-lux) 0.2s forwards;
}

.is-ready .wordmark {
  animation: fade-rise 1.6s var(--ease-lux) 0.45s forwards;
}

.is-ready .masthead__index,
.is-ready .masthead__studio {
  animation: fade-in 1.5s var(--ease-lux) 2.8s forwards;
}

.is-ready .suspension {
  animation: line-draw 1.8s var(--ease-lux) 0.7s forwards;
}

.is-ready .garment {
  animation: fade-in 2.15s var(--ease-lux) 0.95s forwards;
}

.is-ready .garment__figure {
  animation: shirt-rise 2.15s var(--ease-lux) 0.95s forwards;
}

.is-ready .copy__soon {
  animation: fade-rise 1.45s var(--ease-lux) 2.15s forwards;
}

.is-ready .copy__rule {
  animation: fade-in 1.2s var(--ease-lux) 2.4s forwards;
}

.is-ready .copy__line {
  animation: fade-rise 1.5s var(--ease-lux) 2.65s forwards;
}

.is-ready .colophon {
  animation: fade-in 1.5s var(--ease-lux) 3.05s forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes shirt-rise {
  from {
    transform: translate3d(0, 16px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes line-draw {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.4);
    transform-origin: top center;
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
    transform-origin: top center;
  }
}

/* ============================================
   11. Responsive design
   ============================================ */

@media (max-width: 900px) {
  :root {
    --shirt-w: min(58vw, 400px);
    --shirt-h: min(58vh, 600px);
  }
}

@media (max-width: 720px) {
  :root {
    --shirt-w: min(84vw, 400px);
    --shirt-h: min(54svh, 520px);
    --frame: 0.7rem;
  }

  .wordmark {
    font-size: 1.05rem;
    letter-spacing: 0.38em;
    margin-right: -0.38em;
  }

  .masthead {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .masthead__index,
  .masthead__studio {
    font-size: 0.5rem;
    letter-spacing: 0.2em;
  }

  .scene {
    top: 49%;
    transform: translate(-50%, -50%);
  }

  .copy {
    bottom: calc(5.1rem + env(safe-area-inset-bottom));
    gap: 0.7rem;
  }

  .copy__soon {
    font-size: 0.62rem;
    letter-spacing: 0.4em;
    margin-right: -0.4em;
  }

  .copy__line {
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    margin-right: 0;
    max-width: 24ch;
    line-height: 1.75;
  }

  .colophon {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .colophon p {
    font-size: 0.5rem;
    letter-spacing: 0.18em;
  }

  .suspension {
    height: 8vh;
  }
}

@media (max-width: 380px) {
  .masthead__index,
  .masthead__studio {
    visibility: hidden;
  }
}

@media (max-height: 700px) {
  :root {
    --shirt-h: min(50vh, 430px);
  }

  .copy {
    bottom: calc(4.6rem + env(safe-area-inset-bottom));
    gap: 0.55rem;
  }
}

@media (min-width: 1400px) {
  :root {
    --shirt-w: min(36vw, 480px);
    --shirt-h: min(66vh, 800px);
  }
}

@media (pointer: coarse) {
  .garment {
    transform: none;
  }
}

/* ============================================
   12. Reduced motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .garment__sway,
  .shirt--sleeve-l,
  .shirt--sleeve-r,
  .shirt--hem,
  .shirt--collar,
  .garment__shadow {
    animation: none !important;
  }

  .studio,
  .frame,
  .wordmark,
  .masthead__index,
  .masthead__studio,
  .garment,
  .garment__figure,
  .copy__soon,
  .copy__rule,
  .copy__line,
  .colophon {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .suspension {
    animation: none !important;
    opacity: 1 !important;
    transform: translateX(-50%) !important;
  }

  .garment {
    transform: none;
  }
}
