/* ============================================
   DESIGN TOKENS
============================================ */
:root {
  --cream:      #F6F1E9;
  --off-white:  #FDFAF5;
  --ink:        #1E1B18;
  --brown:      #6B4F35;
  --terracotta: #C9614A;
  --sage:       #7B9E80;
  --sand:       #D5BA98;
  --muted:      #8C8478;
  --sage-bg:    #EDF3EE;
  --sand-bg:    #F8F1E5;

  --font-display: 'Lora', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --max-w: 700px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  cursor: none;
}

/* ============================================
   CURSOR
============================================ */
#cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--terracotta);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  transition: width .2s, height .2s, opacity .2s;
}
#cursor.hover { width: 36px; height: 36px; opacity: .35; }

/* ============================================
   PROGRESS BAR
============================================ */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--terracotta);
  z-index: 200;
  transform-origin: left;
}

/* ============================================
   CHAPTER DOTS
============================================ */
#chapter-nav {
  position: fixed;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 100;
}
.cdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sand);
  border: 1.5px solid var(--brown);
  cursor: pointer;
  transition: background .3s, transform .3s;
}
.cdot.active { background: var(--terracotta); transform: scale(1.5); }

/* ============================================
   TYPOGRAPHY
============================================ */
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem,7vw,5rem); line-height: 1.15; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem,3.5vw,2.5rem); line-height: 1.25; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.35; }
p  { font-size: clamp(.9rem,1.4vw,1rem); max-width: 52ch; }
em { font-family: var(--font-display); font-style: italic; color: var(--terracotta); }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.chapter-label {
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: flex; align-items: center; gap: 8px;
}
.chapter-label::before {
  content: '';
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--terracotta);
}
.divider { width: 36px; height: 2px; background: var(--terracotta); flex-shrink: 0; }

.mt-xs { margin-top: .5rem; }
.mt-sm { margin-top: .75rem; }
.mt-md { margin-top: 1.5rem; }

/* ============================================
   ILLUSTRATION PLACEHOLDERS
============================================ */
.illo {
  display: block;
  background: var(--off-white);
  border: 1.5px dashed var(--sand);
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
}
.illo::after {
  content: attr(data-label);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase;
  text-align: center; padding: 8px;
  pointer-events: none;
}

/* ============================================
   SCENE HELPERS
============================================ */
.pin-scene { position: relative; }
.pin-scene > .sticky {
  position: sticky; top: 0;
  height: 100vh; overflow: hidden;
}
.scroll-scene {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem;
}
.col-center {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  gap: 1.5rem; max-width: var(--max-w); width: 100%;
}
.col-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: center;
  max-width: 960px; width: 100%;
}
@media (max-width: 680px) { .col-split { grid-template-columns: 1fr; } }

/* ============================================
   PANEL SYSTEM
============================================ */
.panel-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.panel {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; opacity: 0; pointer-events: none;
}
.panel.is-active { opacity: 1; pointer-events: auto; }

/* ============================================
   BONE INFO COMPONENT
   Echtes PNG als Hintergrund, Text darüber
============================================ */
.bone-info {
  position: absolute;
  right: -520px;        /* startet ausserhalb rechts */
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: min(460px, 80vw);
  /* Kein fixer height – passt sich dem Inhalt an */
}

/* Das Knochen-Bild */
.bone-img {
  display: block;
  width: 100%;
  height: auto;
  /* Bild wird zum Hintergrund – Text liegt absolut darüber */
}

/* Text-Container, zentriert über dem Knochen */
.bone-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 3rem;   /* links/rechts gross genug für die runden Enden */
  text-align: center;
  gap: .4rem;
}

.bone-text strong {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: .3rem;
}

.bone-text p {
  font-size: .78rem;
  color: var(--brown);
  line-height: 1.5;
  max-width: 28ch;
}

/* ============================================
   S1 · HERO – SPRITE ANIMATION
   Sprite: 1272 x 700px total, 6 Frames à 212px
============================================ */
#s1-texts {
  position: absolute;
  top: 12vh; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  gap: 1rem; padding: 0 2rem;
  z-index: 10; pointer-events: none;
}
#s1-t1, #s1-t2, #s1-t3 { opacity: 0; }
.s1-subtitle { color: var(--muted); }

#dog-reveal-wrap {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 212px;
  overflow: hidden;
}

#dog-sprite {
  position: absolute;
  bottom: 0; left: 0;
  width: 212px;
  height: 700px;
  background-image: url('../assets/images/dog-sprite.png');
  background-repeat: no-repeat;
  background-size: 1272px 700px;
  background-position: 0 0;
  animation: dogLoop 1.2s steps(1) infinite;
}

@keyframes dogLoop {
  0%   { background-position:    0px 0; }
  17%  { background-position: -212px 0; }
  33%  { background-position: -424px 0; }
  50%  { background-position: -636px 0; }
  67%  { background-position: -848px 0; }
  83%  { background-position: -1060px 0; }
  100% { background-position:    0px 0; }
}

/* ============================================
   S2 · ADOPTION PROCESS
============================================ */
#dog-peek {
  position: absolute;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  width: min(180px, 32vw);
  z-index: 20; pointer-events: none;
}

.s2-arrival-note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--brown);
  max-width: 32ch;
}

/* ============================================
   S3 · ERSTE WOCHEN SEQUENZ
============================================ */
.seq-panel {
  display: flex; flex-direction: column;
  gap: 1.5rem; align-items: center;
  max-width: 780px; width: 100%;
}
.seq-row { display: flex; gap: 2rem; align-items: center; width: 100%; }
.seq-illo { width: min(240px, 38vw); aspect-ratio: 4/3; }
.seq-text { flex: 1; }
.seq-text h3 { margin-bottom: .3rem; }
.face-illo { width: min(90px, 16vw); aspect-ratio: 1; flex-shrink: 0; }

/* ============================================
   S4 · GEFÜHLE
============================================ */
.feeling-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 1rem; width: 100%; max-width: 460px;
}
.feeling-card {
  background: var(--cream);
  border: 1px solid var(--sand);
  padding: .8rem 1.2rem;
  border-radius: 2px;
  transition: opacity .4s;
}
.feeling-card .label {
  font-family: var(--font-display);
  font-style: italic; font-size: 1.05rem; color: var(--brown);
}
.s4-note { font-size: .85rem; color: var(--muted); }

.perspective-card {
  background: var(--sage-bg);
  border: 1.5px solid var(--sage);
  border-radius: 4px;
  padding: 2rem 2.4rem;
  max-width: 560px; width: 100%;
  display: flex; gap: 2rem; align-items: center;
}
.perspective-text { flex: 1; }
.perspective-text h3 { color: var(--brown); margin-bottom: .5rem; }
.perspective-text p  { font-size: .9rem; color: var(--muted); max-width: 38ch; }
.perspective-illo { width: min(140px,26vw); aspect-ratio: 1; }

#trainerin-wrap {
  position: absolute;
  bottom: -100%; left: 50%;
  transform: translateX(-50%);
  z-index: 5; pointer-events: none;
}
#trainerin-wrap .illo { width: min(200px,36vw); aspect-ratio: 2/3; }
.s4-trainer-note { font-size: .88rem; color: var(--muted); }

/* ============================================
   S5 · TRAINING SEQUENZ
============================================ */
.training-panel { display: flex; gap: 2rem; align-items: center; max-width: 800px; width: 100%; }
.training-num { font-family: var(--font-display); font-size: 4.5rem; color: var(--sand); line-height: 1; flex-shrink: 0; width: 64px; }
.training-num-big { font-family: var(--font-display); font-size: 3.5rem; color: var(--terracotta); line-height: 1; }
.s5-sweet { font-size: clamp(1.8rem,4vw,3rem); max-width: 18ch; }
.s5-setback { font-family: var(--font-display); font-style: italic; color: var(--terracotta); }

/* ============================================
   S6 · BOND
============================================ */
.s6-final { font-size: clamp(2rem,5vw,3.5rem); }

/* ============================================
   S7 · OUTRO / DARK
============================================ */
#s7 { background: var(--ink); color: var(--cream); min-height: 100vh; }
#s7 p                      { color: var(--sand); }
#s7 h2                     { color: var(--off-white); }
#s7 .divider               { background: var(--terracotta); }
#s7 .chapter-label         { color: var(--sand); }
#s7 .chapter-label::before { background: var(--sand); }

/* Bone links in S7: echter Knochen als Hintergrund */
#bones-links {
  display: flex; flex-direction: column;
  gap: 1.2rem; width: 100%; max-width: 420px;
  margin-top: 1rem;
}

.bone-link {
  display: flex;
  align-items: center; justify-content: center;
  position: relative;
  text-decoration: none;
  opacity: 0;
  transform: translateY(28px);
  transition: transform .2s ease;
}

.bone-link:hover { transform: translateY(-3px) scale(1.02); opacity: 1 !important; }

.bone-link-img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.96);
  transition: filter .2s;
}

.bone-link:hover .bone-link-img { filter: brightness(0.9); }

.bone-link span {
  position: absolute;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  color: var(--brown);
  text-align: center;
  pointer-events: none;
  padding: 0 3rem;
}

/* Credits */
.credits {
  margin-top: 4rem; text-align: center;
  border-top: 1px solid #2e2b28;
  padding-top: 2.5rem;
  width: 100%; max-width: 500px;
}
.credits-label { font-size: .78rem; letter-spacing: .15em; text-transform: uppercase; color: #5a5550; }
.credits-name  { font-family: var(--font-display); color: var(--off-white); margin-top: .5rem; font-size: 1.3rem; }
.credits-info  { font-size: .85rem; color: var(--muted); margin-top: .4rem; }

/* Zoomies */
#zoomies-wrap {
  position: relative; width: 100%; height: 110px;
  overflow: hidden; margin-top: 2rem;
}
#zoomies-dog {
  position: absolute; bottom: 0; left: -20%;
  width: min(130px,26vw); aspect-ratio: 1.5;
}

/* ============================================
   GRAIN TEXTURE OVERLAY
============================================ */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .022; pointer-events: none; z-index: 9990;
}
