/* ==========================================================================
   Shared components: links, placeholders, product tiles, chatbot
   ========================================================================== */

/* --- Inline arrow link --- */
.text-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-weight: 500;
  color: var(--color-gold-deep);
  background-image: var(--gold-hairline);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  padding-bottom: 2px;
  transition: background-size 220ms cubic-bezier(0.3, 0.7, 0.2, 1), gap var(--transition-fast);
}

.text-link:hover,
.text-link:focus-visible {
  background-size: 100% 1px;
  gap: 0.65em;
}

.text-link--on-dark {
  color: var(--color-gold-light);
}

/* --- Gold hairline rule --- */
.rule {
  display: block;
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--gold-hairline);
}

/* --- "To be confirmed" marker ---
   Real facts that aren't supplied yet. Visibly distinct (dotted underline,
   muted italic, a small label) but typeset like the rest of the page. */
.tbc {
  font-style: italic;
  color: var(--color-text-muted);
  text-decoration: underline dotted var(--color-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.tbc::after {
  content: "to be confirmed";
  margin-left: 0.6em;
  padding: 0.05em 0.5em 0.15em;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: 0.15em;
  color: var(--color-gold-deep);
  border: 1px solid rgba(var(--gold-rgb), 0.5);
  border-radius: 999px;
  text-decoration: none;
  display: inline-block;
}

.tbc--on-dark {
  color: var(--color-text-on-dark-muted);
}

.tbc--on-dark::after {
  color: var(--color-gold-light);
}

.tbc--bare::after {
  content: none;
}

/* ==========================================================================
   Product tile: image-led, hover reveals description + CTA
   One easing and a deliberate ~400ms pace for every part of the hover, so
   the zoom, the overlay and the gold line read as one movement.
   ========================================================================== */

.ptile {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  background-color: var(--color-charcoal);
  color: var(--color-cream);
  border-radius: 2px;
  --ptile-ease: cubic-bezier(0.25, 0.7, 0.2, 1);
  --ptile-dur: 400ms;
}

.ptile__media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(var(--gold-rgb), 0.16), transparent 62%),
    linear-gradient(180deg, var(--color-charcoal-soft), var(--color-charcoal));
  transition: transform var(--ptile-dur) var(--ptile-ease);
}

.ptile__media img {
  width: 72%;
  transform: translateY(-17%);
}

/* dark wash that deepens on hover so text stays legible */
.ptile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(var(--charcoal-rgb), 0) 35%, rgba(var(--charcoal-rgb), 0.92) 100%);
  transition: opacity var(--ptile-dur) var(--ptile-ease);
  opacity: 0.85;
}

.ptile__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: var(--space-lg);
}

/* Gold accent line: drawn from nothing to full width on hover */
.ptile__line {
  display: block;
  width: 100%;
  height: 1px;
  margin-bottom: var(--space-sm);
  background: var(--gold-hairline);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ptile-dur) var(--ptile-ease);
}

.ptile__name {
  font-size: clamp(1.5rem, 1.2vw + 1rem, 2rem);
  color: var(--color-cream);
}

.ptile__reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--ptile-dur) var(--ptile-ease), opacity 360ms ease-out;
}

.ptile__reveal > div {
  overflow: hidden;
}

.ptile__desc {
  padding-top: var(--space-xs);
  max-width: 34ch;
  font-size: 0.9375rem;
  color: var(--color-text-on-dark-muted);
}

.ptile__cta {
  display: inline-block;
  margin-top: var(--space-sm);
  font-weight: 500;
  color: var(--color-gold-light);
}

.ptile:hover .ptile__media,
.ptile:focus-visible .ptile__media {
  transform: scale(1.06) translateY(-2%);
}

.ptile:hover::after,
.ptile:focus-visible::after {
  opacity: 1;
}

.ptile:hover .ptile__line,
.ptile:focus-visible .ptile__line {
  transform: scaleX(1);
  transition-delay: 60ms; /* lands just after the zoom starts */
}

.ptile:hover .ptile__reveal,
.ptile:focus-visible .ptile__reveal {
  grid-template-rows: 1fr;
  opacity: 1;
}

.ptile:focus-visible {
  outline: 1px solid var(--color-gold-light);
  outline-offset: 3px;
}

/* Typographic tile (no product photo): light ground, line drawing */
.ptile--plain {
  background: var(--color-ivory);
  color: var(--color-text);
  border: 1px solid var(--color-grey-light);
}

.ptile--plain::after {
  background: linear-gradient(180deg, rgba(var(--cream-rgb), 0) 40%, rgba(var(--cream-rgb), 0.96) 78%);
}

.ptile--plain .ptile__media {
  background: none;
  color: var(--color-gold);
  place-items: start center;
  padding-top: 12%;
}

.ptile--plain .ptile__media svg {
  width: 52%;
}

.ptile--plain .ptile__name {
  color: var(--color-text);
}

.ptile--plain .ptile__desc {
  color: var(--color-text-muted);
}

.ptile--plain .ptile__cta {
  color: var(--color-gold-deep);
}

.ptile--plain:focus-visible {
  outline-color: var(--color-gold);
}

/* Reserved slot for a category not yet announced */
.ptile--reserved {
  background: var(--color-cream);
  color: var(--color-text);
  border: 1px solid var(--color-grey-light);
}

.ptile--reserved::after {
  content: none;
}

.ptile--reserved .ptile__media {
  background: none;
  font-family: var(--font-display);
  font-size: clamp(5rem, 8vw, 8rem);
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-grey-light);
}

.ptile--reserved .ptile__name {
  color: var(--color-text);
}

.ptile--reserved .ptile__desc {
  color: var(--color-text-muted);
}

.ptile--reserved .ptile__cta {
  color: var(--color-gold-deep);
}

/* Touch screens have no hover: show the reveal content by default */
@media (hover: none) {
  .ptile::after {
    opacity: 1;
  }

  .ptile__reveal {
    grid-template-rows: 1fr;
    opacity: 1;
  }

  .ptile__line {
    transform: none;
  }

  .ptile__media {
    place-items: start center;
    padding-top: 10%;
  }

  .ptile__media img {
    width: 68%;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ptile__media,
  .ptile__reveal,
  .ptile__line,
  .ptile::after {
    transition: none;
  }
}

/* ==========================================================================
   Chatbot: bottom-right, closed by default, opens only on click
   ========================================================================== */

.chat {
  position: fixed;
  right: max(var(--space-md), env(safe-area-inset-right, 0px));
  bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
  font-family: var(--font-body);
}

.chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  height: 52px;
  padding: 0 var(--space-md) 0 var(--space-sm);
  border-radius: 999px;
  background-color: var(--color-charcoal);
  color: var(--color-cream);
  box-shadow: 0 10px 30px rgba(var(--charcoal-rgb), 0.28);
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.chat__launcher:hover {
  transform: translateY(-2px);
  border-color: var(--color-gold-light);
}

.chat__launcher svg {
  width: 22px;
  height: 22px;
  color: var(--color-gold-light);
}

.chat__launcher-close {
  display: none;
}

.chat.is-open .chat__launcher-open {
  display: none;
}

.chat.is-open .chat__launcher-close {
  display: inline;
}

.chat__panel {
  width: min(360px, calc(100vw - 2 * var(--space-md)));
  max-height: min(540px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background-color: var(--color-ivory);
  border: 1px solid var(--color-grey-light);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(var(--charcoal-rgb), 0.22);
  overflow: hidden;
  transform-origin: bottom right;
  animation: chat-in 220ms ease-out;
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* Automatic open: a longer slide up and in from the corner */
.chat--auto .chat__panel {
  animation: chat-slide-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes chat-slide-in {
  from {
    opacity: 0;
    transform: translate(24px, 32px) scale(0.96);
  }
}

.chat__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-charcoal);
  color: var(--color-cream);
  border-bottom: 1px solid transparent;
  border-image: var(--gold-hairline) 1;
}

.chat__head img {
  width: 30px;
  height: auto;
  background: var(--color-cream);
  border-radius: 4px;
  padding: 3px;
}

.chat__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  line-height: 1.2;
}

.chat__subtitle {
  font-size: var(--fs-xs);
  color: var(--color-text-on-dark-muted);
}

.chat__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-text-on-dark-muted);
}

.chat__close:hover {
  color: var(--color-cream);
  background-color: var(--color-charcoal-soft);
}

.chat__close svg {
  width: 14px;
  height: 14px;
}

.chat__log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat__msg {
  max-width: 88%;
  padding: 0.65em 0.9em;
  font-size: 0.9375rem;
  line-height: 1.45;
  border-radius: 4px;
}

.chat__msg--bot {
  align-self: flex-start;
  background-color: var(--color-white);
  border: 1px solid var(--color-grey-light);
}

.chat__msg--user {
  align-self: flex-end;
  background-color: var(--color-charcoal);
  color: var(--color-cream);
}

.chat__msg a {
  display: inline-block;
  margin-top: var(--space-2xs);
  font-weight: 500;
  color: var(--color-gold-deep);
}

.chat__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-top: 1px solid var(--color-grey-light);
}

.chat__option {
  padding: 0.45em 0.9em;
  font-size: var(--fs-sm);
  border: 1px solid var(--color-gold);
  border-radius: 999px;
  color: var(--color-gold-deep);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.chat__option:hover,
.chat__option:focus-visible {
  background-color: var(--color-charcoal);
  border-color: var(--color-charcoal);
  color: var(--color-cream);
}

/* Tucked away while the hero fills the bottom of the viewport (js/chat.js),
   so the launcher never sits on top of hero content. */
.chat__launcher {
  transition: transform var(--transition-fast), border-color var(--transition-fast), opacity 200ms ease, visibility 0s;
}

.chat--tucked .chat__launcher {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.92);
  transition: transform 200ms ease, opacity 200ms ease, visibility 0s linear 200ms;
}

@media (max-width: 560px) {
  .chat__launcher-label {
    display: none;
  }

  .chat__launcher {
    width: 52px;
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat__panel,
  .chat--auto .chat__panel {
    animation: none;
  }
}

/* ==========================================================================
   FAQ accordion (home and About)
   ========================================================================== */

.faq__list {
  border-top: 1px solid rgba(var(--charcoal-rgb), 0.16);
}

.faq-item {
  border-bottom: 1px solid rgba(var(--charcoal-rgb), 0.16);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-md);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  cursor: pointer;
  list-style: none;
  transition: color var(--transition-fast);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(var(--color-gold), var(--color-gold)) center / 12px 1px no-repeat,
    linear-gradient(var(--color-gold), var(--color-gold)) center / 1px 12px no-repeat;
  transition: transform var(--transition-base);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: var(--color-gold-deep);
}

.faq-item p {
  max-width: 60ch;
  padding-bottom: var(--space-md);
  color: var(--color-text-muted);
}

/* ==========================================================================
   Shared page sections: headings, catalogue row, quote band
   ========================================================================== */

.h-section {
  font-size: clamp(2rem, 2.4vw + 1rem, 3rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.btn-outline--on-dark {
  --btn-fill: var(--color-cream);
  color: var(--color-cream);
  border-color: rgba(var(--cream-rgb), 0.4);
}

.btn-outline--on-dark:hover,
.btn-outline--on-dark:focus-visible {
  border-color: var(--color-cream);
  color: var(--color-charcoal);
}

/* --- Catalogue row --- */
.catalogue {
  padding-block: var(--space-md) var(--space-3xl);
}

.catalogue__row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) auto;
  align-items: center;
  gap: var(--space-xl);
  padding-block: var(--space-xl);
  border-block: 1px solid var(--color-grey-light);
}

.catalogue__title {
  font-size: var(--fs-2xl);
  font-style: italic;
  font-weight: 400;
}

.catalogue__text {
  color: var(--color-text-muted);
}

.catalogue__actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* --- Quote band --- */
.quote-band {
  background-color: var(--color-charcoal);
  color: var(--color-cream);
}

.quote-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-block: var(--space-3xl);
}

.quote-band h2 {
  font-size: clamp(1.9rem, 2.6vw + 1rem, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-cream);
}

.quote-band h2 em {
  color: var(--color-gold-light);
}

@media (max-width: 1100px) {
  .catalogue__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }

  .catalogue__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .catalogue__row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

@media (max-width: 560px) {
  .catalogue__actions {
    flex-wrap: wrap;
  }
}
