/* =============================================================
   StudyNect — Site Stylesheet
   Nav · Hero · Chapters · Pinwall · Footer
   ============================================================= */

/* ---------------- Navigation ---------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition:
    background var(--t-med) var(--ease-out),
    border-color var(--t-med) var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--ink-hairline);
}
.nav__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: opacity var(--t-fast) var(--ease-out);
}
.nav__brand:hover {
  opacity: 0.7;
}
.nav__brand svg,
.nav__brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav__link {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  padding: 0.5em 0;
  position: relative;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3em;
  height: 2px;
  background: var(--pink);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-med) var(--ease-out);
}
.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}
.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Language toggle pill — HIDDEN by design.
   Site auto-detects language from navigator.languages on every visit.
   Keeping the markup so the i18n JS still has a hook (no DOM changes needed),
   but the pill never renders. */
.lang-toggle { display: none !important; }
.lang-toggle.is-actually-shown {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--ink-hairline-strong);
  border-radius: 999px;
  padding: 3px;
  position: relative;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.lang-toggle button {
  padding: 0.35em 0.8em;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: color var(--t-med) var(--ease-out);
  position: relative;
  z-index: 2;
}
.lang-toggle button.is-active {
  color: #fff;
}
.lang-toggle__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--ink);
  border-radius: 999px;
  transition: transform var(--t-med) var(--ease-out);
  z-index: 1;
}
.lang-toggle[data-lang="en"] .lang-toggle__thumb {
  transform: translateX(100%);
}

/* Mobile nav hamburger */
.nav__toggle {
  display: none;
  width: 38px;
  height: 38px;
  position: relative;
  border-radius: 999px;
  border: 1px solid var(--ink-hairline-strong);
}
.nav__toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--t-med) var(--ease-out), top var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out);
}
.nav__toggle span:nth-child(1) {
  top: 14px;
}
.nav__toggle span:nth-child(2) {
  top: 22px;
}
.nav.is-open .nav__toggle span:nth-child(1) {
  top: 18px;
  transform: rotate(45deg);
}
.nav.is-open .nav__toggle span:nth-child(2) {
  top: 18px;
  transform: rotate(-45deg);
}

@media (max-width: 880px) {
  /* On mobile Safari, backdrop-filter + scroll causes a visible horizontal
     seam at the bottom of the nav (sub-pixel rounding). Drop the blur and
     use a solid background — looks identical at this size. */
  .nav {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav.is-scrolled {
    background: #ffffff;
  }
  .nav__toggle {
    display: inline-flex;
  }
  /* Use viewport-relative units (vw/dvh) instead of inset because the parent
     .nav (when blur is on) becomes a containing block for fixed descendants
     and inset:nav-h 0 0 0 would resolve top+bottom against the tiny nav box
     and collapse height to 0. Keeping vw/dvh is also safe for Safari. */
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    z-index: 90;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-5) var(--gutter) var(--space-7);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-4%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform var(--t-med) var(--ease-out),
      opacity var(--t-med) var(--ease-out);
  }
  .nav.is-open .nav__links {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link {
    width: 100%;
    padding: 0.9em 0;
    font-size: var(--step-2);
    font-weight: 500;
    border-bottom: 1px solid var(--ink-hairline);
  }
  .nav__right {
    gap: var(--space-2);
  }
  .nav__right .btn {
    padding: 0.7em 1em;
    font-size: 0.85rem;
  }
}

/* ---------------- Hero — Orbit of four ---------------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: calc(var(--nav-h) + var(--space-5));
  padding-bottom: var(--space-8);
  overflow: hidden;
  isolation: isolate;
}

/* Colored glow washes that drift behind the orbit */
.hero__glows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.9;
}
.hero__glow {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  mix-blend-mode: multiply;
  animation: driftA 24s ease-in-out infinite alternate;
}
.hero__glow--pink {
  background: var(--pink-glow);
  top: -10%;
  left: 55%;
}
.hero__glow--blue {
  background: var(--blue-glow);
  top: 30%;
  left: -12%;
  animation-name: driftB;
  animation-duration: 30s;
}
.hero__glow--orange {
  background: var(--orange-glow);
  top: 55%;
  left: 60%;
  animation-name: driftC;
  animation-duration: 28s;
}
.hero__glow--green {
  background: var(--green-glow);
  top: 5%;
  left: 10%;
  animation-name: driftD;
  animation-duration: 34s;
}
@keyframes driftA {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-8%, 6%) scale(1.15);
  }
}
@keyframes driftB {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10%, -4%) scale(1.1);
  }
}
@keyframes driftC {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-6%, -10%) scale(1.2);
  }
}
@keyframes driftD {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(8%, 8%) scale(1.1);
  }
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: var(--space-5);
  align-items: center;
  min-height: calc(100vh - var(--nav-h) - var(--space-5) - var(--space-8));
}
@media (max-width: 980px) {
  .hero__inner {
    grid-template-columns: 1fr;
    /* Generous breathing room between phone visual and copy on mobile —
       the phone's chassis + notch + tilt pulls visual mass past its frame */
    gap: var(--space-8);
    text-align: center;
  }
  .hero__copy {
    justify-self: center;
  }
  .hero__stage {
    order: -1;
    width: 100%;
    max-width: 460px;
    margin: 0 auto var(--space-3);
  }
}

.hero__copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.4em 0.9em 0.4em 0.5em;
  border: 1px solid var(--ink-hairline-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--space-4);
}
.hero__eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(116, 204, 0, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(116, 204, 0, 0);
  }
}

.hero__title {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 5.5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 var(--space-4);
}
.hero__title .serif {
  font-size: 0.82em;
  line-height: 0.9;
  display: inline-block;
  margin-top: 0.1em;
}
@media (max-width: 980px) {
  .hero__title {
    text-align: center;
  }
}

.hero__lead {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 48ch;
  margin-bottom: var(--space-5);
  line-height: 1.45;
}
@media (max-width: 980px) {
  .hero__lead {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
@media (max-width: 980px) {
  .hero__ctas {
    justify-content: center;
  }
}

.hero__meta {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.hero__meta strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.15rem;
  display: block;
  line-height: 1.2;
  margin-bottom: 0.1em;
}

/* Stage — where the orbit lives */
.hero__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 580px;
  justify-self: end;
}
@media (max-width: 980px) {
  .hero__stage {
    justify-self: center;
  }
}

/* Scroll nudge */
.hero__scroll {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}
.hero__scroll::after {
  content: "";
  width: 1px;
  height: 36px;
  background: currentColor;
  opacity: 0.3;
  animation: scrollLine 1.8s var(--ease-in-out) infinite;
  transform-origin: top center;
}
@keyframes scrollLine {
  0%, 100% {
    transform: scaleY(1);
    opacity: 0.3;
  }
  50% {
    transform: scaleY(0.4);
    opacity: 0.9;
  }
}

/* ---------------- Orbit component ---------------- */
/* SVG-driven; JS rotates the group slowly + reacts to cursor */
.orbit {
  position: absolute;
  inset: 0;
}
.orbit svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.orbit__ring {
  fill: none;
  stroke: var(--ink-hairline);
  stroke-dasharray: 2 8;
}
.orbit__figure {
  transform-origin: center;
  transform-box: fill-box;
  transition: transform var(--t-med) var(--ease-spring);
}
.orbit__figure:hover {
  transform: scale(1.06);
}
.orbit__label {
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-anchor: middle;
}

/* Moving ticker around the outside */
.orbit__ticker {
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}

/* Bold brand-colored statement bubble over the orbit */
.orbit__tag {
  position: absolute;
  padding: 0.45em 0.85em;
  background: #fff;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(12px);
  animation: tagIn 900ms var(--ease-out) forwards;
}
.orbit__tag--pink {
  color: var(--pink);
  top: 6%;
  right: -4%;
  animation-delay: 1.2s;
}
.orbit__tag--blue {
  color: var(--blue);
  bottom: 28%;
  left: -8%;
  animation-delay: 1.5s;
}
.orbit__tag--orange {
  color: var(--orange);
  top: 42%;
  right: -10%;
  animation-delay: 1.8s;
}
.orbit__tag--green {
  color: var(--green);
  bottom: 4%;
  left: 8%;
  animation-delay: 2.1s;
}
@keyframes tagIn {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 980px) {
  .orbit__tag {
    font-size: 0.72rem;
  }
  .orbit__tag--pink {
    right: 0;
  }
  .orbit__tag--orange {
    right: -2%;
  }
  .orbit__tag--blue {
    left: 0;
  }
}

/* ---------------- Marquee ---------------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--ink-hairline);
  border-bottom: 1px solid var(--ink-hairline);
  padding: var(--space-4) 0;
  background: #fff;
}
.marquee__track {
  display: flex;
  gap: var(--space-6);
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  will-change: transform;
}
.marquee__track > * {
  flex: 0 0 auto;
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
}
.marquee__track .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  display: inline-block;
}
.marquee__track .dot--blue {
  background: var(--blue);
}
.marquee__track .dot--orange {
  background: var(--orange);
}
.marquee__track .dot--green {
  background: var(--green);
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ---------------- Chapter blocks (one per brand color) ---------------- */
.chapters {
  display: grid;
  gap: 0;
}

.chapter {
  padding: var(--space-9) 0;
  position: relative;
  overflow: hidden;
}
.chapter--pink {
  background: var(--pink-wash);
}
.chapter--blue {
  background: var(--blue-wash);
}
.chapter--orange {
  background: var(--orange-wash);
}
.chapter--green {
  background: var(--green-wash);
}

.chapter__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-6);
  align-items: center;
}
.chapter--flip .chapter__inner {
  grid-template-columns: 1.1fr 1fr;
}
.chapter--flip .chapter__visual {
  order: -1;
}
@media (max-width: 980px) {
  .chapter__inner,
  .chapter--flip .chapter__inner {
    grid-template-columns: 1fr;
  }
  .chapter--flip .chapter__visual {
    order: 0;
  }
}

.chapter__copy {
  max-width: 560px;
}
.chapter__number {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: var(--step-3);
  font-weight: 400;
  color: var(--ink-soft);
  margin-bottom: var(--space-3);
  display: block;
  letter-spacing: -0.01em;
}
.chapter__title {
  font-size: var(--step-5);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.chapter--pink .chapter__title .hl {
  color: var(--pink);
}
.chapter--blue .chapter__title .hl {
  color: var(--blue);
}
.chapter--orange .chapter__title .hl {
  color: var(--orange);
}
.chapter--green .chapter__title .hl {
  color: var(--green);
}
.chapter__lead {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: var(--space-5);
  max-width: 48ch;
}
.chapter__bullets {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.chapter__bullets li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--space-3);
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.5;
}
.chapter__bullets li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-top: 0.45em;
  background: currentColor;
}
.chapter--pink .chapter__bullets li::before {
  background: var(--pink);
}
.chapter--blue .chapter__bullets li::before {
  background: var(--blue);
}
.chapter--orange .chapter__bullets li::before {
  background: var(--orange);
}
.chapter--green .chapter__bullets li::before {
  background: var(--green);
}

/* Chapter visual — device mock / card cluster */
.chapter__visual {
  position: relative;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 980px) {
  .chapter__visual {
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin: 0 auto;
  }
}

/* Phone chassis */
.phone {
  position: relative;
  width: min(320px, 78%);
  aspect-ratio: 9 / 19;
  background: #0a0a0a;
  border-radius: 44px;
  padding: 10px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.25),
    0 8px 18px -6px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: rotate(-4deg);
  transition: transform 800ms var(--ease-out);
}
.chapter--flip .phone {
  transform: rotate(4deg);
}
.phone:hover {
  transform: rotate(0);
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone__notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #0a0a0a;
  border-radius: 999px;
  z-index: 5;
}
.phone__status {
  padding: 14px 22px 6px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}
.phone__bar {
  padding: 22px 18px 6px;
}
.phone__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.phone__sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.phone__body {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.phone__card {
  background: #fff;
  border: 1px solid var(--ink-hairline);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  transition: transform var(--t-med) var(--ease-spring);
}
.phone__card:hover {
  transform: translateY(-2px);
}
.phone__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.phone__avatar--pink {
  background: var(--pink);
}
.phone__avatar--blue {
  background: var(--blue);
}
.phone__avatar--orange {
  background: var(--orange);
}
.phone__avatar--green {
  background: var(--green);
}
.phone__meta {
  flex: 1;
  min-width: 0;
}
.phone__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone__msg {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone__pill {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.phone__pill--new {
  background: var(--pink);
  color: #fff;
}

.phone__tabs {
  display: flex;
  border-top: 1px solid var(--ink-hairline);
  padding: 10px 14px 16px;
  gap: 0;
  justify-content: space-around;
}
.phone__tab {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--ink-hairline);
}
.phone__tab.is-active {
  background: var(--ink);
}

/* Floating badges around the phone */
.floater {
  position: absolute;
  background: #fff;
  border: 1px solid var(--ink-hairline);
  box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.14);
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: floatA 6s ease-in-out infinite;
}
.floater svg {
  width: 18px;
  height: 18px;
}
.floater--a {
  top: 12%;
  right: -2%;
  animation-delay: 0s;
}
.floater--b {
  bottom: 18%;
  left: -6%;
  animation-delay: -2s;
  animation-name: floatB;
}
.floater--c {
  bottom: 0;
  right: 4%;
  animation-delay: -4s;
  animation-name: floatC;
}
@keyframes floatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes floatB {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(-2deg); }
}
@keyframes floatC {
  0%, 100% { transform: translateY(0) rotate(3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

/* ---------------- Pinwall ---------------- */
.pinwall {
  position: relative;
  padding: var(--space-9) 0;
  background: var(--bg-soft);
  overflow: hidden;
}
.pinwall__header {
  max-width: var(--max);
  margin: 0 auto var(--space-6);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-5);
  align-items: end;
}
@media (max-width: 880px) {
  .pinwall__header {
    grid-template-columns: 1fr;
  }
}

.pinwall__grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-3);
}
.pin {
  position: relative;
  border-radius: var(--radius-l);
  padding: var(--space-5);
  background: #fff;
  border: 1px solid var(--ink-hairline);
  overflow: hidden;
  transition:
    transform var(--t-med) var(--ease-spring),
    box-shadow var(--t-med) var(--ease-out);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}
.pin:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 28px 48px -20px rgba(0, 0, 0, 0.22);
  z-index: 2;
}
.pin__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.pin__body {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-top: var(--space-4);
}
.pin__foot {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.pin--pink {
  background: var(--pink);
  color: #fff;
  border-color: transparent;
}
.pin--pink .pin__tag,
.pin--pink .pin__foot {
  color: rgba(255, 255, 255, 0.75);
}
.pin--blue {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}
.pin--blue .pin__tag,
.pin--blue .pin__foot {
  color: rgba(255, 255, 255, 0.85);
}
.pin--orange {
  background: var(--orange);
  color: var(--ink);
  border-color: transparent;
}
.pin--green {
  background: var(--green);
  color: var(--ink);
  border-color: transparent;
}
.pin--ink {
  background: var(--bg-ink);
  color: #fff;
  border-color: transparent;
}
.pin--ink .pin__tag,
.pin--ink .pin__foot {
  color: rgba(255, 255, 255, 0.65);
}

/* Pinwall spans */
.pin--span-4 { grid-column: span 4; }
.pin--span-5 { grid-column: span 5; }
.pin--span-6 { grid-column: span 6; }
.pin--span-7 { grid-column: span 7; }
.pin--span-8 { grid-column: span 8; }
.pin--tall { min-height: 320px; }
.pin--xtall { min-height: 380px; }

@media (max-width: 980px) {
  .pinwall__grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .pin--span-4,
  .pin--span-5,
  .pin--span-6,
  .pin--span-7,
  .pin--span-8 {
    grid-column: span 6;
  }
}

/* Event / avatar stacks inside pins */
.avatar-stack {
  display: flex;
}
.avatar-stack > * {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid currentColor;
  margin-left: -8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-stack > *:first-child {
  margin-left: 0;
}

/* ---------------- Stat band ---------------- */
.stats {
  padding: var(--space-8) 0;
  background: var(--bg-ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.stats::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 31, 169, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(56, 182, 255, 0.18) 0%, transparent 50%);
  pointer-events: none;
}
.stats__grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  position: relative;
  z-index: 2;
}
@media (max-width: 880px) {
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.stat__n {
  font-size: var(--step-5);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.stat__label {
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  max-width: 24ch;
  line-height: 1.4;
}
.stat--pink .stat__n { color: var(--pink); }
.stat--blue .stat__n { color: var(--blue); }
.stat--orange .stat__n { color: var(--orange); }
.stat--green .stat__n { color: var(--green); }

/* ---------------- Voice quotes ---------------- */
.voices {
  padding: var(--space-9) 0;
}
.voices__title {
  max-width: var(--max);
  margin: 0 auto var(--space-6);
  padding: 0 var(--gutter);
}
.voices__rail {
  display: flex;
  gap: var(--space-4);
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.voices__rail::-webkit-scrollbar {
  display: none;
}
.voice {
  flex: 0 0 min(420px, 80vw);
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--ink-hairline);
  border-radius: var(--radius-l);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform var(--t-med) var(--ease-spring);
}
.voice:hover {
  transform: translateY(-4px);
}
.voice__quote {
  font-family: "Instrument Serif", serif;
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.25;
  color: var(--ink);
}
.voice__who {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
}
.voice__who strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}
.voice__who span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------------- CTA banner ---------------- */
.cta {
  padding: var(--space-9) 0;
  background: var(--bg-ink);
  color: #fff;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cta__rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.cta__rings svg {
  width: min(880px, 140%);
  height: auto;
  opacity: 0.3;
}
.cta__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}
.cta__title {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 5.25rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-5);
}
.cta__title .hl[data-hl="pink"] { color: var(--pink); }
.cta__title .hl[data-hl="blue"] { color: var(--blue); }
.cta__title .hl[data-hl="orange"] { color: var(--orange); }
.cta__title .hl[data-hl="green"] { color: var(--green); }
.cta__sub {
  font-size: var(--step-1);
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: var(--space-6);
}
.cta__ctas {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.cta .btn--ghost {
  --btn-fg: #fff;
  --btn-border: rgba(255, 255, 255, 0.2);
}
.cta .btn--ghost:hover {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
  --btn-border: #fff;
}

/* ---------------- Footer ---------------- */
.foot {
  padding: var(--space-8) 0 var(--space-5);
  background: var(--bg);
  border-top: 1px solid var(--ink-hairline);
}
.foot__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 880px) {
  .foot__inner {
    grid-template-columns: 1fr 1fr;
  }
}
.foot__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 360px;
}
.foot__brand-mark {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.foot__brand-mark svg,
.foot__brand-mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.foot__tagline {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.foot__col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 var(--space-3);
}
.foot__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}
.foot__col a {
  font-size: 0.95rem;
  color: var(--ink);
  transition: color var(--t-fast) var(--ease-out);
}
.foot__col a:hover {
  color: var(--pink);
}
.foot__bottom {
  max-width: var(--max);
  margin: var(--space-7) auto 0;
  padding: var(--space-4) var(--gutter) 0;
  border-top: 1px solid var(--ink-hairline);
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: var(--space-3);
}
.foot__tag {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
}

/* ---------------- Generic card rows for sub-pages ---------------- */
.page-hero {
  padding: calc(var(--nav-h) + var(--space-7)) 0 var(--space-7);
  position: relative;
  overflow: hidden;
}
.page-hero__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-5);
  align-items: end;
}
@media (max-width: 880px) {
  .page-hero__inner {
    grid-template-columns: 1fr;
  }
}
.page-hero__title {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 5.5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.page-hero__lead {
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.45;
  max-width: 48ch;
}

/* Feature row — full width cards */
.feat {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--ink-hairline);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-5);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
@media (max-width: 880px) {
  .feat {
    grid-template-columns: 1fr;
  }
}
.feat__n {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: var(--step-3);
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.feat__n .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.feat--pink .feat__n .dot { background: var(--pink); }
.feat--blue .feat__n .dot { background: var(--blue); }
.feat--orange .feat__n .dot { background: var(--orange); }
.feat--green .feat__n .dot { background: var(--green); }
.feat__title {
  font-size: var(--step-4);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-3);
}
.feat__body {
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 56ch;
  margin-bottom: var(--space-4);
}
.feat__chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.chip {
  padding: 0.4em 0.9em;
  border: 1px solid var(--ink-hairline-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}
.chip--pink { border-color: var(--pink); color: var(--pink); }
.chip--blue { border-color: var(--blue); color: var(--blue); }
.chip--orange { border-color: var(--orange); color: var(--orange); }
.chip--green { border-color: var(--green); color: var(--green); }

/* Download page — phone app store cards */
.store-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  max-width: 720px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .store-cards {
    grid-template-columns: 1fr;
  }
}
.store-card {
  padding: var(--space-5);
  border: 1px solid var(--ink-hairline-strong);
  border-radius: var(--radius-l);
  background: #fff;
  text-align: left;
  transition:
    transform var(--t-med) var(--ease-spring),
    border-color var(--t-med) var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.store-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
}
.store-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-card__meta small {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
}
.store-card__meta strong {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Legal page — prose */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-7) var(--gutter) var(--space-9);
}
.prose h2 {
  font-size: var(--step-2);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  letter-spacing: -0.015em;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose p,
.prose li {
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: var(--space-3);
  font-size: 0.98rem;
}
.prose ul {
  padding-left: 1.2em;
}
.prose a {
  color: var(--pink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Hide bilingual content by language */
html[data-lang="de"] [data-when="en"],
html[data-lang="en"] [data-when="de"] {
  display: none !important;
}

/* =============================================================
   Mobile refinements (≤640px / ≤480px)
   Component-level fine-tuning for phone-class viewports.
   ============================================================= */

@media (max-width: 640px) {
  /* ---------- Nav ---------- */
  .nav__inner {
    gap: var(--space-3);
  }
  .nav__brand span {
    /* Wordmark stays visible but a touch smaller */
    font-size: 1rem;
  }
  .nav__toggle {
    /* 44×44 minimum touch target */
    width: 44px;
    height: 44px;
  }
  .nav__toggle span {
    left: 12px;
    right: 12px;
  }
  .nav__toggle span:nth-child(1) {
    top: 17px;
  }
  .nav__toggle span:nth-child(2) {
    top: 25px;
  }
  .nav.is-open .nav__toggle span:nth-child(1),
  .nav.is-open .nav__toggle span:nth-child(2) {
    top: 21px;
  }
  /* On very small screens, hide the inline CTA in the header — it's redundant with the hero CTA */
  .nav__right .btn {
    display: none;
  }
  .lang-toggle {
    /* Larger hit area for the language pills */
    font-size: 0.82rem;
  }
  .lang-toggle button {
    padding: 0.45em 0.95em;
  }

  /* ---------- Hero ---------- */
  .hero {
    /* Use small-viewport height so iOS URL bar doesn't push content */
    min-height: 100svh;
    padding-top: calc(var(--nav-h) + var(--space-4));
    padding-bottom: var(--space-7);
  }
  .hero__inner {
    min-height: auto;
    gap: var(--space-5);
  }
  .hero__copy {
    text-align: center;
  }
  .hero__title {
    /* A touch tighter — keeps three lines from breaking the fold */
    font-size: clamp(2rem, 1.4rem + 5vw, 3.25rem);
    /* Stop line crashes (descender of "p" in "App" was hitting "h" of "herunter") */
    line-height: 1.06;
  }
  .hero__lead {
    font-size: var(--step-0);
  }
  .hero__ctas {
    gap: var(--space-2);
  }
  .hero__ctas .btn {
    /* Make the primary CTA wide so it's thumb-friendly */
    flex: 1 1 auto;
    justify-content: center;
  }
  .hero__meta {
    justify-content: center;
    gap: var(--space-4);
    font-size: 0.82rem;
  }
  .hero__meta strong {
    font-size: 1.05rem;
  }
  /* Tone down the glow blobs — heavy filters tank phone GPUs */
  .hero__glows {
    filter: blur(60px);
    opacity: 0.55;
  }
  .hero__glow {
    width: 60vmax;
    height: 60vmax;
    animation-duration: 40s;
  }
  /* Hide the scroll nudge on phones — the hero already fills the screen */
  .hero__scroll {
    display: none;
  }

  /* Shrink the orbit so the full stage fits inside the hero section on phones */
  .hero__stage {
    max-width: 300px;
    margin: 0 auto;
  }

  /* Floating tags around the orbit — keep them inside the visible frame */
  .orbit__tag {
    font-size: 0.66rem;
    padding: 0.35em 0.65em;
  }
  .orbit__tag--pink { right: 2%; }
  .orbit__tag--blue { left: 2%; }
  .orbit__tag--orange { right: 0; }
  .orbit__tag--green { left: 4%; }

  /* ---------- Marquee ---------- */
  .marquee {
    padding: var(--space-3) 0;
  }
  .marquee__track {
    gap: var(--space-5);
    /* Slightly faster + smaller text so it reads as motion, not as labels */
    animation-duration: 32s;
  }
  .marquee__track > * {
    font-size: var(--step-1);
    gap: var(--space-5);
  }

  /* ---------- Chapters ---------- */
  .chapter {
    padding: var(--space-7) 0;
  }
  .chapter__inner,
  .chapter--flip .chapter__inner {
    gap: var(--space-5);
  }
  .chapter__title {
    font-size: clamp(2rem, 1.5rem + 4vw, 3rem);
  }
  .chapter__lead {
    font-size: var(--step-0);
  }
  /* Phone mock — let it breathe, drop the rotation so it sits flat & readable */
  .chapter__visual {
    aspect-ratio: auto;
    min-height: 380px;
    max-width: 320px;
  }
  .phone {
    width: 240px;
    transform: rotate(0);
  }
  .chapter--flip .phone {
    transform: rotate(0);
  }
  /* Floaters get pulled in so they don't escape the screen */
  .floater {
    font-size: 0.78rem;
    padding: 8px 12px;
  }
  .floater--a { top: 4%; right: 0; }
  .floater--b { bottom: 22%; left: 0; }
  .floater--c { bottom: -2%; right: 6%; }

  /* ---------- Pinwall ---------- */
  .pinwall {
    padding: var(--space-7) 0;
  }
  .pinwall__grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .pin--span-4,
  .pin--span-5,
  .pin--span-6,
  .pin--span-7,
  .pin--span-8 {
    grid-column: span 1;
  }
  .pin {
    min-height: 180px;
    padding: var(--space-4);
  }
  .pin--tall { min-height: 220px; }
  .pin--xtall { min-height: 260px; }

  /* ---------- Stats ---------- */
  .stats {
    padding: var(--space-7) 0;
  }
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  .stat__n {
    font-size: clamp(2.5rem, 2rem + 4vw, 4rem);
  }
  .stat__label {
    font-size: 0.82rem;
  }

  /* ---------- Voices (horizontal rail) ---------- */
  .voices {
    padding: var(--space-7) 0;
  }
  .voice {
    flex: 0 0 min(320px, 86vw);
    padding: var(--space-4);
  }
  .voice__quote {
    font-size: var(--step-1);
  }

  /* ---------- CTA ---------- */
  .cta {
    padding: var(--space-7) 0;
  }
  .cta__title {
    font-size: clamp(2rem, 1.4rem + 5vw, 3.5rem);
  }
  .cta__sub {
    font-size: var(--step-0);
  }
  .cta__ctas {
    gap: var(--space-2);
  }
  .cta__ctas .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* ---------- Footer ---------- */
  .foot {
    padding: var(--space-7) 0 var(--space-4);
  }
  .foot__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4) var(--space-3);
  }
  .foot__brand {
    grid-column: 1 / -1;
  }
  .foot__bottom {
    margin-top: var(--space-5);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  /* ---------- Sub-pages (features / about / download / legal) ---------- */
  .page-hero {
    padding: calc(var(--nav-h) + var(--space-5)) 0 var(--space-5);
  }
  .page-hero__inner {
    gap: var(--space-4);
    align-items: start;
  }
  .page-hero__title {
    font-size: clamp(2.25rem, 1.6rem + 5vw, 3.75rem);
  }
  .page-hero__lead {
    font-size: var(--step-0);
  }
  .feat {
    padding: var(--space-5) var(--gutter);
    gap: var(--space-3);
  }
  .feat__title {
    font-size: clamp(1.75rem, 1.4rem + 3vw, 2.5rem);
  }
  .feat__body {
    font-size: var(--step-0);
  }
  .store-cards {
    gap: var(--space-3);
  }
  .store-card {
    padding: var(--space-4);
    gap: var(--space-3);
  }
  .store-card__icon {
    width: 46px;
    height: 46px;
  }
  .prose {
    padding: var(--space-5) var(--gutter) var(--space-7);
  }
  .prose p,
  .prose li {
    font-size: 0.95rem;
  }
}

/* ---------- Tiny phones (≤480px) ---------- */
@media (max-width: 480px) {
  .nav__brand span {
    /* Hide wordmark text — logo mark alone is plenty at this size */
    display: none;
  }
  .lang-toggle {
    font-size: 0.78rem;
  }
  .lang-toggle button {
    padding: 0.4em 0.75em;
  }

  .hero__title {
    font-size: clamp(1.85rem, 1.2rem + 6vw, 2.75rem);
    line-height: 1.08;
  }
  .hero__title br {
    /* Allow natural wrapping rather than forcing line breaks at narrow widths */
    display: none;
  }
  .hero__title .serif {
    display: block;
    margin-top: 0.2em;
  }

  /* Stats — single column on the smallest screens */
  .stats__grid {
    grid-template-columns: 1fr;
  }
  .stat__label {
    max-width: none;
  }

  /* Footer — single column on the smallest screens */
  .foot__inner {
    grid-template-columns: 1fr;
  }
  .foot__brand {
    grid-column: auto;
  }

  /* Chapter phone mock — even more compact */
  .chapter__visual {
    min-height: 340px;
  }
  .phone {
    width: 220px;
  }
}

/* ---------- Save data: pause always-running decorative animations ---------- */
@media (prefers-reduced-data: reduce) {
  .marquee__track,
  .hero__glow {
    animation-play-state: paused;
  }
}

/* ---------- Reduce motion cost on coarse pointers (touch devices) ---------- */
@media (pointer: coarse) {
  /* Disable hover-only flourishes that fire on tap-and-hold */
  .pin:hover {
    transform: none;
  }
  .voice:hover,
  .store-card:hover {
    transform: none;
  }
  .phone:hover,
  .chapter--flip .phone:hover {
    transform: rotate(0);
  }
}
