/* Readymag artboard unit: the original scales a 1024px artboard to the viewport width. */
:root {
  --u: calc(100vw / 1024);
  --slate: #1e4d72;
  --sage: #dfe6e0;
  --stone-dot: #7b6b5d;
}

/* Topbar: sage instead of blue mist; on desktop no full-width frosted band at all
   (it smears the portrait and tints the sage band blue). */
.topbar {
  background: linear-gradient(
    180deg,
    rgba(223, 230, 224, 0.9) 0%,
    rgba(223, 230, 224, 0.6) 60%,
    rgba(223, 230, 224, 0) 100%
  );
}

@media (min-width: 900px) {
  .topbar {
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Brand stays Montserrat body weight — 700 made the top look like a different face. */
.brand {
  font-weight: 400;
}

/* —— endlich icons: live shapes instead of flat PNGs —— */
.icon {
  position: relative;
  display: block;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  --k: 0.0625rem; /* 1 artboard px inside the icon */
}

.icon i,
.icon b {
  position: absolute;
  box-sizing: border-box;
}

.icon i {
  border: 1px solid var(--slate);
}

.icon i:nth-child(1) {
  inset: 0;
  border-radius: calc(16 * var(--k));
}

.icon i:nth-child(2) {
  inset: calc(2 * var(--k));
  border-radius: calc(14 * var(--k));
}

.icon i:nth-child(3) {
  inset: calc(4 * var(--k));
  border-radius: calc(12 * var(--k));
}

.icon i:nth-child(4) {
  inset: calc(6 * var(--k));
  border-radius: calc(10 * var(--k));
}

.icon--bewusstsein i:nth-child(2) {
  animation: icon-spin-ccw 1.6s ease-in-out infinite;
}

.icon--bewusstsein i:nth-child(4) {
  animation: icon-spin-cw 1.6s ease-in-out infinite;
}

.icon--aufloesung i:nth-child(n) {
  border-radius: 50%;
}

.icon--aufloesung i:nth-child(2) {
  animation: icon-breathe 1.6s ease-in-out infinite alternate;
}

.icon--aufloesung b {
  left: calc(16 * var(--k));
  top: calc(28 * var(--k));
  width: calc(16 * var(--k));
  height: calc(16 * var(--k));
  border: 1px solid var(--slate);
  border-radius: 50%;
  animation: icon-bubble 3.2s ease-in-out infinite;
}

.icon--energie b {
  left: calc(20 * var(--k));
  top: calc(36 * var(--k));
  width: calc(8 * var(--k));
  height: calc(8 * var(--k));
  border-radius: 50%;
  background: var(--slate);
  animation: icon-orbit 3.2s linear infinite;
}

@keyframes icon-spin-ccw {
  to {
    transform: rotate(-180deg);
  }
}

@keyframes icon-spin-cw {
  to {
    transform: rotate(180deg);
  }
}

@keyframes icon-breathe {
  from {
    transform: scale(0.92);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes icon-bubble {
  from {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateY(calc(-43 * var(--k))) scale(1);
  }
}

@keyframes icon-orbit {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(calc(-15 * var(--k)), calc(-15 * var(--k)));
  }
  50% {
    transform: translate(0, calc(-31 * var(--k)));
  }
  75% {
    transform: translate(calc(15 * var(--k)), calc(-15 * var(--k)));
  }
}

/* —— Ergebnis: pulse ring on the stone dots (live markup: .stone > i) —— */
.stone i {
  background: var(--stone-dot);
  box-shadow: none;
}

.stone i::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--stone-dot);
  border-radius: 50%;
  animation: dot-pulse 2.5s ease-out infinite;
}

@keyframes dot-pulse {
  0%,
  40% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 0.4;
    transform: scale(1.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* —— Moon: original vector, rise-in + swing, hover grows —— */
.closing__moon {
  border-radius: 0;
  filter: none;
  opacity: 0;
  animation: none;
  transition: scale 0.5s ease-in-out;
}

.closing__moon.is-visible {
  animation:
    moon-rise 1.6s ease-in-out both,
    moon-swing 2.4s ease-in-out 1.6s infinite alternate;
}

/* Hover-grow and drag only where there is a mouse; a finger must still be able to scroll past. */
@media (hover: hover) and (pointer: fine) {
  .closing__moon {
    cursor: grab;
  }

  .closing__moon:hover {
    scale: 1.5;
  }

  .closing__moon.is-dragging {
    cursor: grabbing;
    scale: 1;
  }
}

@keyframes moon-rise {
  from {
    opacity: 0;
    transform: translateY(5rem) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes moon-swing {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 1;
    transform: translateY(-4px) rotate(3deg) scale(1.06);
  }
}

/* Closing copy readable; Contact box size comes from shared --cta-* in site.css */
.about__cta {
  color: var(--ink);
  text-shadow: none;
}

.closing__legal a {
  text-shadow: none;
}

/* —— Desktop: lock geometry to the Readymag artboard —— */
@media (min-width: 900px) {
  /* No --u size overrides: pillars stay --size-pillar; section displays --size-display. */
  .hero__unlock,
  .section-heading,
  .about__name {
    font-size: var(--size-display);
    font-weight: var(--weight-display);
    letter-spacing: var(--track-caps);
    line-height: 1.35;
  }

  .pillar h3 {
    font-size: var(--size-pillar);
    font-weight: var(--weight-display);
    letter-spacing: var(--track-caps);
    line-height: 1.35;
  }

  .sage-band {
    /* Even chapter pad + extra gap before DAS ERGEBNIS */
    padding: var(--chapter-pad) calc(20 * var(--u));
    padding-bottom: calc(var(--chapter-pad) + var(--chapter-gap-podcast-ergebnis));
    background: var(--sage);
  }

  .pillars {
    width: calc(896 * var(--u));
    grid-template-columns: repeat(3, calc(288 * var(--u)));
    gap: 0 calc(16 * var(--u));
  }

  .pillar {
    max-width: none;
  }

  .icon {
    --k: var(--u);
    width: calc(48 * var(--u));
    height: calc(48 * var(--u));
    margin-bottom: calc(12.5 * var(--u));
  }

  .pillar__endlich {
    margin: 0 0 calc(17.5 * var(--u));
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.34;
  }

  .pillar h3 {
    margin: 0 0 calc(18 * var(--u));
    padding-left: calc(10 * var(--u));
  }

  .pillar p:not(.pillar__endlich) {
    max-width: calc(216 * var(--u));
    margin: 0 auto;
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.34;
  }

  .podcasts {
    width: calc(446 * var(--u));
    margin: var(--podcast-flank) auto 0;
    text-align: center;
  }

  .podcasts__show {
    margin: calc(28 * var(--u)) 0 calc(10 * var(--u));
  }

  .podcasts__episode {
    margin: 0 auto calc(18 * var(--u));
    max-width: calc(420 * var(--u));
    font-size: max(15px, calc(14 * var(--u)));
  }

  .podcasts__intro {
    max-width: calc(345 * var(--u));
    margin-left: auto;
    margin-right: auto;
    margin-bottom: calc(30 * var(--u));
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.34;
  }

  .spotify-embed {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0 auto;
  }

  .spotify-gate,
  .spotify-frame {
    width: min(100%, 26.25rem);
    margin-left: auto;
    margin-right: auto;
  }

  /* Ergebnis: chapter-pad on the band; abs artboard kids use __inner as CB
     so padding actually insets the composition (not just empty bottom space). */
  .results-band {
    height: auto;
    min-height: 0;
    padding: var(--chapter-pad) 0;
    background: var(--sage);
    box-sizing: content-box;
  }

  /* Pin texture to the padded content box so photo stones match HTML dots */
  .results-band__media {
    inset: auto;
    top: var(--chapter-pad);
    right: 0;
    bottom: var(--chapter-pad);
    left: 0;
    background: url("accent-texture.jpg") calc(-65 * var(--u))
      calc(54 * var(--u)) / calc(1206.7 * var(--u)) auto no-repeat;
  }

  .results-band__inner {
    position: relative;
    width: auto;
    min-height: calc(747 * var(--u));
  }

  .results-band .section-heading {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    margin: 0;
    line-height: 1.35; /* match shared display — not 70artboard px */
  }

  .results-band .section-heading span {
    display: block;
  }

  .results-stage {
    position: static;
    width: auto;
    min-height: 0;
  }

  .result {
    right: auto;
    bottom: auto;
    text-align: center;
  }

  .result h3 {
    margin: 0 0 calc(10 * var(--u));
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.34;
  }

  .result p {
    margin-inline: auto;
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.34;
  }

  .result--wissen p {
    max-width: calc(126 * var(--u));
  }

  .result--freude p {
    max-width: calc(142 * var(--u));
  }

  .result--weiter p {
    max-width: calc(186 * var(--u));
  }

  .result--sinn p {
    max-width: calc(130 * var(--u));
  }

  .result--wissen {
    left: calc(238 * var(--u));
    top: calc(197 * var(--u));
    width: calc(205 * var(--u));
  }

  .result--freude {
    left: calc(522 * var(--u));
    top: calc(200 * var(--u));
    width: calc(205 * var(--u));
  }

  .result--weiter {
    left: calc(210 * var(--u));
    top: calc(343 * var(--u));
    width: calc(259 * var(--u));
  }

  .result--weiter h3 {
    width: calc(135 * var(--u));
    margin-inline: auto;
  }

  .result--sinn {
    left: calc(540 * var(--u));
    top: calc(394 * var(--u));
    width: calc(205 * var(--u));
  }

  /* The original photo already contains the four stones: the CSS pebbles become dot anchors only. */
  .results-spine {
    display: contents;
  }

  .stone {
    position: absolute;
    width: calc(8 * var(--u));
    height: calc(8 * var(--u));
    margin: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
  }

  .stone i {
    inset: 0;
    width: auto;
    height: auto;
  }

  .stone--1 {
    left: calc(544 * var(--u));
    top: calc(188 * var(--u));
  }

  .stone--2 {
    left: calc(430 * var(--u));
    top: calc(230 * var(--u));
  }

  .stone--3 {
    left: calc(602 * var(--u));
    top: calc(376 * var(--u));
  }

  .stone--4 {
    left: calc(453 * var(--u));
    top: calc(464 * var(--u));
  }

  /* About + closing: inset mountain panel, 647 artboard px tall */
  .about-closing {
    z-index: 2;
    min-height: 0;
    /* Match chapter pad above; keep bottom for legal on ridge */
    padding: var(--chapter-pad) calc(20 * var(--u)) calc(19 * var(--u));
    overflow: visible;
    background: var(--sage);
  }

  .about-closing__media {
    inset: 0 calc(20 * var(--u)) calc(19 * var(--u));
    background: var(--sage) url("closing-mountains.jpg") center bottom / 100%
      auto no-repeat;
  }

  .about-closing__inner {
    width: 100%;
    min-height: calc(647 * var(--u));
    padding: calc(42 * var(--u)) 0 calc(119 * var(--u));
  }

  .about__photo {
    position: absolute;
    left: 50%;
    top: calc(-162 * var(--u));
    width: calc(182 * var(--u));
    height: calc(182 * var(--u));
    margin: 0 0 0 calc(-91 * var(--u));
    box-shadow: none;
  }

  .about__name {
    margin: 0;
  }

  .about__bio {
    width: max-content; /* seven hard-broken lines, also where the 13px floor applies */
    max-width: 100%;
    margin: calc(13 * var(--u)) 0 0;
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.834;
  }

  .about__cta {
    margin: calc(43 * var(--u)) 0 0;
    font-size: max(13px, calc(12 * var(--u)));
    line-height: 1.834;
  }

  .about-closing .btn-contact {
    /* Keep shared --cta-* box; only spacing from artboard */
    margin-top: calc(13 * var(--u));
    width: auto;
    min-width: var(--cta-min-width);
    height: var(--cta-height);
    padding: 0 var(--cta-pad-x);
    font-size: var(--cta-font);
  }

  .closing__moon {
    width: calc(102.5 * var(--u));
    margin: calc(32 * var(--u)) 0 0;
  }

  @keyframes moon-rise {
    from {
      opacity: 0;
      transform: translateY(calc(80 * var(--u))) rotate(-10deg);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes moon-swing {
    from {
      opacity: 1;
      transform: none;
    }
    to {
      opacity: 1;
      transform: translateY(calc(-4 * var(--u))) rotate(3deg) scale(1.06);
    }
  }

  .closing__legal {
    left: calc(74 * var(--u));
    right: auto;
    bottom: calc(45 * var(--u));
    gap: 0 calc(20 * var(--u));
    max-width: none;
    font-size: max(11px, calc(7 * var(--u)));
    line-height: 2.14;
    letter-spacing: 0;
  }

  .closing__legal-col {
    gap: 0;
  }

  .closing__legal a {
    color: rgba(223, 230, 224, 0.72);
  }
}

.br-d {
  display: none;
}

@media (min-width: 900px) {
  .br-d {
    display: inline;
  }
}

/* —— Phone: same composition as desktop, photo anchored to the section bottom —— */
@media (max-width: 520px) {
  /* 1fr auto 1fr squeezes the brand into four lines on a phone */
  .topbar__inner {
    grid-template-columns: auto 1fr;
  }

  .brand {
    white-space: nowrap;
  }

  .topbar .btn-contact {
    justify-self: end;
  }
}

@media (max-width: 899px) {
  .about-closing {
    min-height: 0;
    padding-bottom: 8rem;
    background: var(--sage);
  }

  .about-closing__media {
    background: var(--sage) url("closing-mountains.jpg") center bottom / auto
      54rem no-repeat;
  }

  .about__bio {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .about__cta {
    font-size: 1rem;
  }

  .closing__moon {
    width: 7rem;
    margin: 2.4rem 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon i,
  .icon b,
  .stone i::after,
  .closing__moon,
  .closing__moon.is-visible {
    animation: none;
    opacity: 1;
  }
}
