/* ==========================================================================
   INTERFACES — tabbed showcase (both homepages)
   --------------------------------------------------------------------------
   Three tabs on the left (Desktop selected by default), each the live
   site's card copy verbatim; on the right a stage showing that interface:
     Desktop   the AdPilot desktop app, rebuilt from the product screenshot the
               user supplied (29 Sep): sidebar, "Describe a task…" prompt,
               Auto / Default / Local / Medium toolbar. Personal session
               titles and the account name are placeholder bars.
     Terminal  a macOS Terminal window printing the section's EX-104 record.
     Slack     a Slack window where the AdPilot app posts the same record.
   The EX-104 copy (Customer identity service, Add customer-data exports,
   Requirement / Finding / Human gate) is the live section's demo panel,
   moved into the mockups. assets/js/interfaces.js runs the tabs.

   Scaling: every mockup length is in em, and .ifx__stage sets the em from
   its own width (container query units), so each window scales as one
   picture from desktop to phone instead of reflowing.
   ========================================================================== */

.ifx {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
  margin-top: var(--space-8);
}

/* ---------------------------------------------------------------- tabs */
/* Unselected tabs are quiet title rows. The selected tab lifts into a white
   card (thin border, soft shadow) with a small accent square before its
   title — the same marker as the module tour's list — and only it shows its
   description, which slides open (grid-rows 0fr → 1fr). */
.ifx__tabs { display: grid; gap: 6px; }
.ifx__tab {
  display: grid;
  width: 100%;
  padding: 16px 20px;
  border: var(--border-w) solid transparent;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 240ms var(--motion-ease), border-color 240ms var(--motion-ease),
              box-shadow 240ms var(--motion-ease);
}
.ifx__tab h4 {
  position: relative;
  padding-left: 18px;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink-muted);
  transition: color 200ms var(--motion-ease);
}
.ifx__tab h4::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 7px; height: 7px;
  translate: 0 -50%;
  background: var(--accent);
  opacity: 0;
  scale: 0.4;
  transition: opacity 200ms var(--motion-ease), scale 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ifx__tab:hover h4 { color: var(--heading); }
.ifx__tab[aria-selected="true"] {
  border-color: var(--line);
  background: var(--white);
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--grey-900) 30%, transparent);
  cursor: default;
}
.ifx__tab[aria-selected="true"] h4 { color: var(--heading); }
.ifx__tab[aria-selected="true"] h4::before { opacity: 1; scale: 1; }
.ifx__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ifx__desc {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ifx__desc p {
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding-left: 18px;
  font-size: var(--size-body);
  line-height: 1.55;
  color: var(--ink);
  opacity: 0;
  transition: opacity 200ms var(--motion-ease), padding-top 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ifx__tab[aria-selected="true"] .ifx__desc { grid-template-rows: 1fr; }
.ifx__tab[aria-selected="true"] .ifx__desc p { padding-top: 8px; opacity: 1; transition-delay: 0s, 0s; }
@media (prefers-reduced-motion: reduce) {
  .ifx__tab, .ifx__tab h4, .ifx__tab h4::before, .ifx__desc, .ifx__desc p { transition: none; }
}
.ifx__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: var(--space-5) 0 0 20px;
  font-size: var(--size-body);
  color: var(--accent-text, var(--accent));
  text-decoration: none;
}
.ifx__more:hover { opacity: 0.75; }

/* --------------------------------------------------------------- stage */
/* Each panel is its own gradient field (ember / sage / teal — the palette's
   illustration hues) with the window pinned to the bottom-right corner:
   the gradient shows above and to the left, and the window runs off the
   right and bottom edges, as on unkey.com. */
.ifx__stage {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  border: var(--border-w) solid var(--line);
  background: var(--ground);
}
.ifx__panel {
  position: absolute;
  inset: 0;
  font-size: 1.36cqw;                 /* ≈ 12px at an 880px stage */
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms var(--motion-ease), visibility 0s linear 320ms;
}
.ifx__panel.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms var(--motion-ease), visibility 0s;
}
.ifx__panel > .win {
  position: absolute;
  top: 10%;
  left: 9%;
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  translate: 2% 3%;
  transition: translate 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ifx__panel.is-active > .win { translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .ifx__panel, .ifx__panel > .win { transition: none; translate: 0 0; }
}

/* The three fields: a clean vertical ramp, deep at the top and light at
   the bottom, as on the reference. */
#ifx-panel-desktop  { background: linear-gradient(180deg, var(--ember-orange-ink) 0%, var(--ill-flame) 34%, var(--ill-ember) 68%, var(--ill-butter) 100%); }
#ifx-panel-terminal { background: linear-gradient(180deg, var(--sage-forest) 0%, var(--sage-green) 38%, var(--ill-jade) 68%, var(--ill-lime) 100%); }
#ifx-panel-slack    { background: linear-gradient(180deg, var(--deep-teal) 0%, var(--ill-jade) 38%, var(--ill-teal) 70%, var(--mint) 100%); }

/* ------------------------------------------------------- shared window */
.win {
  display: grid;
  grid-template-rows: auto 1fr;
  aspect-ratio: 16 / 10.4;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--grey-900) 16%, transparent);
  box-shadow: 0 2.4em 5em -2em color-mix(in srgb, var(--grey-900) 35%, transparent),
              0 0.3em 1em -0.4em color-mix(in srgb, var(--grey-900) 20%, transparent);
  font-family: var(--font-body);
  line-height: 1.3;
}
.win svg.icon { --icon-size: 1.15em; --icon-stroke: 1.75; flex: none; }
.win__bar {
  display: flex;
  align-items: center;
  gap: 0.6em;
  height: 2.6em;
  padding: 0 1em;
}
.win__lights { display: flex; gap: 0.55em; }
.win__lights i { width: 0.95em; height: 0.95em; border-radius: 50%; }
.win__lights i:nth-child(1) { background: var(--mac-close); }
.win__lights i:nth-child(2) { background: var(--mac-min); }
.win__lights i:nth-child(3) { background: var(--mac-zoom); }
.win__title { font-weight: 600; }
.skel { display: block; height: 0.62em; background: currentColor; opacity: 0.14; }

/* ---------------------------------------------------- Desktop (AdPilot app) */
.app { background: var(--paper); color: var(--grey-900); }
.app .win__bar { background: color-mix(in srgb, var(--grey-900) 3%, var(--paper)); border-bottom: 1px solid color-mix(in srgb, var(--grey-900) 8%, var(--paper)); }
.app__body { display: grid; grid-template-columns: 22em 1fr; min-height: 0; }
.app__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: color-mix(in srgb, var(--grey-900) 4%, var(--paper));
  border-right: 1px solid color-mix(in srgb, var(--grey-900) 8%, var(--paper));
}
.app__brand { display: flex; align-items: center; gap: 0.6em; padding: 1em 1.1em 0.8em; font-size: 1.15em; font-weight: 600; }
.app__brand .app__logo { width: 1.3em; height: 1.3em; background: var(--grey-900); display: grid; place-items: center; }
.app__brand .app__logo i { width: 0.7em; height: 0.7em; background: var(--paper); -webkit-mask: url(../img/brand/mark.svg) center / contain no-repeat; mask: url(../img/brand/mark.svg) center / contain no-repeat; }
.app__brand .icon { margin-left: auto; color: var(--grey-500); }
.app__nav { display: grid; gap: 0.1em; padding: 0 0.4em; }
.app__nav span { display: flex; align-items: center; gap: 0.7em; padding: 0.6em 0.7em; color: var(--grey-700); }
.app__nav span.is-on { background: color-mix(in srgb, var(--grey-900) 8%, var(--paper)); color: var(--grey-900); font-weight: 500; }
.app__recent {
  display: flex; justify-content: space-between;
  margin: 1.1em 1.1em 0.5em; padding-bottom: 0.5em;
  border-bottom: 1px solid color-mix(in srgb, var(--grey-900) 8%, var(--paper));
  font-family: var(--font-label); font-size: 0.8em; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-500);
}
.app__list { display: grid; gap: 0.95em; padding: 0.5em 1.1em; color: var(--grey-700); }
.app__list span { display: flex; align-items: center; gap: 0.8em; }
.app__list span::before { content: ''; flex: none; width: 0.55em; height: 0.55em; border: 1px solid var(--grey-500); border-radius: 50%; }
.app__list .skel { flex: 1; max-width: var(--w, 70%); color: var(--grey-900); }
.app__foot { margin-top: auto; }
.app__notice { display: flex; align-items: center; gap: 0.6em; padding: 0.8em 1.1em; background: color-mix(in srgb, var(--ill-butter) 30%, var(--paper)); color: var(--grey-700); font-size: 0.92em; }
.app__notice .icon:first-child { color: var(--ember-orange-ink); }
.app__notice .icon:last-child { margin-left: auto; color: var(--grey-500); }
.app__user { display: flex; align-items: center; gap: 0.7em; padding: 0.8em 1.1em; border-top: 1px solid color-mix(in srgb, var(--grey-900) 8%, var(--paper)); }
.app__user .app__avatar { display: grid; place-items: center; width: 2.2em; height: 2.2em; border: 1px solid color-mix(in srgb, var(--grey-900) 14%, var(--paper)); color: var(--grey-500); }
.app__user .skel { width: 8em; color: var(--grey-900); }
.app__main {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.3em;
  padding: 2em;
  background:
    linear-gradient(color-mix(in srgb, var(--grey-900) 3%, transparent) 1px, transparent 1px) 0 0 / 2.2em 2.2em,
    linear-gradient(90deg, color-mix(in srgb, var(--grey-900) 3%, transparent) 1px, transparent 1px) 0 0 / 2.2em 2.2em,
    var(--paper);
}
.app__ask { font-size: 1.2em; color: var(--grey-800, var(--grey-900)); }
.app__prompt { width: 38em; }
.app__box {
  position: relative;
  height: 7.4em;
  padding: 1em 1.1em;
  border: 1px solid color-mix(in srgb, var(--grey-900) 16%, var(--paper));
  background: var(--white);
  color: var(--grey-500);
}
.app__send { position: absolute; right: 0.9em; bottom: 0.9em; display: grid; place-items: center; width: 2.1em; height: 2.1em; background: color-mix(in srgb, var(--grey-900) 6%, var(--paper)); color: var(--grey-500); }
.app__tools { display: flex; align-items: center; gap: 1.6em; margin-top: 0.8em; padding-left: 0.3em; color: var(--grey-700); font-size: 0.95em; }
.app__tools span { display: inline-flex; align-items: center; gap: 0.4em; }
.app__tools .chev { --icon-size: 0.9em; color: var(--grey-500); }
.app__toggle { width: 2.3em; height: 1.25em; background: color-mix(in srgb, var(--grey-900) 16%, var(--paper)); position: relative; border-radius: 1em; }
.app__toggle::after { content: ''; position: absolute; left: 0.18em; top: 0.18em; width: 0.9em; height: 0.9em; border-radius: 50%; background: var(--grey-500); }

/* -------------------------------------------------------- Terminal */
.term { background: var(--term-bg); color: var(--term-text); }
.term .win__bar { background: var(--term-bar); justify-content: space-between; color: var(--term-dim); }
.term .win__title { position: absolute; left: 50%; translate: -50% 0; font-weight: 500; font-size: 0.95em; }
.term .win__bar { position: relative; }
.term__body {
  padding: 1.2em 1.5em;
  font-family: var(--font-mono);
  font-size: 1.05em;
  line-height: 1.75;
  white-space: pre;
  overflow: hidden;
}
.term__body .p  { color: var(--ill-sage); }
.term__body .d  { color: var(--ill-teal); }
.term__body .k  { color: var(--term-dim); }
.term__body .h  { color: var(--term-text); font-weight: 600; }
.term__body .a  { color: var(--ill-ember); }
.term__body .caret { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.2em; background: var(--term-text); animation: ifx-blink 1.1s steps(1) infinite; }
@keyframes ifx-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .term__body .caret { animation: none; } }

/* -------------------------------------------------------- Slack */
.slack { background: var(--white); color: var(--slack-text); }
.slack .win__bar { background: var(--slack-aubergine-2); color: var(--white); }
.slack__search { flex: 0 1 34em; margin: 0 auto; display: flex; align-items: center; gap: 0.6em; height: 1.75em; padding: 0 0.8em; background: color-mix(in srgb, var(--white) 18%, var(--slack-aubergine-2)); color: color-mix(in srgb, var(--white) 70%, transparent); border-radius: 0.4em; }
.slack__search .skel { width: 9em; color: var(--white); opacity: 0.35; }
.slack__body { display: grid; grid-template-columns: 17em 1fr; min-height: 0; }
.slack__side { background: var(--slack-aubergine); color: color-mix(in srgb, var(--white) 72%, transparent); padding: 1em 0.6em; display: grid; align-content: start; gap: 0.25em; }
.slack__ws { display: flex; align-items: center; gap: 0.6em; padding: 0 0.6em 0.9em; color: var(--white); font-weight: 700; font-size: 1.1em; }
.slack__ws .skel { width: 6em; color: var(--white); opacity: 0.5; height: 0.75em; }
.slack__sec { padding: 0.7em 0.6em 0.3em; font-size: 0.92em; }
.slack__sec .skel { width: 5em; color: var(--white); opacity: 0.3; }
.slack__ch { display: flex; align-items: center; gap: 0.5em; padding: 0.35em 0.6em; border-radius: 0.35em; }
.slack__ch .icon { --icon-size: 1em; opacity: 0.8; }
.slack__ch .skel { flex: 1; max-width: var(--w, 60%); color: var(--white); opacity: 0.28; }
.slack__ch.is-on { background: var(--slack-active); color: var(--white); }
.slack__main { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.slack__head { display: flex; align-items: center; gap: 0.3em; padding: 0.9em 1.3em; border-bottom: 1px solid var(--slack-line); font-weight: 700; font-size: 1.1em; }
.slack__feed { padding: 1.2em 1.3em; display: grid; align-content: end; gap: 1.1em; overflow: hidden; }
.slack__msg { display: grid; grid-template-columns: 2.9em 1fr; gap: 0.8em; }
.slack__av { width: 2.9em; height: 2.9em; display: grid; place-items: center; border-radius: 0.45em; }
.slack__av--brand { background: var(--grey-900); }
.slack__av--brand i { width: 1.5em; height: 1.5em; background: var(--paper); -webkit-mask: url(../img/brand/mark.svg) center / contain no-repeat; mask: url(../img/brand/mark.svg) center / contain no-repeat; }
.slack__av--ghost { background: color-mix(in srgb, var(--slack-text) 10%, var(--white)); }
.slack__who { display: flex; align-items: center; gap: 0.5em; font-weight: 700; }
.slack__app { padding: 0.05em 0.35em; font-size: 0.72em; font-weight: 600; background: color-mix(in srgb, var(--slack-text) 8%, var(--white)); color: var(--slack-muted); border-radius: 0.25em; }
.slack__who .skel { width: 3.5em; color: var(--slack-text); height: 0.55em; }
.slack__text { margin-top: 0.25em; }
.slack__card { margin-top: 0.6em; padding: 0.2em 0 0.2em 1em; border-left: 0.3em solid var(--accent); display: grid; gap: 0.5em; }
.slack__card small { font-size: 0.85em; color: var(--slack-muted); }
.slack__card b { font-size: 1.05em; }
.slack__card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35em 1em; margin: 0; }
.slack__card dt { color: var(--slack-muted); }
.slack__card dd { margin: 0; }
.slack__card code { font-family: var(--font-mono); font-size: 0.9em; padding: 0.05em 0.3em; background: color-mix(in srgb, var(--slack-text) 6%, var(--white)); color: var(--ember-orange-ink); border-radius: 0.2em; }
.slack__btns { display: flex; gap: 0.6em; margin-top: 0.3em; }
.slack__btns span { padding: 0.45em 1em; font-weight: 700; border: 1px solid var(--slack-line); border-radius: 0.35em; }
.slack__btns span:first-child { background: var(--slack-green); border-color: var(--slack-green); color: var(--white); }
.slack__ghost { display: grid; gap: 0.5em; padding-top: 0.2em; }
.slack__ghost .skel { color: var(--slack-text); }
.slack__compose { margin: 0 1.3em 1.1em; border: 1px solid color-mix(in srgb, var(--slack-text) 25%, var(--white)); border-radius: 0.55em; padding: 0.8em 1em; display: flex; align-items: center; gap: 0.8em; color: var(--slack-muted); }
.slack__compose .skel { width: 12em; color: var(--slack-text); }
.slack__compose .icon:last-child { margin-left: auto; }

.ifx__caption { display: none; margin: 12px 0 0; font-size: var(--size-body); line-height: 1.55; color: var(--ink); }

/* --------------------------------------------------------- phones */
@media (max-width: 900px) {
  .ifx { grid-template-columns: 1fr; gap: var(--space-6); margin-top: var(--space-6); }
  .ifx__tabs { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  .ifx__tab { padding: 10px 8px; justify-items: center; text-align: center; }
  .ifx__tab h4 { padding-left: 0; font-size: 15px; font-family: var(--font-body); font-weight: 500; }
  .ifx__tab h4::before { display: none; }
  .ifx__desc { display: none; }
  .ifx__more { margin-left: 0; }
  .ifx__caption { display: block; }
}
