/* ── /features — the Periodic Table of Event Management ── */

/* Family colors. Each column sets --c (accent) and its tiles derive tint,
   border and glow from it. */
[data-fam="tix"] { --c: #34d399; }
[data-fam="add"] { --c: #fbbf24; }
[data-fam="buy"] { --c: #22d3ee; }
[data-fam="pay"] { --c: #a3e635; }
[data-fam="aff"] { --c: #f472b6; }
[data-fam="mkt"] { --c: #fb923c; }
[data-fam="trk"] { --c: #818cf8; }
[data-fam="web"] { --c: #60a5fa; }
[data-fam="acc"] { --c: #e879f9; }
[data-fam="ven"] { --c: #f87171; }
[data-fam="ai"]  { --c: #c4b5fd; }

.pt-shell {
  max-width: 1300px; margin: 0 auto;
  padding: clamp(88px, 11vh, 108px) clamp(16px, 3vw, 40px) 56px;
}
.pt-pagebar { display: flex; align-items: center; justify-content: space-between; margin: -18px 0 10px; }
.pt-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px 7px 11px;
  border: 1px solid rgba(110, 231, 183, 0.35); border-radius: 999px; background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7; font-weight: 600; font-size: .9rem; text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.pt-back svg { width: 16px; height: 16px; }
.pt-back:hover, .pt-back:focus-visible { background: rgba(16, 185, 129, 0.18); border-color: #6ee7b7; }
.pt-pagebar .pt-page-close { position: static; }
.pt-head { max-width: 1200px; margin: 0 auto 28px; text-align: center; }
.pt-head h1, .pt-head h2 {
  font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08;
  color: #6ee7b7; text-shadow: 0 0 50px rgba(16, 185, 129, 0.28);
  margin-bottom: 14px;
}
.pt-lede { max-width: 760px; margin: 0 auto; color: rgba(236, 253, 245, 0.72); line-height: 1.6; font-size: 1.05rem; }

.pt-wrap { container-type: inline-size; }
.pt-desc { display: none; }

/* Shared tile look for features and category tiles */
.pt-el button, .pt-cat {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 100%; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-radius: 8px;
  color: #ecfdf5; text-align: left; cursor: pointer;
  position: relative;
  transition: transform .18s ease, border-color .18s ease;
}
.pt-el button {
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, #0a0a0a), color-mix(in srgb, var(--c) 5%, #0a0a0a));
}
/* The lit state (full-color border, 1px ring, glow) lives on a ::before that
   fades in with opacity, so a hover is a compositor animation. Transitioning
   border-color and box-shadow on the tile itself repainted it (and its 22px
   glow) on every frame of every hover. The ::before covers the tile's border
   box (inset: -1px) and its opaque border paints over the tile's own border. */
.pt-el button::before, .pt-cat::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 0 22px color-mix(in srgb, var(--c) 40%, transparent);
  opacity: 0; transition: opacity .18s ease;
}
.pt-el button:hover, .pt-el button:focus-visible, .pt-el.is-focus button,
.pt-cat:hover, .pt-cat:focus-visible, .pt-cat.is-focus {
  transform: translateY(-2px);
}
.pt-el button:hover::before, .pt-el button:focus-visible::before, .pt-el.is-focus button::before,
.pt-cat:hover::before, .pt-cat:focus-visible::before, .pt-cat.is-focus::before { opacity: 1; }
/* Hovering a category lights up the features stacked above it. */
.pt-col:has(.pt-cat:hover) .pt-el button,
.pt-col:has(.pt-cat.is-focus) .pt-el button { border-color: color-mix(in srgb, var(--c) 70%, transparent); }

.pt-sym { font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--c); }
.pt-name { line-height: 1.15; color: rgba(236, 253, 245, 0.82); }

/* The roll-up tile: solid family color, dark type */
.pt-cat {
  background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 72%, #0a0a0a));
  border-color: var(--c);
}
.pt-cat .pt-sym { color: #0a0a0a; }
.pt-cat .pt-name { color: #0a0a0a; font-weight: 600; }
.pt-count { font-size: .68rem; font-weight: 600; color: rgba(10, 10, 10, 0.62); font-variant-numeric: tabular-nums; }

/* Wide: one column per family, features stacked above a bottom swimlane
   of category tiles. */
@container (min-width: 900px) {
  .pt-table {
    display: grid; grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.7cqi;
  }
  .pt-col { display: flex; flex-direction: column; justify-content: flex-end; }
  .pt-stack { list-style: none; display: flex; flex-direction: column; gap: 0.7cqi; }
  .pt-el button, .pt-cat { aspect-ratio: 1 / 0.86; padding: 0.6cqi 0.7cqi 0.65cqi; border-radius: 0.6cqi; }
  .pt-el .pt-sym { font-size: 2.2cqi; margin-top: auto; margin-bottom: 0.5cqi; }
  .pt-el .pt-name { font-size: max(.6rem, 0.82cqi); min-height: 2.3em; }
  .pt-cat { margin-top: 1.8cqi; position: relative; }
  .pt-cat .pt-sym { font-size: 2.6cqi; }
  .pt-cat .pt-name { font-size: max(.62rem, 0.88cqi); min-height: 2.3em; }
  .pt-count { font-size: max(.55rem, 0.7cqi); }
  /* Hover hint so it's obvious the tiles open something */
  .pt-el button, .pt-cat { position: relative; }
  .pt-el button::after, .pt-cat::after {
    content: "Learn More"; position: absolute; top: 0.55cqi; right: 0.6cqi;
    padding: 0.15cqi 0.45cqi; border-radius: 999px;
    font-size: max(.5rem, 0.62cqi); font-weight: 600; letter-spacing: .02em; white-space: nowrap;
    background: rgba(236, 253, 245, 0.12); color: rgba(236, 253, 245, 0.72);
    opacity: 0; transform: translateY(-2px); transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
  }
  .pt-cat::after { background: rgba(10, 10, 10, 0.82); color: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
  .pt-el button:hover::after, .pt-el button:focus-visible::after,
  .pt-cat:hover::after, .pt-cat:focus-visible::after { opacity: 1; transform: none; }
  /* The swimlane rule between features and categories */
  .pt-table { position: relative; }
  /* Hung off the first column's stack (the category tile's ::before is now its
     glow). Same spot as before: the stack ends 1.8cqi above the category tile,
     and the line sat 0.9cqi above the tile's padding box. */
  .pt-col:first-child .pt-stack { position: relative; }
  .pt-col:first-child .pt-stack::after {
    content: ""; position: absolute; left: 1px; width: calc(100cqi); top: calc(100% + 0.9cqi + 1px);
    border-top: 1px dashed rgba(236, 253, 245, 0.16);
  }

  /* align-items: stretch (not center) keeps each line's box full-width, so
     swapping its text on hover doesn't move the box; centered shrink-to-fit
     spans changed x on every hover and counted as layout shifts (CLS). */
  .pt-detail {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    min-height: 84px; margin: 22px auto 0; max-width: 680px; text-align: center;
  }
  .pt-detail-fam { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c, #6ee7b7); }
  .pt-detail-name { font-size: 1.3rem; font-weight: 600; color: #ecfdf5; }
  .pt-detail-desc { color: rgba(236, 253, 245, 0.72); line-height: 1.5; }
}

/* Narrow: each family becomes a block, category tile first, features below
   with their descriptions shown inline (no hover on phones). */
@container (max-width: 899.98px) {
  .pt-table { display: flex; flex-direction: column; gap: 22px; }
  .pt-col { display: flex; flex-direction: column; gap: 8px; }
  .pt-cat {
    order: -1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
    column-gap: 14px; align-items: center; padding: 12px 14px;
  }
  .pt-cat .pt-sym { grid-row: 1 / span 2; font-size: 2rem; }
  .pt-cat .pt-name { font-size: 1.05rem; }
  .pt-cat .pt-count { grid-column: 2; grid-row: 2; }
  .pt-stack { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
  .pt-el button {
    display: grid; grid-template-columns: 2.4rem 1fr; grid-template-rows: auto 1fr; column-gap: 10px; align-items: start;
    padding: 10px 12px; height: 100%;
  }
  .pt-el .pt-sym { grid-row: 1 / span 2; font-size: 1.35rem; padding-top: 2px; }
  .pt-el .pt-name { font-size: .95rem; font-weight: 600; color: #ecfdf5; }
  .pt-el .pt-desc { display: block; font-size: .84rem; line-height: 1.4; color: rgba(236, 253, 245, 0.65); margin-top: 2px; }
  .pt-el button:hover, .pt-cat:hover { transform: none; }
  .pt-detail { display: none; }
}

/* ── Category modal (reuses the Feature Guide carousel styles in styles.css) ── */
.pt-modal { width: min(980px, calc(100vw - 32px)); }
.pt-modal .modal-card {
  border-color: color-mix(in srgb, var(--c) 35%, transparent);
  box-shadow: 0 0 90px color-mix(in srgb, var(--c) 16%, transparent), 0 26px 60px rgba(0, 0, 0, 0.55);
}
.pt-modal-head { display: flex; align-items: center; gap: 16px; padding-right: 48px; }
.pt-modal-head h3 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c); }
.pt-modal-head .modal-sub { margin-top: 2px; }
.pt-modal-badge {
  flex: none; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 10px;
  background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 72%, #0a0a0a));
  color: #0a0a0a; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
}
.pt-modal .car-title { color: var(--c); }
.pt-modal .car-caption { max-width: 780px; margin-left: auto; margin-right: auto; line-height: 1.5; }
.pt-modal .car-info { min-height: 76px; }
.pt-modal .car-media { border-color: color-mix(in srgb, var(--c) 22%, transparent); }
.pt-modal .car-arrow { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.pt-modal .car-arrow:hover, .pt-modal .car-arrow:focus-visible {
  background: color-mix(in srgb, var(--c) 22%, transparent); border-color: var(--c);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 35%, transparent);
}

/* Every feature in the category as a wrapping grid of title-only tiles */
.pt-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px;
  margin-top: 16px;
}
.pt-strip-tile {
  display: flex; align-items: center; justify-content: center; min-height: 76px; padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 10px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, #0a0a0a), color-mix(in srgb, var(--c) 6%, #0a0a0a));
  color: #ecfdf5; text-align: center; cursor: pointer;
  font-size: .86rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.005em;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c) 30%, transparent);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease, color .2s ease;
}
.pt-strip-tile:hover, .pt-strip-tile:focus-visible {
  border-color: var(--c); transform: translateY(-2px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c) 40%, transparent), 0 0 20px color-mix(in srgb, var(--c) 30%, transparent);
}
.pt-strip-tile.on {
  background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 86%, #0a0a0a));
  border-color: var(--c); color: #0a0a0a;
  box-shadow: 0 0 0 1px var(--c), 0 0 26px color-mix(in srgb, var(--c) 45%, transparent);
  transform: translateY(-2px);
}
@media (max-width: 560px) {
  .pt-modal-badge { width: 44px; height: 44px; font-size: 1.25rem; }
  .pt-modal-head h3 { font-size: 1.3rem; }
  .pt-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  /* Phones: the arrows would cover the scene's edges; the tile grid navigates instead. */
  .pt-modal .car-arrow { display: none; }
  .pt-strip-tile { min-height: 58px; font-size: .8rem; }
}

/* Closing call to action under the table */
.pt-ask { margin: 48px auto 0; text-align: center; }
.pt-ask h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; letter-spacing: -0.01em; color: #ecfdf5; margin-bottom: 16px; }
/* The standard button fades in on the homepage hero; here it's visible at once. */
.pt-ask .get-in-touch { display: inline-block; opacity: 1; animation: none; text-decoration: none; }

/* ── Homepage: the Feature Guide opens the table as a full-screen overlay ── */
.pt-overlay {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(8, 11, 10, 0.94); color: #ecfdf5;
  overflow-y: auto; overscroll-behavior: contain;
}
.pt-overlay::backdrop { background: rgba(4, 10, 8, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pt-overlay[open] { animation: ptOverlayIn .3s ease-out; }
@keyframes ptOverlayIn { from { opacity: 0; transform: scale(.985); } }
.pt-overlay .pt-shell { padding-top: clamp(40px, 7vh, 72px); }
.pt-overlay .pt-overlay-close { position: fixed; top: 18px; right: clamp(16px, 3vw, 32px); z-index: 3; }
@media (prefers-reduced-motion: reduce) { .pt-overlay[open] { animation: none; } }
/* A modal (category or contact) opened over the overlay would stack a second
   full-screen backdrop-filter on the first, and the compositor re-runs both
   blurs every frame the modal's preview animates. The overlay is static while
   a modal is up, so blur its content once with filter (cached) and drop both
   backdrop blurs. The overlay's own backdrop sits under 94% opaque content
   and a 70% scrim there, so dropping its blur is not visible. */
body:has(.contact-modal[open]) .pt-overlay[open] > * { filter: blur(10px); }
body:has(.contact-modal[open]) .pt-overlay[open]::backdrop,
body:has(.pt-overlay[open]) .contact-modal::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }

@media (prefers-reduced-motion: reduce) {
  .pt-el button, .pt-cat, .pt-el button::before, .pt-cat::before { transition: none; transform: none !important; }
}
