/* ==========================================================================
   Enigma — Tretmani: skin decoder (input → rotors → result), ritual, menu
   ========================================================================== */

/* ---------- Decoder ---------- */
.decoder {
  display: grid; align-items: center; gap: var(--space-l) clamp(1.5rem, 3vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.95fr);
  grid-template-areas: "in machine out" "note note note";
  padding: var(--space-xl) var(--gutter);
}
.decoder__in { grid-area: in; display: grid; gap: 1.1rem; justify-items: start; }
.decoder__hint { color: var(--muted); }
.decoder__chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-block: 0.4rem 0.9rem; }
.decoder__machine { grid-area: machine; display: grid; justify-items: center; gap: 1.25rem; }
.decoder__machine .rotors { width: min(100%, 480px); }
.decoder__code { display: flex; gap: 1.4rem; font-family: var(--f-serif); font-size: clamp(2rem, 1.4rem + 1.6vw, 3rem); line-height: 1; color: var(--muted); }
.decoder__code span { min-width: 1ch; text-align: center; transition: color 500ms; }
.decoder.is-decoded .decoder__code span { color: var(--blush); }
.decoder__out { grid-area: out; min-height: 22rem; display: grid; align-content: center; }
.decoder__idle { display: grid; gap: 1rem; }
.decoder__wait { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem); line-height: 1.1; color: var(--muted); max-width: 14ch; }
.decoder__result { display: grid; gap: 1.1rem; justify-items: start; }
.decoder__name { font-family: var(--f-serif); font-size: clamp(2.3rem, 1.4rem + 2.6vw, 3.9rem); line-height: 0.98; letter-spacing: -0.01em; min-height: 1em; }
.decoder__why { color: var(--muted); max-width: 38ch; }
.decoder__more { display: grid; gap: 0.85rem; width: 100%; padding-top: 1rem; border-top: 1px solid var(--line); }
.decoder__more div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; }
.decoder__more dt { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.decoder__more a { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
.decoder__note { grid-area: note; font-size: var(--fs-small); color: var(--muted); text-align: center; }
.js .decoder__result.is-in > * { animation: rise 900ms var(--ease-out) both; }
.js .decoder__result.is-in > *:nth-child(2) { animation-delay: 60ms; }
.js .decoder__result.is-in > *:nth-child(3) { animation-delay: 160ms; }
.js .decoder__result.is-in > *:nth-child(4) { animation-delay: 260ms; }
.js .decoder__result.is-in > *:nth-child(5) { animation-delay: 360ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

@media (max-width: 1180px) {
  .decoder { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "in machine" "out out" "note note"; }
  .decoder__out { min-height: 0; }
}
@media (max-width: 760px) {
  .decoder { grid-template-columns: 1fr; grid-template-areas: "in" "machine" "out" "note"; }
  .decoder__machine .rotors { width: min(86vw, 400px); }
  .decoder__note { text-align: left; }
}

/* ---------- Ritual ---------- */
.ritual { padding: var(--space-xl) var(--gutter) var(--space-l); }

/* ---------- Treatment menu ---------- */
.tmenu { padding: var(--space-m) var(--gutter) var(--space-xl); }
.tgroup {
  display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.6fr); gap: var(--space-l);
  padding-block: var(--space-l); border-top: 1px solid var(--line);
}
.tgroup__head { position: sticky; top: calc(var(--nav-h) + 1.5rem); align-self: start; display: grid; gap: 0.9rem; }
.tgroup__title { font-family: var(--f-serif); font-size: var(--fs-h2); line-height: 0.95; }
.tgroup__blurb { color: var(--muted); max-width: 30ch; }
.tlist { display: grid; }
.tr {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head book" "lead book" "for book";
  gap: 0.55rem 2rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 2rem);
}
.tr__head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.9rem; }
.tr__name { font-family: var(--f-serif); font-size: var(--fs-h3); }
.tr__name a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--t-med) var(--ease-out); }
.tr__name a:hover { background-size: 100% 1px; }
.tr__badge { padding: 0.2rem 0.65rem; border-radius: var(--r-pill); background: var(--fuchsia); color: var(--milk); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.tr__brand { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.tr__lead { grid-area: lead; color: var(--muted); max-width: 60ch; }
.tr__for { grid-area: for; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tr__for span { padding: 0.18rem 0.7rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.8rem; }
.tr__book {
  grid-area: book; align-self: center; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.65rem 1.1rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 0.9rem; font-weight: 600; transition: background-color var(--t-med), color var(--t-med), box-shadow var(--t-med);
}
.tr__book:hover { background: var(--fuchsia); color: var(--milk); box-shadow: none; }
.tr__book .arrow { transition: transform var(--t-med) var(--ease-out); }
.tr__book:hover .arrow { transform: translateX(3px); }
.tr:target .tr__name { color: var(--fuchsia); }
.tmenu__price { padding-top: var(--space-m); font-family: var(--f-serif); font-size: clamp(1.3rem, 1rem + 0.9vw, 1.9rem); line-height: 1.2; max-width: 40ch; }
.tmenu__price a { font-family: var(--f-sans); font-size: 1rem; white-space: nowrap; }

@media (max-width: 860px) {
  .tgroup { grid-template-columns: 1fr; gap: var(--space-m); }
  .tgroup__head { position: static; }
  .tr { grid-template-columns: 1fr; grid-template-areas: "head" "lead" "for" "book"; }
  .tr__book { justify-self: start; margin-top: 0.4rem; }
}

.btn[aria-disabled="true"] { opacity: 0.55; cursor: progress; }
