/* Shared by every page. Everything fits in one screen: no scrolling, sizes follow the window. */
/* the shape of the product photos (width / height). change to match your real photos, e.g. 3 / 4 or 1 / 1 */
:root {
  --photo-shape: 4 / 5;
  --photo-ratio: 0.8;   /* the same shape as one number (width / height), used by the big photo popup */
}
html, body { height: 100%; margin: 0; }
body {
  /* exactly one screen tall, so there's nothing to scroll; not overflow:hidden, because
     that also switches off pull-down-to-refresh on phones */
  height: 100vh; height: 100dvh; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; /* the whole page is one block, centered top-to-bottom */
  max-width: 840px; margin: 0 auto; padding: 4px 8px 3vh; text-align: center;
  font-size: clamp(12px, 2.2vh, 16px);
}
h1 { font-size: clamp(18px, min(6.2vw, 5vh), 36px); margin: 0; line-height: 1.15; overflow-wrap: anywhere; }
h1 a { color: inherit; text-decoration: none; }
h2 { font-size: clamp(13px, min(4vw, 2.6vh), 18px); margin: 0.1em 0 0.2em; line-height: 1.2; }
/* little profile photos on both sides of "hello, i am stephen" (the right one mirrored so they face each other) */
.hello { display: flex; align-items: center; justify-content: center; gap: 1.2em; }
.me { height: 3em; width: 3em; border: 1px solid #000; flex: none; }
.me.flip { transform: scaleX(-1); }
input { font: inherit; }
/* boxes and buttons drawn the same on every device (phones otherwise make them very faint) */
input[type=text], input[type=email], input[type=number] {
  border: 1px solid #333; border-radius: 2px; background: #fff; color: #000; padding: 2px 4px;
}
input[type=text]:focus, input[type=email]:focus, input[type=number]:focus { outline: 2px solid #06c; outline-offset: 0; }
input[type=submit], a.button {
  -webkit-appearance: none; appearance: none;
  border: 1px solid #333; border-radius: 3px; background: linear-gradient(#fff, #ddd); color: #000;
  padding: 2px 10px; cursor: pointer;
}
a.button { display: inline-block; text-decoration: none; font: inherit; line-height: normal; }
input[type=submit]:active, a.button:active { background: linear-gradient(#ddd, #fff); }
input[type=submit]:disabled { color: #888; border-color: #aaa; }
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 1em; height: 1em; margin: 0 0.2em 0 0; vertical-align: -2px;
  border: 1px solid #333; border-radius: 2px; background: #fff; cursor: pointer; display: inline-grid; place-content: center;
}
input[type=checkbox]:checked { background: #000; }
input[type=checkbox]:checked::after { content: "\2713"; color: #fff; font-size: 0.8em; line-height: 1; }
input[type=checkbox]:focus-visible { outline: 2px solid #06c; }
p { margin: 0.4em 0; }
/* breathing room between the sections; vh so it grows on tall screens and shrinks on short ones */
/* the product's name: the title of the product page, second only to the welcome */
.product-title { font-size: clamp(18px, min(5.5vw, 4vh), 30px); margin: 2vh 0 0; }
.crumbs { font-size: 0.85em; margin: 0.1em 0 2.5vh; }
main { margin-top: 2vh; }
.socials { margin-top: 3vh; }
form.signup p, .build p { margin: 1vh 0; }
/* a sentence that stays on one line: on narrow phones it shrinks a little instead of wrapping */
.one-line { white-space: nowrap; font-size: min(1em, 3.55vw); }
.confirm { margin: 0.5vh 0; }
.mailing { margin: 0.5vh 0 0; }
.mailing p { margin: 0.5vh 0; }

/* ---------- home page: list of things ---------- */
main { flex: 0 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.things {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 16px;
}
.thing { width: 150px; }
.thing img { width: 100%; aspect-ratio: var(--photo-shape); object-fit: cover; display: block; border: 1px solid #000; }

/* ---------- product page: photos + signup form ---------- */
/* photos + form only take the room they need (and shrink on small screens) */
form.signup { flex: 0 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.variants { flex: 0 1 auto; max-height: 55vh; min-height: 80px; display: flex; justify-content: center; gap: 12px; margin: 0 0 2.5vh; }
/* each column is only as wide as its photo can be at the height it gets, so the photos sit side by side */
.variant { flex: 0 1 calc((55vh - 4em) * var(--photo-shape)); min-width: 0; display: flex; flex-direction: column; }
.variant input[type=number] { width: 3.5em; }
.price { display: block; white-space: nowrap; }   /* own line, so both lamps always line up */
.price small { color: #555; }

/* popups (the "why these prices?" box): a plain 2004-style window */
.popup { border: 1px solid #000; padding: 0; max-width: min(92vw, 420px); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25); }
.popup::backdrop { background: rgba(0, 0, 0, 0.3); }
.popup-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1em;
  background: linear-gradient(#eee, #ccc); border-bottom: 1px solid #000; padding: 3px 4px 3px 8px; font-weight: bold;
}
.popup-close { border: 1px solid #333; background: #fff; font: bold 14px/1 Verdana, sans-serif; width: 20px; height: 20px; padding: 0; cursor: pointer; }
.breakdown { border-collapse: collapse; margin: 10px 12px 4px; }
.breakdown th, .breakdown td { padding: 3px 10px; text-align: right; }
.breakdown th:first-child, .breakdown td:first-child { text-align: left; padding-left: 0; }
.breakdown th { border-bottom: 1px solid #000; }
.breakdown .total td { border-top: 1px solid #000; font-weight: bold; }
.breakdown .sub td { border-top: 1px dotted #000; font-style: italic; }
.popup-note { margin: 6px 12px 12px; font-size: 0.9em; text-align: left; }
.led-legs { display: block; width: 100%; max-width: 360px; height: auto; margin: 8px auto 0; }
/* the photo box takes the photos' shape, so there's no blank space above or below */
.pic { aspect-ratio: var(--photo-shape); flex: 0 1 auto; min-height: 0; position: relative; }
/* the frame is exactly the photo's size, so the arrows sit on the photo's edges */
.frame { container-type: inline-size; position: relative; display: block; height: 100%; max-width: 100%; aspect-ratio: var(--photo-shape); margin: 0 auto; }
.pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pic img { cursor: zoom-in; }
/* the big photo popup (tap a photo) */
.popup.zoom { max-width: 96vw; }
.zoom-pic { position: relative; }
.zoom-pic img { display: block; width: min(92vw, 900px, calc((100dvh - 90px) * var(--photo-ratio))); height: auto; max-height: calc(100dvh - 90px); object-fit: contain; }
.zoom-pic .prev, .zoom-pic .next {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 1px solid #333; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); color: #000; font: bold 24px/1 Verdana, sans-serif; padding: 0 0 3px; cursor: pointer;
}
.zoom-pic .prev { left: 8px; }
.zoom-pic .next { right: 8px; }
.zoom-pic .prev:hover, .zoom-pic .next:hover { background: #fff; }
/* photo arrows: round buttons on the left/right edge of the photo, so it's obvious there are more */
.pic .prev, .pic .next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: min(1.7em, 30cqw); height: min(1.7em, 30cqw); padding: 0; border: 1px solid #000; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); color: #000; cursor: pointer;
  font: bold min(18px, 18cqw)/1 Verdana, sans-serif;   /* arrows shrink with small photos */
}
.pic .prev { left: min(6px, 3cqw); }
.pic .next { right: min(6px, 3cqw); }
.pic .prev:hover, .pic .next:hover { background: #fff; }
/* invisible bigger tap area around each arrow, so near-misses on phones still hit it instead of zooming */
.pic .prev::before, .pic .next::before { content: ""; position: absolute; inset: -14px; }
/* dots under the photo: how many photos there are, and which one you're on */
.dots { line-height: 1; margin: 4px 0 2px; }
.dots button {
  width: 9px; height: 9px; margin: 0 3px; padding: 0; vertical-align: middle;
  border: 1px solid #000; border-radius: 50%; background: #fff; cursor: pointer;
}
.dots button.on { background: #000; }
.who { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5em 1.2em; margin: 1vh 0; }
.who label { white-space: nowrap; }
input[type=email] { width: 14em; max-width: 60vw; }
input[name=name] { width: 9em; max-width: 60vw; }
/* the honeypot field: off-screen, only bots fill it in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* the robot check card: floats at the bottom of the screen, over the page, only while needed */
.human-check {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 50;
  background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
  padding: 6px 10px 8px; text-align: center; max-width: calc(100vw - 24px);
  visibility: hidden; pointer-events: none;
}
.human-check.on { visibility: visible; pointer-events: auto; }
.human-check p { margin: 0 0 4px; font-size: 0.85em; }

/* ---------- bouncers (added by site.js) ---------- */
.bounce { position: fixed; top: 0; left: 0; z-index: -1; pointer-events: none; }
#cat { width: 150px; }
#cat img { width: 100%; display: block; }
/* meme caption: white Impact letters with a black outline, across the bottom of the photo */
#cat span {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font: bold 21px/1 Impact, "Anton", "Arial Black", sans-serif; color: #fff; white-space: nowrap;
  -webkit-text-stroke: 1.5px #000; text-shadow: 0 2px 3px #000;
}
#ty { font-size: 32px; font-weight: bold; white-space: nowrap; }
/* the instagram one is clickable, so it floats above the page instead of behind it */
#follow { z-index: 1; pointer-events: auto; font-size: 20px; font-weight: bold; white-space: nowrap; }
/* phones (portrait): less clutter.
   - the maplestory guy gets his own floor at the bottom, under the links, instead of walking over text
   - product pages get a slim header: just the site name, no "welcome to" / hello line / selfies
     (the home page keeps them, that's where they introduce stephen) */
@media (max-width: 600px) {
  body { padding-bottom: 112px; }
  .product-page .welcome, .product-page .hello { display: none; }
  .product-page h1 { font-size: clamp(18px, 6.4vw, 30px); }
  /* one lamp at a time: tabs above, the chosen lamp nearly full width */
  .lamp-tabs { display: flex; }
  .variant:not(.active) { display: none; }
  .variant { flex-basis: min(100%, calc((55vh - 4em) * var(--photo-shape))); }
  .variants { max-height: none; }
  .variant > span > b { display: none; }   /* the tab already says which lamp it is */
  .variant .dots { margin: -16px 0 6px; position: relative; z-index: 1; }   /* dots sit on the photo's bottom edge */
  body { padding-bottom: 92px; }
  /* tighter gaps between sections, so the photo gets the room */
  .product-page .product-title { margin-top: 0.6vh; }
  .product-page .crumbs { margin-bottom: 1.2vh; }
  .variants { margin-bottom: 1.2vh; }
  .who { margin: 0.6vh 0; }
  form.signup p, .build p { margin: 0.6vh 0; }
  .socials { margin-top: 1.2vh; }
}
/* the "white | multicolor" tabs (phones only, see above) */
.lamp-tabs { display: flex; justify-content: center; gap: 4px; margin: 0 0 6px; border-bottom: 1px solid #333; }
.lamp-tabs button {
  font: inherit; color: #000; background: linear-gradient(#fff, #ddd); cursor: pointer;
  border: 1px solid #333; border-bottom: none; border-radius: 4px 4px 0 0; padding: 3px 14px; margin-bottom: -1px;
}
.lamp-tabs button.on { background: #fff; font-weight: bold; padding-bottom: 4px; }
@media (min-width: 601px) { .lamp-tabs { display: none; } }   /* after the rules above, so it wins on wide screens */
/* phones (narrow, or held sideways): only the maplestory guy moves; the rest is too busy on a small screen */
@media (max-width: 600px), (max-height: 500px) { #cat, #ty, #follow, #corners { display: none; } }
/* the maplestory guy, standing on the bottom edge of the screen */
#guy { position: fixed; left: 0; bottom: 22px; height: 120px; aspect-ratio: 128 / 180; z-index: -1; pointer-events: none; }
@media (max-width: 500px) { #guy { height: 68px; } }
#guy img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the joints each part turns around (shoulders and hips), as % of the 128x180 sprite */
#guy .body  { transform-origin: 50% 100%; }
/* the name tag under his feet, like the game's */
#guy .tag {
  position: absolute; top: 100%; left: 50%; margin-top: 1px; padding: 1px 5px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.62); color: #fff; font: 14px/1.3 Verdana, sans-serif; white-space: nowrap;
  transform: translateX(-50%);
}
#guy .handL { transform-origin: 39% 62%; }
#guy .handR { transform-origin: 69% 62%; }
#guy .legL  { transform-origin: 45% 81%; }
#guy .legR  { transform-origin: 62% 81%; }
#corners { position: fixed; bottom: 4px; right: 8px; font-size: 12px; }
