/* ============================================================
   01 · Philosophy
   A short manifesto: one big line, the origin lesson (read word
   by word — js/redesign.js), three working principles and the
   signature. Motion: js/philosophy.js.
   ============================================================ */

.philosophy {
  --light-86: rgba(244, 241, 234, 0.86);
  --light-60: rgba(244, 241, 234, 0.6);
  --light-16: rgba(244, 241, 234, 0.16);

  position: relative;
  z-index: 5;
  padding: clamp(7rem, 17vh, 12rem) var(--pad-x) clamp(6rem, 14vh, 10rem);
  color: var(--text-light);
  /* the torus glows through the edges; the reading column stays calm */
  background:
    radial-gradient(70% 60% at 30% 40%, rgba(9, 13, 12, 0.92) 0%, rgba(9, 13, 12, 0.7) 60%, rgba(9, 13, 12, 0.55) 100%);
}
.philo-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.philo-title {
  max-width: 15ch;
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(3rem, 7.4vw, 7.25rem);
  line-height: 0.96;
  letter-spacing: -0.038em;
  color: var(--text-light);
  text-wrap: balance;
}
.philo-title em {
  color: var(--accent-gold);
}
.philo-title .pw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.04em 0.06em 0.14em;
  margin: -0.04em -0.06em -0.14em;
}
.philo-title .pw-in {
  display: inline-block;
  will-change: transform;
}

/* The story sits in an offset reading column */
.philo-story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  margin-top: clamp(2.5rem, 6vh, 4rem);
}
.philo-story .philosophy-body {
  grid-column: 2;
  max-width: 42rem;
}
.philosophy-body p {
  margin: 0 0 1.25rem;
  font-size: clamp(1.08rem, 1.3vw, 1.26rem);
  line-height: 1.68;
  color: var(--light-86);
}
.philosophy-body p:last-child {
  margin-bottom: 0;
}
.philosophy-body .drop::first-letter {
  float: left;
  margin: 0.1em 0.14em 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 3.6em;
  line-height: 0.82;
  color: var(--accent-gold);
}

/* Principles */
.philo-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.2vw, 3.25rem);
  margin: clamp(4rem, 11vh, 7rem) 0 0;
  padding: 0;
  list-style: none;
}
.pr-item {
  position: relative;
  padding-top: 1.5rem;
}
.pr-item::before,
.pr-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  transform-origin: left;
}
.pr-item::before {
  right: 0;
  background: var(--light-16);
}
.pr-item::after {
  width: 40px;
  background: var(--accent-gold);
}
.pr-n {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.pr-title {
  margin: 0.9rem 0 0.75rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-light);
}
.pr-title em {
  color: var(--accent-gold);
}
.pr-body {
  max-width: 34ch;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--light-60);
}

/* Rules draw in when the principles arrive (class set by js/philosophy.js) */
.philo-principles.rules-pending .pr-item::before,
.philo-principles.rules-pending .pr-item::after {
  transform: scaleX(0);
}
.philo-principles.rules-drawn .pr-item::before,
.philo-principles.rules-drawn .pr-item::after {
  transform: scaleX(1);
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}
.philo-principles.rules-drawn .pr-item:nth-child(2)::before,
.philo-principles.rules-drawn .pr-item:nth-child(2)::after {
  transition-delay: 0.12s;
}
.philo-principles.rules-drawn .pr-item:nth-child(3)::before,
.philo-principles.rules-drawn .pr-item:nth-child(3)::after {
  transition-delay: 0.24s;
}

/* Signature */
.philosophy .signature {
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(3rem, 8vh, 5rem);
}
.signature-handwritten {
  display: inline-block;
  font-family: "Mr De Haviland", cursive;
  font-weight: 400;
  font-size: clamp(2.8rem, 4.4vw, 3.8rem);
  line-height: 1;
  color: var(--accent-gold);
}

/* ─── Tablet & phone ─── */
@media (max-width: 900px) {
  .philo-story {
    grid-template-columns: minmax(0, 1fr);
  }
  .philo-story .philosophy-body {
    grid-column: 1;
  }
  .philo-principles {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }
  .philosophy .signature {
    justify-content: flex-start;
  }
}
