/* Heiftenua Musi — site-wide styles built on tokens.css */

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

/* ---- Paper grain (toggleable) ---- */
body[data-grain="on"]::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0 0.07  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* ---- Headline mode toggle (serif vs sans) ---- */
body[data-headlines="sans"] .h-serif,
body[data-headlines="sans"] h1,
body[data-headlines="sans"] h2,
body[data-headlines="sans"] h3,
body[data-headlines="sans"] h4,
body[data-headlines="sans"] h5,
body[data-headlines="sans"] h6 {
  font-family: var(--font-sans) !important;
  letter-spacing: -0.01em;
}

/* ---- Dark mode ---- */
body[data-theme="dark"] {
  --bg-page: #1a1612;
  --bg-surface: #221d18;
  --bg-surface-strong: #2a241e;
  --bg-surface-alt: #2a241e;
  --fg-primary: #f3ece1;
  --fg-secondary: #c9bfae;
  --fg-tertiary: #978d7c;
  --fg-emphasis: #ddd2c1;
  --border-default: #332c25;
  --border-strong: #3d362e;
  --c-ivory: #221d18;
  --c-warm-sand: #2a241e;
  --c-border-cream: #332c25;
  --c-border-warm: #3d362e;
  --c-ring-warm: #4a4137;
  --c-ring-deep: #5a4f43;
  --c-ring-subtle: #3d362e;
  --c-charcoal-warm: #d8cdb9;
  --c-near-black: #0d0a08;
  --c-dark-surface: #100c09;
  background: var(--bg-page);
  color: var(--fg-primary);
}
body[data-theme="dark"] .nav-shell {
  background: rgba(26,22,18,0.85) !important;
}
body[data-theme="dark"] .brand-logo { display: none !important; }
body[data-theme="dark"] .hero-chip { background: rgba(34,29,24,0.92) !important; }

/* ---- Image slots (drop real photos here) ---- */
image-slot { display: block; width: 100%; height: 100%; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 32px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  border: none; border-radius: 12px; padding: 12px 20px;
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn-primary {
  background: var(--c-brand); color: var(--c-ivory);
  box-shadow: 0 0 0 1px var(--c-brand);
}
.btn-primary:hover { background: var(--c-brand-hover); box-shadow: 0 0 0 1px var(--c-brand-hover); }
.btn-secondary {
  background: var(--c-warm-sand); color: var(--c-charcoal-warm);
  box-shadow: 0 0 0 1px var(--c-ring-warm);
}
.btn-secondary:hover { box-shadow: 0 0 0 1px var(--c-ring-deep); }
.btn-ghost {
  background: transparent; color: var(--fg-primary);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.btn-ghost:hover { background: var(--c-warm-sand); }

/* ---- Overline label ---- */
.overline {
  font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--fg-tertiary); font-weight: 500;
}

/* ---- Section spacing ---- */
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }

/* ---- Page head (subpage hero) ---- */
.page-head { padding: 88px 0 56px; border-bottom: 1px solid var(--border-default); }
.page-head h1 {
  font-size: clamp(40px, 5vw, 64px); letter-spacing: -0.5px; line-height: 1.05;
  margin-top: 14px; max-width: 800px;
}
.page-head .lede {
  font-size: 19px; line-height: 1.55; color: var(--fg-secondary);
  max-width: 620px; margin-top: 24px;
}
.page-head .lede em { color: var(--c-brand); font-style: italic; }

/* ---- Card ---- */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: 16px; padding: 28px;
}

/* ---- Inputs ---- */
.field {
  font-family: var(--font-sans); font-size: 15px; color: var(--fg-primary);
  background: var(--bg-surface); border: 1px solid var(--c-border-warm);
  border-radius: 12px; padding: 12px 14px; outline: none; width: 100%;
}
.field:focus { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
.field-label {
  font-size: 12px; color: var(--fg-secondary); font-weight: 500; letter-spacing: 0.12px;
  margin-bottom: 6px; display: block;
}

/* ---- Links ---- */
a.link { color: var(--c-brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---- Decorative divider ---- */
.divider {
  height: 24px; opacity: 0.65;
  background-image: url('../assets/folk-divider.svg');
  background-repeat: no-repeat; background-size: 100% 100%; background-position: center;
}

/* ---- Sound divider: Linie zeichnet sich, Rauten erscheinen, dann pulsiert dauerhaft eine Frequenz um die Linie ---- */
.sound-divider { position: relative; height: 28px; }
.sd-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--c-brand); opacity: 0.7; transform: scaleX(0); }
.sd-eq { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 2px; opacity: 0; }
.sd-eq span { width: 2px; height: 100%; background: var(--c-brand); border-radius: 2px; opacity: 0.85; transform: scaleY(0.06); transform-origin: center; }
.sd-marks { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-around; padding: 0 3%; }
.sd-marks i { width: 9px; height: 9px; transform: rotate(45deg) scale(0); background: var(--c-brand); box-shadow: 0 0 0 3px var(--bg-page); }
.sd-marks i:nth-child(even) { background: var(--bg-page); box-shadow: 0 0 0 3px var(--bg-page), inset 0 0 0 1.25px var(--c-brand); }
.sound-divider.in .sd-line { animation: sd-line 900ms var(--ease) forwards; }
.sound-divider.in .sd-marks i { animation: sd-mark 500ms var(--ease) forwards; animation-delay: calc(500ms + var(--i, 0) * 60ms); }
.sound-divider.in .sd-eq { animation: sd-fade 900ms 900ms var(--ease) forwards; }
.sound-divider.in .sd-eq span { animation: sd-eq var(--dur, 900ms) var(--delay, 0ms) ease-in-out infinite alternate; }
@keyframes sd-line { to { transform: scaleX(1); } }
@keyframes sd-mark { to { transform: rotate(45deg) scale(1); } }
@keyframes sd-fade { to { opacity: 1; } }
@keyframes sd-eq { 0% { transform: scaleY(0.06); } 50% { transform: scaleY(calc(var(--peak, 0.8) * 0.45)); } 100% { transform: scaleY(var(--peak, 0.8)); } }
body[data-motion="off"] .sd-line, body[data-motion="off"] .sd-marks i { animation: none; }
body[data-motion="off"] .sd-line { transform: none; }
body[data-motion="off"] .sd-marks i { transform: rotate(45deg); }
body[data-motion="off"] .sd-eq { display: none; }
@media (prefers-reduced-motion: reduce) { .sd-line, .sd-marks i { animation: none !important; } .sd-line { transform: none; } .sd-marks i { transform: rotate(45deg); } .sd-eq { display: none; } }

/* ---- Audio player ---- */
.audio-row {
  display: grid; grid-template-columns: 56px 1fr auto;
  gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--border-default); background: var(--bg-surface);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.audio-row:hover { box-shadow: 0 0 0 1px var(--c-ring-warm); }
.audio-row + .audio-row { margin-top: 10px; }
.audio-play {
  width: 44px; height: 44px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--c-brand); color: var(--c-ivory);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px var(--c-brand);
}
.audio-play:hover { background: var(--c-brand-hover); }

/* ---- Subtle scrollbar (calendar etc) ---- */
.subtle-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.subtle-scroll::-webkit-scrollbar-thumb { background: var(--c-ring-warm); border-radius: 4px; }

/* ---- Reveal-on-scroll ---- */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---- Motion (schaltbar über Tweak „Animationen“) ---- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 200ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 320ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--c-brand); z-index: 60; pointer-events: none; }
header.nav-shell > div { transition: height 260ms var(--ease); }
header.nav-shell .brand-logo { transition: width 260ms var(--ease), height 260ms var(--ease); }
body.scrolled header.nav-shell > div { height: 58px !important; }
body.scrolled header.nav-shell .brand-logo { width: 40px !important; height: 40px !important; }
.marquee { overflow: hidden; white-space: nowrap; border-top: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default); padding: 14px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; animation: marquee 48s linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { font-family: var(--font-serif); font-size: 18px; color: var(--fg-secondary); padding: 0 26px; display: inline-flex; align-items: center; gap: 26px; }
.marquee-item i { font-style: normal; color: var(--c-brand); font-size: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.w > span { display: inline-block; transform: translateY(110%); animation: word-up 800ms var(--ease) forwards; }
@keyframes word-up { to { transform: none; } }
.hover-lift { transition: transform 260ms var(--ease), box-shadow 260ms var(--ease), opacity 400ms var(--ease); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(0,0,0,0.08); }
.tilt { transform-style: preserve-3d; will-change: transform; transition: transform 180ms ease-out, opacity 400ms var(--ease); }
.sticky-cta { display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 55; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
@media (max-width: 820px) { .sticky-cta { display: block; } body:has(.sticky-cta) { padding-bottom: 72px; } }
body[data-motion="off"] .reveal, body[data-motion="off"] .w > span { opacity: 1; transform: none; transition: none; animation: none; }
body[data-motion="off"] .marquee-track { animation: none; }
body[data-motion="off"] .scroll-progress { display: none; }
body[data-motion="off"] header.nav-shell > div, body[data-motion="off"] .brand-logo, body[data-motion="off"] .hover-lift, body[data-motion="off"] .tilt { transition: none; }
body[data-motion="off"] .hover-lift:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .w > span { transform: none; animation: none; }
  .marquee-track { animation: none; }
  .hover-lift, .tilt, header.nav-shell > div, .brand-logo { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---- Focus rings (keyboard) ---- */
a:focus-visible, button:focus-visible, .field:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

/* ---- Mobile ---- */
@media (max-width: 820px) {
  .container, .container-narrow { padding: 0 20px; }
  .section { padding: 64px 0; }
  .page-head { padding: 56px 0 40px; }
  .hide-on-mobile { display: none !important; }
}
