/* ===================================================================
   Ritus Candelabrum - inner pages
   Shop, oracle, tokens, about, legal.
   =================================================================== */

/* =================================================== page header */
.page-head {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 7vw, 5rem));
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  overflow: hidden;
}

.page-head::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  width: min(900px, 120vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(233, 169, 63, 0.13), transparent 62%);
  pointer-events: none;
}

.page-head > * { position: relative; }
.page-head h1 { margin-top: 0.9rem; }
.page-head .lede { margin: 1.2rem auto 0; }

/* =================================================== product grid */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
}

.product {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, rgba(255, 233, 205, 0.045), rgba(10, 6, 14, 0.55) 60%);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease-out);
}

.product:hover {
  border-color: var(--line);
  transform: translateY(-4px);
}

.product__media {
  position: relative;
  aspect-ratio: 4 / 5;   /* source photos are 3:4, so this crops barely at all */
  overflow: hidden;
  background: var(--void-2);
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transition: transform 0.8s var(--ease-out), opacity 0.3s var(--ease);
}

.product:hover .product__media img { transform: scale(1.04); }

.product__hue {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.8em;
  border-radius: var(--r-pill);
  background: rgba(8, 5, 11, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  color: var(--ink-1);
}

.product__body {
  padding: 1.3rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.product__latin {
  font-family: var(--font-roman);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.product__name {
  font-family: var(--font-display);
  font-size: 1.85rem;
  color: var(--ink-1);
  line-height: 1;
}

.product__intent {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gold-hot);
  font-size: 0.94rem;
  font-family: var(--font-display);
  font-style: italic;
}

.product__icon { width: 21px; height: 21px; flex: none; opacity: 0.95; }

/* =================================================== size chooser
   The two lengths drawn to scale, so the choice is visible at a glance. */
.size-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.size-opts input { position: absolute; opacity: 0; pointer-events: none; }

.size-opts label {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.9rem 0.6rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  background: rgba(255, 233, 205, 0.02);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease-out);
}

.size-opts label:hover { border-color: var(--line); transform: translateY(-2px); }

.size-opts input:checked + label {
  border-color: var(--gold);
  background: rgba(233, 169, 63, 0.12);
}

.size-opts input:focus-visible + label { outline: 2px solid var(--gold-hot); outline-offset: 2px; }

.size-fig { width: 34px; height: 72px; margin-bottom: 0.35rem; }
.size-fig__body { opacity: 0.85; stroke: rgba(255, 233, 205, 0.35); stroke-width: 1; }
.size-fig__wick { stroke: var(--ink-3); stroke-width: 1.2; }

.size-fig__flame {
  fill: #ffc46a;
  opacity: 0.55;
  transform-origin: 17px 12px;
}

.size-opts input:checked + label .size-fig__flame {
  fill: #ffdc9a;
  opacity: 1;
  animation: flicker 2.4s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); }
  35% { transform: scaleY(1.09) scaleX(0.96); }
  70% { transform: scaleY(0.95) scaleX(1.03); }
}

.size-opt__name {
  font-family: var(--font-roman);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-1);
}

.size-opt__meta { font-size: 0.74rem; color: var(--ink-3); }

.size-opt__price {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold-hot);
  margin-top: 0.15rem;
}

.product__text {
  font-size: 0.86rem;
  color: var(--ink-3);
  line-height: 1.55;
}

.product__more {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-roman);
  text-align: left;
  align-self: start;
}

.product__more:hover { color: var(--gold-hot); }

.product__sizes { margin-top: auto; padding-top: 0.4rem; }

.product__buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}

.product__price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.product__price small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* =================================================== filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: clamp(1.6rem, 4vw, 2.6rem);
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 1em;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink-3);
  font-size: 0.8rem;
  transition: all 0.25s var(--ease);
}

.filter:hover { color: var(--ink-1); border-color: var(--line); }

.filter[aria-pressed='true'] {
  color: var(--gold-hot);
  border-color: var(--line-strong);
  background: rgba(233, 169, 63, 0.1);
}

/* =================================================== info strip */
.info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--s-5);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: rgba(255, 233, 205, 0.022);
}

.info-strip h4 {
  font-family: var(--font-roman);
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.info-strip p { font-size: 0.88rem; color: var(--ink-3); }

/* =================================================== oracle hub */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: clamp(0.9rem, 1.8vw, 1.4rem);
}

.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem 1.4rem;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(255, 233, 205, 0.04), rgba(10, 6, 14, 0.5));
  color: inherit;
  overflow: hidden;
  isolation: isolate;   /* contains the card-crown's negative z-index */
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease-out), background 0.35s;
}

.tool:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
  background: linear-gradient(165deg, rgba(255, 233, 205, 0.07), rgba(10, 6, 14, 0.5));
}

.tool__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tool__art {
  width: 44px;
  height: 44px;
  color: var(--gold);
  transition: color 0.35s var(--ease), transform 0.35s var(--ease-out);
}

.tool:hover .tool__art { transform: scale(1.07); }   /* colour comes from the card tint */

.tool__latin {
  font-family: var(--font-roman);
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-1);
}

.tool__name {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-hot);
  font-size: 1rem;
  margin-top: -0.2rem;
}

.tool__blurb { font-size: 0.88rem; color: var(--ink-3); line-height: 1.55; }

.tool__top { align-items: flex-start; }

/* =================================================== tool panel */
.tool-panel { display: none; }
.tool-panel.is-open { display: block; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: none;
  border: 0;
  color: var(--ink-3);
  font-family: var(--font-roman);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.4rem 0;
}

.back-btn:hover { color: var(--gold-hot); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--s-4);
}

.form-grid--wide { grid-template-columns: 1fr; }

/* =================================================== results */
.result {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-4);
}

.tarot-card {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(170deg, rgba(233, 169, 63, 0.07), rgba(10, 6, 14, 0.6));
  animation: flip-in 0.7s var(--ease-out) backwards;
}

.tarot-card:nth-child(2) { animation-delay: 0.14s; }
.tarot-card:nth-child(3) { animation-delay: 0.28s; }

@keyframes flip-in {
  from { opacity: 0; transform: rotateY(28deg) translateY(16px); }
}

.tarot-card__pos {
  font-family: var(--font-roman);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.tarot-card__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink-1);
  margin: 0.5rem 0 0.6rem;
  line-height: 1.1;
}

.tarot-card__text { font-size: 0.88rem; color: var(--ink-2); line-height: 1.55; }

.score {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-display);
}

.score__value { font-size: 3.4rem; color: var(--gold-hot); line-height: 1; }
.score__max { font-size: 1.1rem; color: var(--ink-4); }

.meter {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 233, 205, 0.1);
  overflow: hidden;
  margin-top: 0.9rem;
}

.meter__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ember), var(--gold-hot));
  width: 0;
  transition: width 1.2s var(--ease-out);
}

.reading-block + .reading-block { margin-top: var(--s-4); }

.reading-block h4 {
  font-family: var(--font-roman);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.reading-block p { font-size: 0.94rem; }

/* recommendation */
.reco {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(233, 169, 63, 0.06);
  flex-wrap: wrap;
}

.reco img {
  width: 74px;
  height: 74px;
  border-radius: var(--r-sm);
  object-fit: cover;
  border: 1px solid var(--line-soft);
}

.reco__body { flex: 1; min-width: 170px; }
.reco__label { font-family: var(--font-roman); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); }
.reco__name { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink-1); }
.reco__why { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.2rem; }

/* upload */
.upload {
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 2rem 1.4rem;
  text-align: center;
  background: rgba(255, 233, 205, 0.02);
  transition: border-color 0.3s var(--ease), background 0.3s;
}

.upload.is-hot { border-color: var(--gold); background: rgba(233, 169, 63, 0.07); }
.upload__preview { max-width: 210px; margin: 0 auto 1rem; border-radius: var(--r-md); overflow: hidden; }

/* =================================================== token plans */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: var(--s-4);
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem 1.3rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: rgba(255, 233, 205, 0.022);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease-out);
}

.plan:hover { border-color: var(--line); transform: translateY(-4px); }

.plan--featured {
  border-color: var(--line-strong);
  background: linear-gradient(170deg, rgba(233, 169, 63, 0.12), rgba(10, 6, 14, 0.6));
}

.plan__badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3em 0.8em;
  border-radius: var(--r-pill);
  background: var(--gold);
  color: #2a1403;
  font-family: var(--font-roman);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan__tokens {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  color: var(--ink-1);
}

.plan__unit { font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em; font-family: var(--font-roman); }
.plan__price { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold-hot); margin-top: 0.4rem; }

.plan__value { margin-top: 0.5rem; }

.plan__bar {
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 233, 205, 0.08);
  overflow: hidden;
}

.plan__bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ember), var(--gold-hot));
}

.plan__each {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-top: 0.45rem;
}

.plan__each strong { color: var(--ink-1); font-weight: 600; }

.plan__save {
  font-style: normal;
  color: #83c48d;
  border: 1px solid rgba(131, 196, 141, 0.34);
  background: rgba(131, 196, 141, 0.1);
  border-radius: var(--r-pill);
  padding: 0.1em 0.5em;
  font-size: 0.7rem;
}

.plan__note { font-size: 0.82rem; color: var(--ink-3); margin-top: 0.2rem; }
.plan .btn { margin-top: auto; }

/* balance strip */
.balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(233, 169, 63, 0.07);
}

.balance__value { font-family: var(--font-display); font-size: 1.9rem; color: var(--ink-1); line-height: 1; }
.balance__label { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.1em; }

/* =================================================== faq */
.faq { display: grid; gap: 0.6rem; }

.faq details {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: rgba(255, 233, 205, 0.022);
  overflow: hidden;
}

.faq summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  color: var(--ink-1);
  font-family: var(--font-display);
  font-size: 1.12rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '+';
  color: var(--gold);
  font-size: 1.2rem;
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after { transform: rotate(45deg); }

/* answers slide open instead of popping (progressive: browsers without
   ::details-content animation simply open instantly) */
.faq { interpolate-size: allow-keywords; }

.faq details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.32s var(--ease-out), content-visibility 0.32s allow-discrete;
}

.faq details[open]::details-content { block-size: auto; }
.faq details > p { padding: 0 1.2rem 1.1rem; font-size: 0.92rem; color: var(--ink-3); }

/* =================================================== prose (legal, about) */
.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-6); margin-bottom: var(--s-3); }
.prose h3 { margin-top: var(--s-5); margin-bottom: var(--s-2); }
.prose p + p { margin-top: var(--s-3); }
.prose ul { margin: var(--s-3) 0; display: grid; gap: 0.5rem; }

.prose ul li {
  padding-left: 1.2rem;
  position: relative;
  font-size: 0.95rem;
}

.prose ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold-deep);
  font-size: 0.7rem;
  top: 0.35em;
}

.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* =================================================== success */
.success-mark {
  width: 78px;
  height: 78px;
  margin: 0 auto var(--s-5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 40% 34%, #fff1cd, #ffc46a 30%, #ef8a24 58%, #8e2e10);
  box-shadow: 0 0 60px -10px rgba(233, 169, 63, 0.8);
  animation: rise 1s var(--ease-out);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
}

.order-lines {
  display: grid;
  gap: 0.6rem;
  margin-top: var(--s-4);
  text-align: left;
}

.order-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 233, 205, 0.022);
  font-size: 0.9rem;
}

/* =================================================== mobile */
@media (max-width: 900px) {
  /* the page header was eating a whole screen before any content */
  .page-head {
    padding-top: calc(var(--nav-h) + 1.6rem);
    padding-bottom: 1.4rem;
  }

  .page-head h1 { font-size: clamp(1.75rem, 7.2vw, 2.3rem); }
  .page-head .lede { font-size: 1rem; line-height: 1.55; }

  /* a pill radius on a stacked block reads as a giant stadium */
  .balance {
    border-radius: var(--r-lg);
    padding: 1.1rem 1.2rem;
    gap: 1rem;
  }

  .balance .btn { width: 100%; }
  .balance__label { letter-spacing: 0; line-height: 1.5; }

  /* back first, the way every mobile detail view works */
  .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
  }

  .panel-head .back-btn {
    order: -1;
    align-self: flex-start;
    min-height: 44px;
    padding: 0.5rem 0;
  }

  .filter { min-height: 44px; }

  .product__more { min-height: 44px; display: inline-flex; align-items: center; }

  /* shorter media so the price and the buy button are reachable sooner */
  .product__media { aspect-ratio: 1 / 1; }

  .tools { gap: 0.8rem; }

  .info-strip { gap: var(--s-4); }

  .faq summary { min-height: 52px; }

  .plan { padding: 1.4rem 1.2rem; }

  /* labels that carry real information should not be the smallest thing
     on a phone screen */
  .plan__badge,
  .plan__save { font-size: 0.8rem; }

  .plan__each { font-size: 0.85rem; }

  .size-opt__name,
  .size-opt__meta { font-size: 0.82rem; }

  .product__latin { font-size: 0.8rem; }
  .product__price small { font-size: 0.8rem; }

  /* a link that is the whole paragraph is a target, not prose */
  .info-strip p > a:only-child {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}
