/* ── Our philosophy: an illustrated essay ───────────────────────────────────
 * A reading column of about 680px, paintings wider than it (philosophy.js),
 * chapter heads with a numeral, a Sanskrit word and a serif title. The nav,
 * footer and buttons come from hero.css.
 */

.ph {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(112px, 15vh, 150px) 16px clamp(56px, 9vh, 96px);
}

/* ── Opening ── */
.ph-hero { max-width: 780px; margin: 0 auto; text-align: center; }
.ph-kicker {
  font: 600 0.72rem/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--candle);
}
.ph-aims {
  margin: 20px 0 12px;
  font-family: 'Tiro Devanagari Sanskrit', 'Instrument Serif', serif;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: rgba(233, 192, 138, 0.8);
  letter-spacing: 0.04em;
}
.ph-aims i { font-style: normal; opacity: 0.45; margin: 0 0.35em; }
.ph-hero h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 7.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--silk);
  text-wrap: balance;
}
.ph-hero h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; font-weight: 400; letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--crimson) 10%, var(--candle) 80%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 0.06em;
}
.ph-dek {
  max-width: 620px; margin: 24px auto 0;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem); line-height: 1.65;
  color: rgba(244, 233, 228, 0.82);
}
.ph-meta { margin-top: 14px; font-size: 0.8rem; color: var(--rose-ash); }
.ph-toc {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin: 36px auto 0; text-align: left;
}
.ph-toc a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--silk); font-size: 0.86rem; line-height: 1.35; text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ph-toc a:hover, .ph-toc a:focus-visible { border-color: rgba(216, 163, 94, 0.5); background: rgba(216, 163, 94, 0.08); }
.ph-toc b { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 1.05rem; color: var(--candle); min-width: 1.6em; }

/* ── Chapters ── */
.ph-ch { margin: clamp(72px, 12vh, 130px) auto 0; scroll-margin-top: 84px; }
.ph-ch-head { max-width: 680px; margin: 0 auto clamp(26px, 4vh, 38px); text-align: center; }
.ph-num {
  display: block;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.05rem; letter-spacing: 0.32em; color: var(--candle);
}
.ph-deva {
  display: block;
  margin: 6px 0 2px;
  font-family: 'Tiro Devanagari Sanskrit', 'Instrument Serif', serif;
  font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.35;
  background: linear-gradient(100deg, var(--crimson) 10%, var(--candle) 85%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ph-ch-head h2 {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.08;
  color: var(--silk); text-wrap: balance;
}

.ph-text { max-width: 680px; margin: 0 auto; }
.ph-text p, .ph-list li {
  font-size: clamp(1rem, 1.25vw, 1.08rem); line-height: 1.8;
  color: rgba(244, 233, 228, 0.86);
}
.ph-text p { margin: 0 0 1.15em; }
.ph-text em {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: 1.1em; color: #f3dcbd;
}
.ph-text a { color: var(--candle); text-underline-offset: 3px; }
.ph-lead::first-letter {
  float: left;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 3.7em; line-height: 0.8;
  padding: 0.08em 0.12em 0 0;
  color: var(--candle);
}
.ph-quote {
  margin: 1.8em 0;
  padding: 4px 0 4px 24px;
  border-left: 1px solid rgba(216, 163, 94, 0.5);
}
.ph-text .ph-quote p {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.62rem); line-height: 1.4;
  color: var(--silk); margin-bottom: 10px;
}
.ph-quote footer {
  text-align: left;
  font: 600 0.66rem/1.4 'Inter', system-ui, sans-serif;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--candle);
}
.ph-text .ph-aside {
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: linear-gradient(135deg, rgba(224, 68, 110, 0.08), rgba(216, 163, 94, 0.07));
}
.ph-list { list-style: none; margin: 0 0 1.3em; padding: 0; }
.ph-list li { position: relative; padding-left: 26px; margin-bottom: 0.7em; }
.ph-list li::before {
  content: ''; position: absolute; left: 4px; top: 0.72em;
  width: 8px; height: 8px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--crimson), var(--candle));
}
.ph-list strong { color: var(--silk); font-weight: 600; }

/* ── Paintings ── */
.ph-fig { max-width: 1040px; margin: clamp(30px, 5vh, 46px) auto; }
.ph-art {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  background: var(--ph-bg, #1a0f18);
  box-shadow: var(--card-shadow);
  outline: 1px solid rgba(216, 163, 94, 0.18);
  outline-offset: -1px;
}
.ph-art canvas { position: absolute; left: 0; top: 0; }
.ph-art .ph-layer,
.ph-art .kz-ib-layer { opacity: 0; transition: opacity 0.9s ease; }
.ph-art.is-painted .ph-layer,
.ph-art.is-painted .kz-ib-layer { opacity: 1; }
.ph-fig figcaption {
  max-width: 640px; margin: 14px auto 0;
  text-align: center;
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: 1.02rem; line-height: 1.5;
  color: var(--rose-ash);
}
/* what shows while a painting is still being laid down */
.ph-art--lamps { --ph-bg: linear-gradient(#141134, #5a3566 28%, #e08a64 44%, #5a3358 47%, #1a1328 76%, #6e5046 77%, #3a272c); }
.ph-art--kama  { --ph-bg: linear-gradient(#1a1540, #37295f 30%, #6a3e77 56%, #b25e7c 80%, #1d1424 90%); }
.ph-art--hands { --ph-bg: linear-gradient(90deg, #2d5a3d 50%, #241c19 50%); }
.ph-art--mosaic { --ph-bg: #150c10; aspect-ratio: 16 / 10; }
.ph-art--rasa  { --ph-bg: radial-gradient(circle, #3a1a24, #1a0b12 70%); aspect-ratio: 1 / 1; }
.ph-art--town  { --ph-bg: linear-gradient(#121a3a, #30508a 50%, #1c2234 86%); aspect-ratio: 2.4 / 1; }

/* I. the lamps' names under them */
.ph-lamp-labels { position: absolute; left: 0; right: 0; bottom: 1.6%; height: 0; z-index: 3; pointer-events: none; }
.ph-lamp-labels span {
  position: absolute; bottom: 0; transform: translateX(-50%);
  text-align: center; white-space: nowrap;
  font: 600 0.6rem/1.2 'Inter', system-ui, sans-serif;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 236, 214, 0.86);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
}
.ph-lamp-labels b {
  display: block;
  font-family: 'Tiro Devanagari Sanskrit', serif; font-weight: 400;
  font-size: 1.02rem; letter-spacing: 0; text-transform: none;
  color: #ffd9a0;
}
.ph-lamp-labels .is-kama, .ph-lamp-labels .is-kama b { color: #ffc2a6; }
.ph-lamp-labels span:nth-child(1) { left: 20%; }
.ph-lamp-labels span:nth-child(2) { left: 40%; }
.ph-lamp-labels span:nth-child(3) { left: 60%; }
.ph-lamp-labels span:nth-child(4) { left: 80%; }

/* II. the window of sixty-four tiles */
.ph-tiles {
  position: absolute; inset: 0; z-index: 3;
  padding: var(--ph-pad, 18px);
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
}
.ph-tile {
  position: relative;
  border: 0; margin: 0; padding: 0;
  background: rgba(12, 6, 10, 0.86);
  cursor: pointer;
  font: inherit; color: inherit;
  transition: background 0.8s ease var(--d, 0ms);
}
.ph-tiles.is-lit .ph-tile { background: rgba(12, 6, 10, 0); }
.ph-tile::after {
  content: ''; position: absolute; inset: 2px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(255, 228, 168, 0.95), inset 0 0 22px rgba(255, 238, 196, 0.4);
  opacity: 0; transition: opacity 0.18s ease;
}
.ph-tile:hover::after, .ph-tile.is-on::after, .ph-tile:focus-visible::after { opacity: 1; }
.ph-tile:focus-visible { outline: none; }
.ph-tile span {
  position: absolute; top: 5px; left: 7px;
  font: 600 0.6rem/1 'Inter', system-ui, sans-serif;
  color: rgba(255, 250, 236, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  opacity: 0; transition: opacity 0.4s ease var(--d, 0ms);
}
.ph-tiles.is-lit .ph-tile span { opacity: 0.85; }
.ph-tile-cap {
  min-height: 1.7em; margin: 16px auto 0;
  text-align: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.3;
  color: var(--silk);
}
.ph-tile-cap b {
  display: inline-block; vertical-align: 0.2em;
  margin-right: 8px; padding: 3px 9px;
  border-radius: 99px;
  background: var(--candle); color: var(--velvet);
  font: 600 0.72rem/1.3 'Inter', system-ui, sans-serif; letter-spacing: 0.08em;
}
.ph-tile-cap em { color: var(--candle); font-style: italic; }
.ph-arts { margin: 6px 0 26px; }
.ph-arts summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--hairline); border-radius: 99px;
  font-size: 0.86rem; color: var(--silk);
  cursor: pointer; list-style: none;
}
.ph-arts summary::-webkit-details-marker { display: none; }
.ph-arts summary::after { content: '+'; color: var(--candle); font-size: 1.05rem; line-height: 1; }
.ph-arts[open] summary::after { content: '−'; }
.ph-arts-list { columns: 2; column-gap: 32px; margin: 18px 0 0; padding-left: 1.8em; }
.ph-arts-list li { font-size: 0.92rem; line-height: 1.6; color: rgba(244, 233, 228, 0.8); break-inside: avoid; }
.ph-arts-list li::marker { color: var(--candle); font-size: 0.8rem; }

/* II. the card each tile opens */
.ph-card-lock, .ph-card-lock body { overflow: hidden; }
.ph-card-scrim {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(10, 4, 8, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.22s ease;
}
.ph-card-scrim[hidden] { display: none; }
.ph-card-scrim.is-open { opacity: 1; }
.ph-card {
  position: relative;
  width: min(720px, 100%);
  display: grid; grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px; padding: 26px 26px 20px;
  border-radius: 24px;
  background: linear-gradient(160deg, #2a121c, #1a0b12 70%);
  border: 1px solid rgba(216, 163, 94, 0.45);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 0 0 5px rgba(216, 163, 94, 0.08);
  transform: translateY(12px) scale(0.98); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.ph-card-scrim.is-open .ph-card { transform: none; }
.ph-card.is-turn .ph-card-body, .ph-card.is-turn .ph-card-art { animation: phCardIn 0.35s ease both; }
.ph-card-x {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.04);
  color: var(--silk); cursor: pointer;
}
.ph-card-x:hover { border-color: rgba(216, 163, 94, 0.6); }
.ph-card-art {
  aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 3px #3b2814, 0 0 0 5px rgba(216, 163, 94, 0.55), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.ph-card-art canvas { display: block; width: 100%; height: 100%; }
.ph-card-body { min-width: 0; padding-right: 26px; }
.ph-card-num {
  font: 600 0.66rem/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--candle);
  margin: 6px 0 10px;
}
.ph-card-title {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.05rem); line-height: 1.1;
  color: var(--silk); margin-bottom: 12px; text-wrap: balance;
}
.ph-card-note { font-size: 0.98rem; line-height: 1.7; color: rgba(244, 233, 228, 0.86); margin-bottom: 18px; }
.ph-card-cta { font-size: 0.86rem; padding: 11px 18px; }
.ph-card-prompt {
  margin-top: 10px;
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: 0.95rem; line-height: 1.4; color: var(--rose-ash);
}
.ph-card-nav {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding-top: 14px; border-top: 1px solid var(--hairline);
}
.ph-card-step {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.03);
  color: var(--silk); cursor: pointer;
}
.ph-card-step:hover { border-color: rgba(216, 163, 94, 0.6); background: rgba(216, 163, 94, 0.1); }
.ph-card-count { min-width: 4.5em; text-align: center; font: 500 0.8rem/1 'Inter', system-ui, sans-serif; color: var(--rose-ash); }
@media (max-width: 640px) {
  .ph-card-scrim { align-items: flex-end; padding: 0; }
  .ph-card {
    grid-template-columns: 1fr; gap: 16px;
    padding: 56px 18px calc(14px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0; border-bottom: 0;
    max-height: 92dvh; overflow-y: auto;
    transform: translateY(40px);
  }
  .ph-card-art { aspect-ratio: auto; height: 150px; }
  .ph-card-body { padding-right: 0; }
  .ph-card-num { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-card-scrim, .ph-card { transition: none; }
  .ph-card.is-turn .ph-card-body, .ph-card.is-turn .ph-card-art { animation: none; }
}

/* IV. the wheel, its chips and its cards */
.ph-rasa {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  max-width: 1000px;
}
.ph-rasa figcaption { grid-column: 1 / -1; margin-top: 0; }
.ph-rasa-heart {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  transform: translate(-50%, -48%);
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: clamp(1.3rem, 3.2vw, 1.9rem);
  color: #f6dc96;
  text-shadow: 0 0 14px rgba(246, 220, 150, 0.45);
  pointer-events: none;
}
.ph-rasa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-rasa-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 9px;
  border: 1px solid var(--hairline); border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--silk);
  font: 500 0.82rem/1.2 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ph-rasa-chip::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(255, 236, 200, 0.4);
}
.ph-rasa-chip:hover { border-color: rgba(216, 163, 94, 0.45); }
.ph-rasa-chip[aria-pressed="true"] { background: rgba(216, 163, 94, 0.16); border-color: rgba(216, 163, 94, 0.7); }
.ph-rasa-cards { margin-top: 18px; }
.ph-rasa-card {
  padding: 20px 22px;
  min-height: 158px;
  border-radius: 18px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  animation: phCardIn 0.45s ease both;
}
.ph-rasa-card[hidden] { display: none; }
@keyframes phCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ph-rasa-name {
  margin-bottom: 8px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.55rem; line-height: 1.2; color: var(--silk);
}
.ph-rasa-name span { font-family: 'Tiro Devanagari Sanskrit', serif; color: var(--candle); margin-right: 8px; font-size: 0.92em; }
.ph-rasa-card p:not(.ph-rasa-name) { font-size: 0.98rem; line-height: 1.7; color: rgba(244, 233, 228, 0.85); }
.ph-rasa-card em { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.08em; color: #f3dcbd; }

/* VI. the Studio's painting, wordless, with the invitation over its left */
.ph-fig--town { position: relative; }
.ph-town-cta {
  position: absolute; z-index: 4;
  left: clamp(20px, 5%, 56px); top: 50%;
  transform: translateY(-50%);
  max-width: 50%;
}
.ph-town-line {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem); line-height: 1.12; text-wrap: balance;
  color: #fdf6e3;
  text-shadow: 0 2px 16px rgba(6, 8, 24, 0.85);
  margin-bottom: 18px;
}
.ph-town-line em { font-style: italic; color: #f6e27a; }
.ph-town-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Sources ── */
.ph-sources {
  max-width: 680px;
  margin: clamp(64px, 10vh, 100px) auto 0;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}
.ph-sources h2 {
  margin-bottom: 14px;
  font: 600 0.72rem/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--candle);
}
.ph-sources ul { padding-left: 1.2em; }
.ph-sources li { margin-bottom: 8px; font-size: 0.86rem; line-height: 1.65; color: var(--rose-ash); }

/* ── Phones ── */
@media (max-width: 860px) {
  .ph-rasa { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .ph-town-cta { max-width: 52%; }
}
@media (max-width: 640px) {
  .ph-toc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ph-toc a { font-size: 0.8rem; padding: 10px 12px; }
  .ph-art { border-radius: 16px; }
  .ph-art--lamps, .ph-art--kama, .ph-art--hands { aspect-ratio: 4 / 3; }
  .ph-art--mosaic { aspect-ratio: 1 / 1; }
  .ph-art--town { aspect-ratio: 16 / 10; }
  .ph-lamp-labels { bottom: 1.2%; }
  .ph-lamp-labels span { font-size: 0.5rem; letter-spacing: 0.12em; }
  .ph-lamp-labels b { display: none; }
  .ph-lamp-labels span:nth-child(1) { left: 14%; }
  .ph-lamp-labels span:nth-child(2) { left: 38%; }
  .ph-lamp-labels span:nth-child(3) { left: 62%; }
  .ph-lamp-labels span:nth-child(4) { left: 86%; }
  .ph-tile span { display: none; }
  .ph-arts-list { columns: 1; }
  .ph-town-cta { position: static; transform: none; max-width: none; margin-top: 18px; text-align: center; }
  .ph-town-line { text-shadow: none; }
  .ph-town-btns { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-art .ph-layer, .ph-art .kz-ib-layer, .ph-tile, .ph-tile span { transition: none; }
  .ph-rasa-card { animation: none; }
}
