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

/* (page transitions handled by transitions.js) */

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #EAEAE7;
  color: #0B0A09;
  font-family: 'Inter', Arial, sans-serif;
  overflow-x: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='26' viewBox='0 0 24 26'%3E%3Cg transform='rotate(-10 4 3)'%3E%3Cpath d='M4 3 L4 23 L10 18 L19 16 Z' fill='%231A1C22' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E") 3 3, auto;
}

/* ── Grain ── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Stage ── */
.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 10vh;
}

/* ── Room label ── */
.room-label {
  position: absolute;
  top: 28px;
  left: 64px;
  z-index: 20;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #0B0A09;
  animation: fade-in-left 700ms ease-out 0.2s both;
}

/* ── Intro ── */
.intro {
  position: relative;
  top: auto;
  left: 0;
  z-index: 20;
  isolation: isolate;
  text-align: center;
  animation: fade-in 900ms ease-out 0.2s both;
}


.home-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 900;
  color: #0B0A09;
  font-size: 84px;
  line-height: 1;
  margin: 0 0 2px 0;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: center;
}

.intro-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.home-wordmark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 400;
  color: #0B0A09;
  text-transform: lowercase;
}

.shopify-accent {
  color: #008060;
  font-weight: 600;
}

.home-tagline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  color: #0B0A09;
  margin: 0;
  line-height: 1.4;
}

/* ── Scatter ── */
.scatter {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.scatter-group {
  position: absolute;
  transition: transform 150ms ease-out;
}

.scatter-group--right {
  right: 45px;
  top: -44px;
  width: 756px;
  height: 100%;
}

.scatter-group--left {
  left: 64px;
  right: auto;
  bottom: 0;
  top: auto;
  width: 304px;
  height: 240px;
}

.scatter-item {
  position: absolute;
  height: auto;
  object-fit: contain;
  animation: scatter-in 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}


.scatter-link {
  display: contents;
}

@keyframes shimmer-glow {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.7)) drop-shadow(0 0 8px rgba(255,255,255,0.3));
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(255,255,255,1)) drop-shadow(0 0 18px rgba(255,255,255,0.55));
  }
}

.scatter-link--shimmer .scatter-item {
  cursor: pointer;
}

.scatter-link--shimmer .scatter-item.is-hovered {
  animation: shimmer-glow 1.4s ease-in-out infinite;
}


.scatter-link .scatter-item {
  cursor: pointer;
}

.scatter-item:nth-child(1) { animation-delay: 0.35s; }
.scatter-item:nth-child(2) { animation-delay: 0.5s; }
.scatter-item:nth-child(3) { animation-delay: 0.65s; }
.scatter-item:nth-child(4) { animation-delay: 0.8s; }
.scatter-item:nth-child(5) { animation-delay: 0.95s; }
.scatter-item:nth-child(6) { animation-delay: 1.1s; }
.scatter-item:nth-child(7) { animation-delay: 1.25s; }
.scatter-item:nth-child(8) { animation-delay: 1.4s; }
.scatter-item:nth-child(9) { animation-delay: 1.55s; }
.scatter-item:nth-child(10) { animation-delay: 1.7s; }

@keyframes scatter-in {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(var(--rot, 0deg));
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in-top {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}


.scatter-item[data-link] {
  cursor: pointer;
}

.scatter-item[data-scatter-id="camera"],
.scatter-item[data-scatter-id="scissors"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext y='26' font-size='26'%3E👀%3C/text%3E%3C/svg%3E") 16 16, auto;
}

/* ── Tablet (821px – 1279px) — subtle scale-down ── */
@media (min-width: 926px) and (max-width: 1279px) {
  .scatter-group--right {
    transform-origin: top right;
    transform: scale(0.90);
  }
  .scatter-group--left {
    transform-origin: top left;
    transform: scale(0.90);
  }
}


/* ── Small tablet (531px – 925px): desktop layout scaled down, car + cassette hidden ── */
@media (min-width: 531px) and (max-width: 925px) {
  .scatter-group--right {
    transform-origin: top right;
    transform: scale(0.90);
  }
  .scatter-group--left {
    transform-origin: top left;
    transform: scale(0.90);
  }
  .scatter-item[data-scatter-id="car"],
  .scatter-item[data-scatter-id="cassette"] {
    display: none;
  }
}

/* ────────────────────────────────────────────
   Footer
   ──────────────────────────────────────────── */
.home-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

/* ── Mobile (≤ 530px) ── */
@media (max-width: 530px) {
  body { overflow-x: hidden; overflow-y: auto; max-width: 100vw; }

  .room-label {
    left: 0;
    right: 0;
    text-align: center;
    animation-name: fade-in-top;
  }

  .stage {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 100vh;
    overflow: hidden;
    padding-top: 0;
  }

  /* Both scatter blocks become flow elements with fixed heights */
  .scatter {
    position: relative;
    inset: auto;
    height: auto;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
  }
  .scatter--above { height: 380px; flex-shrink: 0; }
  .scatter--below { height: 260px; flex-shrink: 0; }

  .scatter-group--right,
  .scatter-group--left {
    position: absolute;
    top: 0;
    right: auto;
    bottom: auto;
    height: 100%;
  }

  .scatter-group--right {
    width: 470px;
    left: 50%;
    transform: translateX(-50%);
  }

  .scatter-group--left {
    width: 254px;
    left: 0;
    transform: scale(0.85);
    transform-origin: top left;
  }

  .scatter--below { margin-top: -8px; }

  .scatter-item {
    position: absolute !important;
    animation: none;
    pointer-events: auto;
  }

  /* Group 1 — top: relative to .scatter--above */
  .scatter-item[data-scatter-id="camera"]   { left: -14px !important; top: 25px  !important; width: 377px !important; height: 250px !important; z-index: 2 !important; }
  .scatter-item[data-scatter-id="clock"]    { left: 254px !important; top: 83px  !important; width: 200px !important; height: 184px !important; transform: rotate(0deg)   !important; }
  .scatter-item[data-scatter-id="duck"]     { left: 314px !important; top: 213px !important; width: 113px !important; height: 118px !important; transform: rotate(0deg)   !important; }
  .scatter-item[data-scatter-id="to-do"]    { left: 40px  !important; top: 76px  !important; width: 94px  !important; height: 34px  !important; transform: rotate(-30deg) !important; }
  .scatter-item[data-scatter-id="car"]      { left: 72px  !important; top: 312px !important; width: 72px  !important; height: 32px  !important; transform: rotate(0deg)   !important; }
  .scatter-item[data-scatter-id="cassette"] { left: 98px  !important; top: 260px !important; width: 115px !important; height: 105px !important; transform: rotate(0deg)   !important; }

  /* Group 2 — top: relative to .scatter--below */
  .scatter-item[data-scatter-id="scissors"]    { left: 105px !important; top: 20px !important; width: 162px !important; height: 206px !important; }
  .scatter-item[data-scatter-id="in-progress"] { left: 57px  !important; top: 50px !important; width: 113px !important; height: 34px  !important; transform: rotate(11deg)  !important; }
  .scatter-item[data-scatter-id="pos-tag"]     { left: 13px  !important; top: 108px !important; width: 82px  !important; height: 96px  !important; transform: rotate(0deg)   !important; }

  /* Intro flows naturally between the two scatter blocks */
  .intro {
    position: relative;
    top: auto;
    left: 0;
    padding: 1.5rem 1.5rem 0;
    max-width: 100%;
    transform: none;
    animation: none;
  }

  .home-title {
    font-size: 44px;
    white-space: normal;
  }

  .home-wordmark { font-size: 16px; }
  .home-tagline  { font-size: 18px; }

  .scatter-item[data-scatter-id="camera"] {
    animation: scatter-bounce 11s ease-in-out infinite !important;
  }
  .scatter-item[data-scatter-id="scissors"] {
    animation: scatter-rotate 11s ease-in-out 5.5s infinite !important;
  }
}

@keyframes scatter-bounce {
  0%, 100%  { transform: translateY(0);     animation-timing-function: ease-out; }
  1.5%      { transform: translateY(-10px); animation-timing-function: ease-in; }
  4%        { transform: translateY(0);     animation-timing-function: ease-out; }
  5%        { transform: translateY(-4px);  animation-timing-function: ease-in; }
  6%        { transform: translateY(0);     animation-timing-function: ease-out; }
  7%        { transform: translateY(-1px);  animation-timing-function: ease-in; }
  8%        { transform: translateY(0); }
}

@keyframes scatter-rotate {
  0%, 10%, 100% { transform: rotate(0deg); }
  3%            { transform: rotate(-5deg); }
  7%            { transform: rotate(5deg); }
}

/* ── Very small mobile (< 375px) — scale scatter groups down ── */
@media (max-width: 374px) {
  .scatter-group--right {
    transform: scale(0.84);
    transform-origin: top left;
  }
  .scatter-group--left {
    transform: scale(0.84);
    transform-origin: top left;
  }
  .scatter--above { height: 320px; }
  .scatter--below { height: 220px; }
  .home-title { font-size: 38px; }
}


.home-footer-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}

.home-footer-inner.is-error {
  animation: input-shake 320ms ease;
  color: #c0392b;
}

.home-footer-input {
  background: none;
  border: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: inherit;
  caret-color: #747575;
  outline: none;
  padding: 0;
  cursor: default;
  min-width: 26ch; /* fallback floor before JS measurement fires */
}

.home-footer-input:focus {
  cursor: text;
}

.home-footer-input::placeholder {
  color: #747575;
}

.home-footer-arrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #747575;
  display: inline-block;
  transition: transform 450ms cubic-bezier(0.34, 1.2, 0.64, 1);
  transform-origin: center;
}

@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* Work section unlock transition */
.work-section.is-unlocked {
  display: block;
  animation: fade-in-up-section 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-in-up-section {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────────────────
   Work section
   ──────────────────────────────────────────── */
.work-section {
  display: none;
  background: #EAEAE7;
  padding: 80px 64px 120px;
  position: relative;
  z-index: 2;
}

.work-section-header {
  margin-bottom: 48px;
}

.work-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #0B0A09;
}

.work-container {
  max-width: 860px;
  margin: 0 auto;
}

.work-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.work-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.work-card.is-visible {
  opacity: 1;
}

.work-card.is-visible:hover {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.work-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
}

.work-thumb img,
.work-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover .work-thumb img,
.work-card:hover .work-thumb-placeholder {
  transform: scale(1.03);
}

.work-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: #0B0A09;
}

.work-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(11, 10, 9, 0.55);
  margin: 0;
  line-height: 1.5;
}

.work-impact {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  color: #6F6038;
  margin: 0;
}

/* ── Work section responsive ── */
@media (max-width: 900px) {
  .work-section { padding: 60px 40px 80px; }
}

@media (max-width: 820px) {
  .work-section { padding: 48px 24px 80px; }
  .work-grid { gap: 3rem; }
}

