/* This file is a TEMPLATE. The build (scripts/build.mjs) replaces the tokens
   below with values from site.config.json and writes the result to dist/styles.css.
   Do not edit dist/styles.css by hand — edit site.config.json (tokens) or this file.

   TYPOGRAPHY RULE (strict): body text is Geist Mono Regular 400, 12px / 14px line-height.
   Never add margins or padding between text lines — vertical spacing between lines of
   text comes ONLY from line-height. Use blank lines (an empty line) to create gaps. */

:root {
  --bg: rgb(210, 190, 210);
  --fg: rgb(0, 0, 0);
  --font: 'Geist Mono', monospace;
  --font-weight: 400;
  --font-size: 12px;
  --line-height: 14px;
  --img-border: 1px solid rgb(0, 0, 0);
  --sold-color: rgb(220, 30, 30);
  --sold-size: 20px;
  --sold-gap: 5px;
  --item-spacing: 5px;
  --site-margin: 10px;
  --bottom-margin: 200px;
  --section-spacing: 90px;
  --section-head-gap: 40px;
  --caption-image-gap: 10px;
  --mobile-image-width: 70;
  --mobile-image-width-landscape: 120;
  --badge-color: rgb(200, 0, 0);
  --badge-font-size: 12px;
  --link-hover: rgb(200, 0, 0);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: var(--font-weight);
  font-size: var(--font-size);
  line-height: var(--line-height);
  /* 20px top margin; sides are 0 so carousels can go full-bleed (the side margin is
     applied to the text blocks below instead); larger breathing room at the bottom.
     The fixed badge is anchored to the viewport, so it ignores this bottom margin. */
  padding: var(--site-margin) 0 var(--bottom-margin);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
/* The only hover cue on links and the language switch: turn red. */
a:hover,
.lang-switch button:hover { color: var(--link-hover); }
/* The commissions badge is red by default, so it turns black on hover instead. */
.badge a:hover { color: var(--fg); }

/* Text blocks carry the 20px side margin; carousels do not. */
.site-header,
.section-head {
  padding-left: var(--site-margin);
  padding-right: var(--site-margin);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  text-transform: uppercase;
  margin-bottom: var(--section-spacing);
}
.site-header p { margin: 0; }

.lang-switch { display: flex; gap: 8px; text-transform: uppercase; white-space: nowrap; }
.lang-switch button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-transform: uppercase;
}
.lang-switch .sep { user-select: none; }

/* ---------- Sections ---------- */
.section { margin-bottom: var(--section-spacing); }
.section:last-child { margin-bottom: 0; } /* bottom spacing comes from the body's bottom margin */
.section-head { text-transform: uppercase; margin-bottom: var(--section-head-gap); }
.section-subtitle { text-transform: uppercase; }

/* ---------- Carousel (full-bleed: spans the whole viewport width) ---------- */
/* touch-action: pan-y lets vertical page scrolling pass through while we handle
   horizontal drag/swipe ourselves (see carousel.js). */
.carousel { overflow: hidden; width: 100%; touch-action: pan-y; }
.track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  will-change: transform;
  user-select: none;
  cursor: grab;
}
.carousel.dragging .track { cursor: grabbing; }
/* The marquee, drag/swipe and eased hover-slow are all driven by carousel.js
   (a requestAnimationFrame loop), so there is no CSS animation here. */

@media (prefers-reduced-motion: reduce) {
  /* No JS marquee: fall back to native horizontal scrolling (needs touch-action back). */
  .carousel { overflow-x: auto; touch-action: auto; }
}

/* ---------- Artwork ---------- */
.artwork {
  flex: 0 0 auto;
  width: calc(var(--w) * 1vw);
  margin-right: var(--item-spacing);
  display: flex;
  flex-direction: column;
}
.caption {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  margin-bottom: var(--caption-image-gap);
}
.artwork img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
  border: var(--img-border);
  user-select: none;
  -webkit-user-drag: none; /* no ghost-drag image while dragging the carousel */
}
.sold-dot {
  width: var(--sold-size);
  height: var(--sold-size);
  border-radius: 50%;
  background: var(--sold-color);
  margin-top: var(--sold-gap);
  align-self: flex-end; /* aligned to the right edge of the image */
}

/* ---------- Commissions badge (pure CSS text, no image) ----------
   Size + character placement are computed in carousel.js so the ring always fits
   all three languages. This file only sets position, colour and rotation. */
.badge {
  position: fixed;
  right: var(--site-margin);
  bottom: var(--site-margin);
  color: var(--badge-color);
  z-index: 50;
}
.badge a { display: block; width: 100%; height: 100%; position: relative; color: inherit; }
.badge .ring { position: absolute; inset: 0; animation: badge-spin 20s linear infinite; }
.badge .ring span {
  position: absolute;
  left: 50%;
  top: 50%;
  font-family: var(--font);
  font-weight: var(--font-weight);
  font-size: var(--badge-font-size);
  line-height: 1;
  text-transform: uppercase;
}
@keyframes badge-spin { to { transform: rotate(-360deg); } } /* counterclockwise */

@media (max-width: 640px) {
  .site-header { flex-direction: column; }
}

/* Phone layout: portrait images take 60vw, landscape (horizontal) ones 120vw
   (overrides the per-artwork --w). */
@media (max-width: 600px) {
  .artwork.portrait  { width: calc(var(--mobile-image-width) * 1vw); }
  .artwork.landscape { width: calc(var(--mobile-image-width-landscape) * 1vw); }
}
