/* ============================================================
   LEC ENERsim — Features page (pages/features.html)
   Category tabs, feature rows with laptop mockups, floaters.
   Loaded after styles.css; uses its :root tokens.
   ============================================================ */

/* ---------- Hero band ---------- */
.feat-hero { background: var(--soft); color: var(--tx-dark); padding: calc(72px + clamp(32px, 4vw, 56px)) 0 clamp(16px, 2vw, 24px); }
.feat-hero .h-section { max-width: 18ch; }

/* ---------- Category tabs (sticky) ----------
   Modelled on the app's GUI_category tabs: equal-width cards in one bordered
   strip, the active one lifted with a brand underline. */
.ftabs-bar {
  position: sticky; top: 72px; z-index: 60;
  background: rgba(234, 243, 246, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  padding-block: 14px;
  transition: padding 0.3s var(--ease), box-shadow 0.3s;
}
.ftabs-bar.is-stuck { padding-block: 8px; box-shadow: 0 12px 30px -24px rgba(12, 34, 48, 0.5); }
.ftabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 6px; border-radius: var(--radius); background: var(--soft-2);
  border: 1px solid var(--line-soft);
}
.ftab {
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 14px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--tx-dark-dim); text-align: left; cursor: pointer;
  font: inherit; transition: background 0.25s, color 0.25s, box-shadow 0.25s, border-color 0.25s, padding 0.3s var(--ease);
}
.ftab::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--brand);
  transform: scaleX(0); transition: transform 0.3s var(--ease);
}
.ftab:hover { background: rgba(255, 255, 255, 0.55); color: var(--tx-dark); }
.ftab.is-active { background: #fff; color: var(--tx-dark); border-color: var(--line); box-shadow: var(--shadow); }
.ftab.is-active::after { transform: scaleX(1); }
.ftab__icon {
  flex: none; width: 40px; height: 40px; border-radius: 9px; display: grid; place-content: center;
  background: rgba(28, 110, 140, 0.10); color: var(--brand); transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.25s, color 0.25s;
}
.ftab.is-active .ftab__icon { background: var(--brand); color: #fff; }
.ftab__icon svg { width: 21px; height: 21px; }
.ftab__body { display: grid; min-width: 0; }
.ftab__title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; line-height: 1.25; }
.ftab__sub { font-size: 0.8rem; color: var(--tx-dark-dim); line-height: 1.35; max-height: 3em; overflow: hidden; transition: max-height 0.3s var(--ease), opacity 0.3s; }
.ftabs-bar.is-stuck .ftab { padding-block: 9px; }
.ftabs-bar.is-stuck .ftab__icon { width: 32px; height: 32px; }
.ftabs-bar.is-stuck .ftab__sub { max-height: 0; opacity: 0; }

@media (max-width: 719px) {
  .ftabs { gap: 4px; padding: 4px; }
  .ftab { flex-direction: column; gap: 6px; padding: 10px 6px; text-align: center; }
  .ftab::after { left: 10px; right: 10px; }
  .ftab__icon { width: 34px; height: 34px; }
  .ftab__title { font-size: 0.84rem; }
  .ftab__sub { display: none; }
  .ftabs-bar.is-stuck .ftab { justify-content: center; min-height: 48px; padding: 6px; }
  .ftabs-bar.is-stuck .ftab__icon { display: none; }
  .ftabs-bar.is-stuck .ftab__title { font-size: 0.78rem; }
}

/* ---------- Panels ---------- */
.feat-panels { padding-bottom: var(--sp-section); }
.feat-panels__body { padding-top: clamp(48px, 6vw, 88px); }
.feat-panel[hidden] { display: none; }
.feat-panel { animation: featPanelIn 0.5s var(--ease); }
@keyframes featPanelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.feat-panel__head {
  display: grid; gap: 22px; align-items: end;
  padding-bottom: clamp(32px, 4vw, 48px); margin-bottom: clamp(48px, 6vw, 88px);
  border-bottom: 1px solid var(--line);
}
.feat-panel__head .h-section { font-size: clamp(1.7rem, 3.6vw, 2.7rem); margin-bottom: 0.9rem; }
.feat-panel__head .lead { max-width: 64ch; margin: 0; }
.feat-panel__actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 960px) {
  .feat-panel__head { grid-template-columns: 1fr auto; }
}

/* ---------- Feature rows (layout follows the main page's "Application areas") ---------- */
.feat-list { display: grid; gap: clamp(64px, 8vw, 112px); }
.feat-row { display: grid; gap: var(--sp-gap); align-items: center; }
.feat-row__media { margin: 0; }
.feat-row__text h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); color: var(--tx-dark); margin: 0 0 0.7rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.feat-row__text > p { color: var(--tx-dark-dim); max-width: 50ch; margin: 0 0 1rem; }
.feat-row__list { display: grid; gap: 9px; }
.feat-row__list li { position: relative; padding-left: 22px; font-size: 0.94rem; line-height: 1.5; color: var(--tx-dark); }
.feat-row__list li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 2px; background: var(--brand);
}
@media (min-width: 880px) {
  .feat-row { grid-template-columns: 1.25fr 1fr; }
  .feat-row:nth-child(even) { grid-template-columns: 1fr 1.25fr; }
  .feat-row:nth-child(even) .feat-row__media { order: 2; }
}

/* ---------- Laptop mockup (pure CSS frame around a screenshot or video) ---------- */
.laptop { padding-inline: 6%; }
.laptop__lid {
  position: relative; padding: 2.4% 2.4% 3.2%;
  background: linear-gradient(160deg, #23343e, #121e25);
  border: 1px solid #33454f; border-radius: 16px 16px 4px 4px;
  box-shadow: var(--shadow);
}
.laptop__lid::before {
  content: ""; position: absolute; top: 1%; left: 50%; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: #3b4d57;
}
/* App screenshots are full browser windows, roughly 2:1 */
.laptop__screen { position: relative; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 3px; background: #fff; }
.laptop__screen img, .laptop__screen video { width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.laptop__screen--cover img, .laptop__screen--cover video { object-fit: cover; object-position: left top; }
.laptop__base {
  position: relative; height: 16px; margin-inline: -7%;
  background: linear-gradient(180deg, #e3e8eb 0%, #c3ccd1 55%, #9eaab1 100%);
  border-radius: 2px 2px 14px 14px / 2px 2px 12px 12px;
  box-shadow: 0 18px 30px -18px rgba(12, 34, 48, 0.55);
}
.laptop__base::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 16%; height: 6px; transform: translateX(-50%);
  border-radius: 0 0 8px 8px; background: #aab5bb;
}
.feat-row:hover .laptop__lid { box-shadow: 0 30px 70px -34px rgba(12, 34, 48, 0.5); }

/* Slot for a screenshot that has not been captured yet */
.shot-pending {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  padding: 8%; text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(28, 110, 140, 0.05) 0 12px, transparent 12px 24px),
    var(--light-2);
  color: var(--tx-dark-dim);
}
.shot-pending svg { width: 34px; height: 34px; color: var(--brand); opacity: 0.7; }
.shot-pending__tag { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); }
.shot-pending__what { font-size: 0.86rem; line-height: 1.4; max-width: 34ch; }

/* ---------- AI section ---------- */
.feat-ai__grid { display: grid; gap: var(--sp-gap); align-items: center; }
.feat-ai__badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 1rem;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: var(--accent); padding: 6px 12px; border-radius: 999px;
}
.feat-ai__badge svg { width: 14px; height: 14px; }
.feat-ai__new { margin: 0 0 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--accent); }
.feat-ai .lead { margin: 1.1rem 0 1.6rem; }
.feat-ai__note { margin: 22px 6% 0; font-size: 0.92rem; line-height: 1.55; color: var(--tx-dark-dim); text-align: center; }
@media (min-width: 960px) { .feat-ai__grid { grid-template-columns: 1fr 1.15fr; } }

/* ---------- Floaters ---------- */
.floaters {
  position: fixed; left: 0; right: 0; bottom: 18px; z-index: 80; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding-inline: clamp(12px, 2.4vw, 28px);
}
.floater {
  pointer-events: auto; color: var(--tx-dark);
  background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 22px 50px -24px rgba(12, 34, 48, 0.55);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}
.floater.is-hidden { opacity: 0; visibility: hidden; transform: translateY(18px); pointer-events: none; }

.floater--article { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; max-width: 360px; }
.floater--article:hover { border-color: var(--brand); }
.floater__thumb { flex: none; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.floater__text { display: grid; min-width: 0; }
.floater__eyebrow { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); }
.floater__title { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.floater__arrow { flex: none; color: var(--brand); transition: transform 0.2s var(--ease); }
.floater--article:hover .floater__arrow { transform: translateX(3px); }

.floater--ai {
  position: relative; max-width: 330px; padding: 16px 40px 16px 16px;
  background: linear-gradient(150deg, var(--brand-deep), var(--ink));
  border-color: rgba(111, 180, 199, 0.35); color: var(--tx-light);
  animation: floaterBob 6s ease-in-out infinite;
}
.floater--ai .feat-ai__badge { margin-bottom: 8px; font-size: 0.64rem; padding: 4px 9px; }
.floater--ai p { margin: 0 0 10px; font-size: 0.88rem; line-height: 1.45; color: var(--tx-light-dim); }
.floater--ai p strong { color: #fff; font-weight: 600; }
.floater__cta { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--brand-light); }
.floater__cta:hover { color: #fff; }
.floater__close {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%;
  display: grid; place-content: center; background: transparent; color: var(--tx-light-dim); cursor: pointer;
}
.floater__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.floater__close svg { width: 14px; height: 14px; }
@keyframes floaterBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

/* Compact AI pill while the visitor reads through the features */
.floater__cta-short { display: none; }
.floater--ai.is-compact { display: flex; align-items: center; gap: 10px; padding: 8px 38px 8px 8px; border-radius: 999px; }
.floater--ai.is-compact p { display: none; }
.floater--ai.is-compact .feat-ai__badge { margin: 0; white-space: nowrap; }
.floater--ai.is-compact .floater__cta { white-space: nowrap; }
.floater--ai.is-compact .floater__cta-long { display: none; }
.floater--ai.is-compact .floater__cta-short { display: inline; color: #fff; }
.floater--ai.is-compact .floater__close { top: 50%; transform: translateY(-50%); right: 6px; }

@media (max-width: 719px) {
  .floaters { bottom: 10px; }
  .floater--article { padding: 6px 12px 6px 6px; max-width: 50%; border-radius: 999px; }
  .floater__thumb { width: 34px; height: 34px; border-radius: 50%; }
  .floater__eyebrow { display: none; }
  .floater__title { font-size: 0.76rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .floater--ai { max-width: 48%; padding: 10px 30px 10px 12px; }
  .floater--ai p { display: none; }
  .floater--ai .feat-ai__badge { margin-bottom: 4px; }
  .floater--ai.is-compact { padding: 6px 30px 6px 6px; }
  .floater--ai.is-compact .feat-ai__badge { display: none; }
  .floater--ai.is-compact .floater__cta { white-space: normal; line-height: 1.25; }
  .floater--ai.is-compact .floater__cta-short { font-size: 0.76rem; padding-left: 6px; }
  .floater__close { top: 4px; right: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .feat-panel { animation: none; }
  .floater--ai { animation: none; }
  .ftab, .ftab::after, .ftabs-bar, .floater { transition: none; }
}

/* ---------- Screenshot zoom ---------- */
.laptop__zoom {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 34px; height: 34px; border: 0; border-radius: 8px; cursor: zoom-in;
  display: grid; place-content: center;
  background: rgba(12, 34, 48, 0.62); color: #fff;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.laptop__zoom:hover { background: var(--brand); transform: scale(1.06); }
.laptop__zoom svg { width: 18px; height: 18px; }

.lightbox {
  width: fit-content; max-width: 82vw; max-height: none; padding: 0; border: 0;
  background: transparent; overflow: visible;
}
.lightbox::backdrop { background: rgba(8, 24, 35, 0.86); }
.lightbox__figure { margin: 0; }
.lightbox__img {
  display: block; width: auto; height: auto; max-width: 82vw; max-height: 80vh;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-dark);
}
.lightbox__credit { margin-top: 10px; text-align: right; font-size: 0.8rem; color: var(--tx-light-dim); }
.lightbox__close {
  position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  display: grid; place-content: center; cursor: pointer; background: #fff; color: var(--tx-dark); box-shadow: var(--shadow);
}
.lightbox__close svg { width: 16px; height: 16px; }
@media (max-width: 719px) { .lightbox__close { top: -44px; right: 0; } }
