/* stunnah · mood prototype v2 · PLAN.md §5 */

:root {
  --bg: #fff;
  --fg: #000;
  --muted: rgba(0, 0, 0, .45);
  --heart: rgba(0, 0, 0, .14);   /* "halbtransparent": present, not faint (§5 had .07) */
  --inset: 20px;
  --logo-h: 40px;
  --lll-h: 48px;
  --tap: 44px;
  --icon: 28px;
  /* vertical rhythm */
  --gap-block: clamp(2.5rem, 6.5vh, 4rem);
  --gap-inner: 1rem;
  /* brand artwork ratios (viewBox of assets/logo.svg and assets/heart.svg) */
  --logo-ratio: 1841 / 832;
  --heart-ratio: 2347 / 1742;
  color-scheme: light;
}

[data-theme=dark] {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .45);
  --heart: rgba(255, 255, 255, .16);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, .9rem + .4vw, 1.125rem);
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

/* theme switch: page colours crossfade with the icon (initial paint has no transition) */
@media (prefers-reduced-motion: no-preference) {
  body,
  .heart,
  .btn,
  .placeholder,
  .track {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
  }
}

/* legal pages / legal snippets keep their real casing (names, paragraphs, amounts) */
.legal {
  text-transform: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  line-height: 1.1;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h2 {
  font-size: inherit;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color .15s ease, opacity .15s ease, background-color .15s ease;
}

a:hover,
a:focus-visible {
  color: var(--muted);
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

button {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

.icon {
  display: block;
  width: var(--icon);
  height: var(--icon);
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- heart watermark ---------- */

.heart {
  position: fixed;
  inset: 0;
  margin: auto;
  /* L♥L mark is wider than tall: the longer side gets min(60vw, 60vh) */
  width: min(60vw, 60vh);
  height: calc(min(60vw, 60vh) / (var(--heart-ratio)));
  color: var(--heart);
  z-index: 0;
  pointer-events: none;   /* the box is inert … */
  cursor: pointer;
}

.heart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.heart use {
  pointer-events: auto;   /* … only the painted shape catches the invert click */
}

.heart use:hover {
  opacity: .8;
}

/* checkout: half strength so the form stays readable */
.page-kasse .heart {
  opacity: .5;
}

/* soft breathe: 1 → 1.02 over 8 s, eased both ways, no opacity flicker */
@media (prefers-reduced-motion: no-preference) {
  .heart svg {
    animation: breathe 8s cubic-bezier(.45, 0, .55, 1) infinite;
    transform-origin: 50% 50%;
    will-change: transform;
  }
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--inset);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

/* brand marks: inline <svg><use> referencing the per-page sprite; fill = currentColor → var(--fg) */
.logo,
.lll {
  display: block;
}

.logo svg,
.lll svg {
  display: block;
  width: 100%;
  height: 100%;
}

.logo {
  height: var(--logo-h);
  aspect-ratio: var(--logo-ratio);
  border: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  /* keep nav on the logo's centre line and the text edge on the 20px inset */
  margin: calc((var(--logo-h) - var(--tap)) / 2) -.5rem 0 0;
}

/* ≥44×44 hit box for links, icon links and text buttons */
.tap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 .5rem;
  border: 0;
}

/* text variant: underline follows the text, not the 44px box */
.tap.text::after {
  content: "";
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: calc(50% - .75em);
  height: 1px;
  background: currentColor;
}

/* nav: only the current page carries the underline */
.nav .tap.text::after {
  display: none;
}

.nav .tap[aria-current=page]::after {
  display: block;
}

.nav .tap.text:hover::after,
.nav .tap.text:focus-visible::after {
  display: block;
}

/* theme toggle: moon in light mode (→ dark), sun in dark mode (→ light) */
.theme-toggle {
  padding: 0;
}

/* both icons stacked; the inactive one fades + rotates out (crossfade, no hard cut) */
.theme-toggle .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  transition: opacity .3s ease, transform .3s ease;
}

.theme-toggle:hover {
  color: var(--muted);
}

[data-theme=dark] .icon-moon,
:root:not([data-theme=dark]) .icon-sun {
  opacity: 0;
  transform: rotate(-60deg) scale(.7);
  pointer-events: none;
}

/* ---------- main ---------- */

.content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--gap-block);
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: calc(var(--logo-h) + 2 * var(--inset) + var(--gap-block)) var(--inset) var(--gap-block);
  pointer-events: none;   /* whitespace lets clicks fall through to the heart */
}

.content * {
  pointer-events: auto;
}

.content section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-inner);
}

/* hero: page title + muted subline */
.hero {
  gap: .75rem;
}

.display {
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 400;
}

.subline {
  color: var(--muted);
  font-size: clamp(1rem, .95rem + .4vw, 1.25rem);
  max-width: 48ch;
  text-wrap: balance;
}

.label {
  font-size: inherit;
}

/* icon-row: one line of monochrome service icons, 44×44 each */
.icon-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
}

.icon-link {
  color: inherit;
  border-radius: 4px;
}

.icon-link .icon {
  transition: transform .18s ease, opacity .18s ease;
  will-change: transform;
}

/* hover: scale only, monochrome stays; the 44×44 box itself does not move */
.icon-link:hover .icon,
.icon-link:focus-visible .icon {
  transform: scale(1.15);
}

.icon-link:hover,
.icon-link:focus-visible {
  color: inherit;
}

.icon-link:active .icon {
  transform: scale(1.05);
}

.icon-link:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

/* equalizer under the hero: 5 bars, staggered slow loop */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
  margin-top: .75rem;
  color: var(--muted);
}

.eq i {
  display: block;
  width: 3px;
  height: 100%;
  background: currentColor;
  transform-origin: bottom;
  transform: scaleY(.35);
}

@media (prefers-reduced-motion: no-preference) {
  .eq i {
    animation: eq 2.8s ease-in-out infinite;
  }

  .eq i:nth-child(1) { animation-duration: 3.1s; animation-delay: -.4s; }
  .eq i:nth-child(2) { animation-duration: 2.6s; animation-delay: -1.3s; }
  .eq i:nth-child(3) { animation-duration: 3.4s; animation-delay: -.9s; }
  .eq i:nth-child(4) { animation-duration: 2.9s; animation-delay: -2.1s; }
  .eq i:nth-child(5) { animation-duration: 3.2s; animation-delay: -1.7s; }
}

/* static fallback keeps a "paused" waveform silhouette */
@media (prefers-reduced-motion: reduce) {
  .eq i:nth-child(1) { transform: scaleY(.3); }
  .eq i:nth-child(2) { transform: scaleY(.7); }
  .eq i:nth-child(3) { transform: scaleY(1); }
  .eq i:nth-child(4) { transform: scaleY(.55); }
  .eq i:nth-child(5) { transform: scaleY(.4); }
}

@keyframes eq {
  0%, 100% { transform: scaleY(.25); }
  30%      { transform: scaleY(.9); }
  55%      { transform: scaleY(.45); }
  75%      { transform: scaleY(1); }
}

.quiet {
  color: var(--muted);
  border-bottom-color: currentColor;
}

.quiet .muted {
  margin-left: .25rem;
}

.quiet:hover {
  color: var(--fg);
}

/* bordered text button (download, coming soon) – inverts on hover */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 1rem;
  border: 1px solid var(--fg);
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  color: var(--bg);
  background: var(--fg);
}

.btn[aria-disabled=true],
.btn:disabled {
  cursor: default;
  color: var(--muted);
  border-color: var(--muted);
  background: none;
}

.btn-primary {
  font-weight: 700;
  padding: 0 1.5rem;
  min-height: 48px;
}

.hint {
  color: var(--muted);
  font-size: .9375rem;
  max-width: 44ch;
  text-wrap: balance;
}

.block.wide {
  width: 100%;
}

/* ---------- product grid (shop) ---------- */

.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  width: 100%;
  max-width: 48rem;
  text-align: left;
}

@media (max-width: 40em) {
  .products {
    grid-template-columns: 1fr;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* line-art drawings: stroke = currentColor, invert with the theme */
.art {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  color: var(--fg);
}

/* drawings sit on solid --bg so the watermark doesn't compete with the print */
.product-card .art-link {
  display: block;
  border: 1px solid var(--fg);
  padding: 8%;
  background: var(--bg);
}

.product-card .art-link:hover .art,
.product-card .art-link:focus-visible .art {
  transform: scale(1.03);
}

.product-card > .art {
  border: 1px solid var(--fg);
  padding: 8%;
  background: var(--bg);
}

.product-card .art {
  transition: transform .2s ease;
}

.product-card h2 a {
  border: 0;
}

.product-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: .25rem;
}

.product-card .price {
  font-weight: 700;
}

.product-card .btn {
  align-self: flex-start;
  margin-top: .25rem;
}

/* ---------- track list (downloads) ---------- */

.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 36rem;
  text-align: left;
}

.track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .75rem 0;
  border-top: 1px solid var(--fg);
}

.track:last-child {
  border-bottom: 1px solid var(--fg);
}

.track .title {
  flex: 1;
}

.track .duration {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 0 var(--inset) var(--inset);
  text-align: center;
}

.site-footer .lll {
  height: var(--lll-h);
  aspect-ratio: var(--heart-ratio);
  margin-bottom: .25rem;
}

.notice {
  color: var(--muted);
  font-size: .8125rem;
}

@media (max-width: 40em) {
  :root {
    --logo-h: 32px;
    --lll-h: 40px;
    --gap-block: clamp(2.5rem, 6vh, 4rem);
  }

  .track {
    gap: 1rem;
  }

  .track .btn {
    padding: 0 .75rem;
  }
}

/* ---------- motion kill switch ---------- */
/* everything above that moves is already gated; this catches transitions too */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- product single (produkt-socken) ---------- */

.content .product-single {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  max-width: 52rem;
  text-align: left;
}

.product-single .art-large {
  border: 1px solid var(--fg);
  padding: 6%;
  background: var(--bg);
}

.buy {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.buy-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.buy-head h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.buy .price {
  font-weight: 700;
}

.buy .btn-primary {
  align-self: flex-start;
}

/* pills: radio groups styled without JS */
.pills {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.pills legend {
  float: left;          /* keeps legend inline with the pills */
  width: 100%;
  padding: 0;
  margin-bottom: .5rem;
  color: var(--muted);
}

.pills input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 1rem;
  border: 1px solid var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.pill:hover {
  border-color: var(--fg);
}

.pills input:checked + .pill {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

.pills input:focus-visible + .pill {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

@media (max-width: 40em) {
  .content .product-single {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-single .art-large {
    max-width: 18rem;
    margin: 0 auto;
  }
}

/* ---------- checkout (kasse) ---------- */

.content .checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 3rem;
  align-items: start;
  max-width: 56rem;
  text-align: left;
}

.summary {
  border: 1px solid var(--fg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.summary h2 {
  margin-bottom: .25rem;
}

.summary .line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.summary .total {
  border-top: 1px solid var(--fg);
  padding-top: .75rem;
  margin-top: .25rem;
}

.summary .price {
  font-weight: 700;
  white-space: nowrap;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.checkout-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.checkout-form legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: .75rem;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
}

.fields label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.fields label span {
  color: var(--muted);
  font-size: .875rem;
}

.fields .full {
  grid-column: 1 / -1;
}

.fields input {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--muted);
  padding: .5rem 0;
  min-height: var(--tap);
  border-radius: 0;
}

.fields input:disabled {
  color: var(--muted);
  opacity: 1;
}

.fields input::placeholder {
  color: var(--muted);
  opacity: .6;
  text-transform: lowercase;
}

.pay .option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--muted);
  cursor: pointer;
  min-height: var(--tap);
}

.pay .option:has(input:checked) {
  border-color: var(--fg);
}

.pay .option input {
  accent-color: var(--fg);
  width: 18px;
  height: 18px;
  margin: .2rem 0 0;
  flex: none;
}

.pay .option span {
  display: flex;
  flex-direction: column;
  gap: .125rem;
}

.pay .option small {
  font-size: .875rem;
}

.checkout .btn-primary {
  align-self: flex-start;
}

@media (max-width: 40em) {
  .content .checkout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .fields {
    grid-template-columns: 1fr;
  }
}
