/* Lovable Gazelle Workshop, v4.
   Readability first: text only ever sits on flat, solid panels. Everything is flat. System fonts only.
   Brand palette: black + hot pink. Cream/white panels and a deeper pink carry the text and buttons. */
:root {
  --ink: #0d0d0d;        /* brand black: page background, text on light panels */
  --pink: #ff00aa;       /* brand hot pink: colour blocks, borders and art only, never behind text */
  --pink-deep: #990066;  /* deeper pink: button fills (white text) and highlight text on cream */
  --cream: #fff4e3;      /* text panels */
  --white: #fff;
  --cyan: #00dcff;       /* art only */
  --yellow: #f5ff00;     /* art only */
  --steel: #5a5a62;      /* art only */
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Black", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--white); font: 400 1.125rem/1.6 var(--body); }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .45em; overflow-wrap: break-word; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.5rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hl { color: var(--pink-deep); }
.arrow { flex: none; width: 1em; height: 1em; }

/* focus: a plain outline, dark on light panels, white on the black areas */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.top :focus-visible, .foot :focus-visible, .hero-art :focus-visible, .skip:focus-visible { outline-color: var(--white); }
main:focus { outline: none; }

.skip { position: absolute; left: 8px; top: 8px; z-index: 100; display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px; background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; font-weight: 800; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* header */
.top { display: flex; align-items: center; gap: 14px; padding: 10px clamp(14px, 3vw, 32px); background: var(--ink); border-bottom: 4px solid var(--pink); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--white); text-decoration: none; font: 900 1.125rem/1.1 var(--display); }
.brand-logo { display: block; height: 60px; width: auto; }
.brand-sep { padding-left: 12px; border-left: 2px solid var(--steel); }
.top-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 8px 18px; background: var(--white); color: var(--ink); border: 3px solid var(--white); border-radius: 999px; font-weight: 800; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.top-cta:hover { background: var(--pink-deep); color: var(--white); }

/* buttons: solid fills, white-on-dark or black-on-white only */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border: 3px solid var(--ink); border-radius: 14px; font: 800 1.125rem/1.2 var(--body); text-align: center; text-decoration: none; cursor: pointer; transition: transform .15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pink-deep); color: var(--white); }
.btn-primary:hover { background: var(--ink); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { background: var(--ink); color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--pink-deep); }
.btn-big { min-height: 60px; padding: 16px 30px; font-size: clamp(1.125rem, 2vw, 1.375rem); }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* shared blocks */
section { padding: clamp(40px, 6vw, 88px) clamp(16px, 4vw, 40px); }
.panel { background: var(--cream); color: var(--ink); border: 4px solid var(--pink); border-radius: 24px; padding: clamp(22px, 4vw, 48px); }
.kicker { display: inline-block; margin: 0 0 16px; padding: 6px 14px; background: var(--ink); color: var(--white); border-radius: 10px; font-weight: 800; line-height: 1.3; transform: rotate(-2deg); }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); max-width: 56ch; margin: 0; }
.sub { max-width: 58ch; }
.section-head { max-width: 760px; margin: 0 auto; }
.section-head h2 { margin-bottom: 0; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; max-width: 1200px; margin: 0 auto; }
.hero-art { min-width: 0; }
.motion-toggle { display: flex; align-items: center; gap: 10px; width: fit-content; min-height: 48px; margin: 0 0 16px auto; padding: 6px 16px 6px 10px; border: 2px solid var(--white); border-radius: 999px; color: var(--white); font-weight: 700; line-height: 1.2; cursor: pointer; }
.motion-toggle input { -webkit-appearance: none; appearance: none; flex: none; width: 28px; height: 28px; margin: 0; border: 2px solid var(--white); border-radius: 8px; background: var(--ink); cursor: pointer; }
.motion-toggle input:checked { background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%230d0d0d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }

/* the scene is one grid cell; every layer is stacked in it and placed with margins (percentages of the scene width) */
.scene { display: grid; max-width: 520px; margin: 0 auto; }
.scene > * { grid-area: 1 / 1; }
.shop { z-index: 1; display: block; width: 100%; height: auto; margin-bottom: 22px; }
.gears { z-index: 0; justify-self: end; align-self: start; width: 36%; height: auto; overflow: visible; }
.sign-shop, .sign-door { z-index: 2; justify-self: center; align-self: start; transform: translateY(-50%); text-align: center; }
.sign-shop { margin-top: 24%; padding: 1px 10px; border: 2px solid var(--cyan); border-radius: 6px; background: var(--ink); color: var(--cyan); font: 900 1.125rem/1.4 var(--display); letter-spacing: .05em; }
.sign-door { margin-top: 59%; padding: 8px 16px; border: 4px solid var(--pink); border-radius: 8px; background: var(--cream); color: var(--ink); font-weight: 700; line-height: 1.3; }
.sign-door b { display: block; font: 900 1.5rem/1.15 var(--display); }
.glow { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .3; } }
.beacon { animation: beacon 1.6s linear infinite; }
@keyframes beacon { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
.sparks circle { transform-box: fill-box; animation: spark 1.6s ease-out infinite; }
.sparks circle:nth-child(2) { animation-delay: .3s; } .sparks circle:nth-child(3) { animation-delay: .7s; }
.sparks circle:nth-child(4) { animation-delay: 1s; } .sparks circle:nth-child(5) { animation-delay: .5s; }
@keyframes spark { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(6px, -34px); opacity: 0; } }
.spin-cw { animation: spin 12s linear infinite; }
.spin-cw.fast { animation-duration: 6s; }
.spin-ccw { animation: spin 9s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.crew { z-index: 3; align-self: end; justify-self: center; display: flex; align-items: flex-end; gap: 18px; }
.bot { position: relative; display: flex; gap: 8px; justify-content: center; align-items: center; width: 46px; height: 40px; border: 3px solid var(--ink); border-radius: 10px; background: var(--cyan); animation: hop 1.8s ease-in-out infinite; }
.bot::before { content: ""; position: absolute; top: -14px; left: 50%; width: 3px; height: 12px; margin-left: -1.5px; background: var(--white); }
.bot::after { content: ""; position: absolute; top: -22px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--pink); }
.bot-b { background: var(--white); animation-delay: .6s; }
.eye { width: 8px; height: 10px; border-radius: 3px; background: var(--ink); animation: blink 4s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.human { position: relative; width: 40px; height: 62px; animation: hop 1.8s ease-in-out .3s infinite; }
.human::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 26px; margin-left: -13px; border: 3px solid var(--ink); border-radius: 50%; background: var(--pink); }
.human::after { content: ""; position: absolute; bottom: 0; left: 0; width: 40px; height: 34px; border: 3px solid var(--ink); border-radius: 18px 18px 6px 6px; background: var(--white); }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } }

.note { z-index: 4; padding: 4px 12px; border: 3px solid var(--ink); background: var(--yellow); color: var(--ink); font-weight: 800; line-height: 1.4; transform: rotate(var(--r)); animation: float 5s ease-in-out infinite; }
.n1 { --r: -8deg; align-self: start; justify-self: start; margin-top: 4%; }
.n2 { --r: 6deg; align-self: start; justify-self: end; margin-top: 36%; background: var(--cyan); animation-delay: 1.2s; }
.n3 { --r: 4deg; align-self: end; justify-self: start; margin-bottom: 24%; background: var(--white); animation-delay: 2.4s; }
@keyframes float { 50% { transform: translateY(-8px) rotate(var(--r)); } }

/* conveyor: its own band, no text on it */
.conveyor { position: relative; height: 86px; overflow: hidden; background: var(--ink); }
.parts { position: absolute; left: 0; bottom: 26px; display: flex; width: 200%; animation: ride 30s linear infinite; }
.parts-set { flex: 0 0 50%; display: flex; justify-content: space-around; align-items: flex-end; }
.part { flex: none; width: 52px; height: 52px; }
@keyframes ride { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.belt { position: absolute; left: -52px; right: 0; bottom: 0; height: 26px; border-block: 4px solid var(--steel); background: repeating-linear-gradient(90deg, #2a2a2e 0 44px, var(--pink) 44px 52px); animation: belt 1s linear infinite; }
@keyframes belt { to { transform: translateX(52px); } }

/* sticker strip: pink colour block, text on solid chips */
.stickers { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin: 0; padding: 24px clamp(16px, 4vw, 40px); list-style: none; background: var(--pink); }
.stickers li { padding: 8px 18px; border: 3px solid var(--ink); border-radius: 999px; background: var(--cream); color: var(--ink); font-weight: 800; line-height: 1.3; transform: rotate(-2deg); }
.stickers li:nth-child(even) { background: var(--ink); color: var(--white); transform: rotate(1.5deg); }

/* crew */
.crew-sec { background: var(--cream); color: var(--ink); }
.crew-head { display: grid; grid-template-columns: minmax(120px, 230px) minmax(0, 1fr) minmax(120px, 230px); align-items: end; gap: 24px; max-width: 1100px; margin: 0 auto 36px; text-align: center; }
.crew-head .v { display: block; width: 100%; height: auto; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1100px; margin: 0 auto; }
.card { background: var(--white); border: 3px solid var(--ink); border-radius: 20px; padding: 26px; }
.card p { margin: 0; }
.card-icon { display: block; width: 72px; height: 72px; margin-bottom: 14px; }
.sign-top .card-icon { margin: 0; }

.blink { transform-box: fill-box; transform-origin: center; animation: blink 3.2s infinite; }
.weld-glow { animation: flicker .7s steps(2) infinite; }
@keyframes flicker { 50% { opacity: .25; } }
.weld-sparks circle { animation: wspark .9s ease-out infinite; }
.weld-sparks circle:nth-child(1) { --dx: 26px; --dy: -30px; }
.weld-sparks circle:nth-child(2) { --dx: 34px; --dy: -8px; animation-delay: .15s; }
.weld-sparks circle:nth-child(3) { --dx: 14px; --dy: -40px; animation-delay: .3s; }
.weld-sparks circle:nth-child(4) { --dx: 30px; --dy: 12px; animation-delay: .45s; }
.weld-sparks circle:nth-child(5) { --dx: -6px; --dy: -34px; animation-delay: .6s; }
.weld-sparks circle:nth-child(6) { --dx: 38px; --dy: -22px; animation-delay: .75s; }
@keyframes wspark { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.hammer-arm { transform-origin: 10px -26px; animation: hammer 1.1s cubic-bezier(.5, 0, .9, .4) infinite; }
@keyframes hammer { 0%, 45%, 100% { transform: rotate(-55deg); } 70% { transform: rotate(14deg); } 80% { transform: rotate(10deg); } }
.clank { transform-box: fill-box; transform-origin: center; opacity: 0; animation: clank 1.1s infinite; }
@keyframes clank { 0%, 66% { opacity: 0; transform: scale(.3); } 72% { opacity: 1; transform: scale(1.1); } 90%, 100% { opacity: 0; transform: scale(1.3); } }

/* door */
.door { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); align-items: center; max-width: 1100px; margin: 0 auto; }
.door-art { display: flex; align-items: flex-end; justify-content: center; gap: 2%; min-width: 0; padding: 22px 18px; border-radius: 24px; background: var(--pink); }
.door-art .v { display: block; height: auto; }
.juggler { width: 38%; }
.board { width: 58%; }
.orbit { animation: spin 2.4s linear infinite; }
.orbit.o2 { animation-delay: -.8s; } .orbit.o3 { animation-delay: -1.6s; }
.counter { animation: spin 2.4s linear infinite reverse; }
.orbit.o2 .counter { animation-delay: -.8s; } .orbit.o3 .counter { animation-delay: -1.6s; }
.point-arm { transform-origin: 10px -26px; animation: point 1.4s ease-in-out infinite; }
@keyframes point { 50% { transform: rotate(-12deg); } }
.door-art.shake { animation: rattle .4s linear; }
@keyframes rattle { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.door-copy .sub { margin-bottom: 0; }
.knock { margin-top: 24px; }
#knock.thump { animation: thump .35s ease; }
@keyframes thump { 40% { transform: scale(.94); } }
.reply { min-height: calc(2.8em + 34px); margin: 18px 0 0; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 16px; background: var(--white); color: var(--ink); font-size: 1.25rem; font-weight: 700; line-height: 1.4; }
.reply a { display: inline-block; padding: 8px 0; color: var(--pink-deep); font-weight: 800; }

/* final sign: logo on black, text on cream */
.final { background: var(--pink); }
.sign { max-width: 820px; margin: 0 auto; overflow: hidden; border: 4px solid var(--ink); border-radius: 28px; background: var(--cream); color: var(--ink); text-align: center; }
.sign-top { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 28px); padding: 22px 16px; background: var(--ink); }
.final-logo { display: block; width: min(300px, 54vw); height: auto; }
.mug { flex: none; width: clamp(40px, 9vw, 64px); height: auto; }
.mug-body { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 3.2s ease-in-out infinite; }
.mug-r .mug-body { animation-delay: -1.6s; }
@keyframes bob { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.steam { animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 0%, 100% { opacity: .25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-2px); } }
.sign-body { padding: clamp(24px, 4vw, 48px); }
.sign-body h1, .sign-body h2 { font-size: clamp(1.625rem, 4.6vw, 3.5rem); }
.sign-body .sub { margin: 0 auto 1.5em; }

/* footer */
.foot { padding: 20px clamp(16px, 4vw, 40px); border-top: 4px solid var(--pink); background: var(--ink); color: var(--white); text-align: center; }
.foot p { max-width: 70ch; margin: 0 auto; }
.foot a { display: inline-block; padding: 9px 0; font-weight: 700; }

/* pause: the visitor's switch, and anything scrolled off screen */
html:has(#pause-motion:checked) *, html:has(#pause-motion:checked) *::before, html:has(#pause-motion:checked) *::after,
.motion-paused *, .motion-paused *::before, .motion-paused *::after,
.art.paused, .art.paused *, .art.paused *::before, .art.paused *::after { animation-play-state: paused !important; }

@media (max-width: 899px) {
  .hero, .door, .cards { grid-template-columns: 1fr; }
  .scene, .door-art { width: 100%; max-width: 460px; margin-inline: auto; }
  .motion-toggle { margin-inline: auto; }
  .crew-head { grid-template-columns: 1fr 1fr; }
  .crew-head .section-head { grid-column: 1 / -1; grid-row: 2; }
  .crew-head .v { max-width: 210px; justify-self: center; }
  .cards { max-width: 640px; }
  .card { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .card-icon { grid-row: 1 / span 2; margin: 0; }
}
@media (max-width: 479px) {
  .brand-sep { display: none; }
  .brand-logo { height: 46px; }
  .ctas .btn { width: 100%; }
  .btn-big { padding: 14px 18px; }
  .n3 { display: none; } /* would crowd the door sign on a narrow scene */
  .card { padding: 20px; grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; }
  .card-icon { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .motion-toggle { display: none; }
  .orbit.o2 { transform: rotate(120deg); }
  .orbit.o3 { transform: rotate(240deg); }
  .orbit.o2 .counter { transform: rotate(-120deg); }
  .orbit.o3 .counter { transform: rotate(-240deg); }
}
