/*
 * Features pages: the hub (/features/), the feature pages (/features/*) and the explainer
 * (/ai-email-organizer/). Loaded after tokens.css, styles.css and site.css.
 * The illustrations are the shared mail window (.mock-window, .mail-row, .mail-app) and the
 * mockup pieces in site.css (the search window too); this file fits them to their columns and adds
 * the few mock pieces only these pages show (the labeled inbox, suggested rules, label counts).
 * Hub: hero (split) · feature cards · steps (alternating rows) · dashboard (surface band, wide
 * mock) · truths (grid) · FAQ split.
 * A feature page: hero (split, with {{soon_note:…}} while the feature isn't live) · how it
 * works (.benefits) · a detail section · what it won't do (.truth-list in a .section.alt) ·
 * FAQ split · closing block.
 */

/* ---- Hero: rows with label chips where the demo shows the time --------------------------- */
.features-mail .mail-row:last-child,
.features-sort .mail-row:last-child {
  border-bottom: 0;
}
.features-mail + .mail-bottom {
  border-top: 1px solid var(--line);
}
.mock-window .mail-meta {
  max-width: none;
}

/* ---- Steps ------------------------------------------------------------------------------
 * <p class="feat-step"><span aria-hidden="true">1</span>Plan</p> — a numbered step marker,
 * deliberately not an eyebrow.
 */
.features-steps {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.features-steps > .section-head {
  margin-bottom: 0;
}
.feat-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink-2);
}
.feat-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: var(--fs-meta);
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

/* The sort: the demo's folder column becomes the live label counts. Sender sits above the
   subject at every width so the subject keeps enough room to read. */
.features-sort .folder {
  min-height: 34px;
  padding: var(--space-1) var(--space-2);
}
.features-sort .folder-list {
  flex-wrap: wrap;
  overflow: visible;
}
.features-sort .mock-progress {
  margin: var(--space-4) var(--space-4) var(--space-1);
}
.features-sort .email-line {
  display: block;
}
.features-sort .sender {
  margin-bottom: 2px;
}
@media (min-width: 760px) {
  .features-sort.mail-app {
    grid-template-columns: 176px minmax(0, 1fr);
  }
  .features-sort .sidebar {
    padding: var(--space-3) var(--space-2);
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .features-sort .folder-list {
    flex-direction: column;
  }
  .features-sort .folder-heading {
    display: block;
    padding: var(--space-2) var(--space-2) var(--space-3);
  }
  .features-sort .folder b {
    padding: 0;
    background: none;
  }
  .features-sort .unclear-folder {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    border-radius: 0;
  }
  .features-sort .mail-row {
    padding-inline: var(--space-4);
  }
}

/* ---- Dashboard: intro in two columns, a wide mock under it ------------------------------- */
.features-dashboard-head {
  display: grid;
  gap: var(--space-4) var(--space-8);
  margin-bottom: var(--space-7);
}
.features-dashboard-head .eyebrow {
  margin-bottom: var(--space-4);
}
.features-dashboard-head h2 {
  font-size: calc(var(--fs-h2) * 0.85);
}
.features-dashboard-head p:not([class]) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}
.features-dashboard-figure {
  max-width: 1040px;
}
.features-dashboard {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 600px) {
  .features-dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-6);
  }
  .features-dashboard > .mock-chat {
    padding-left: var(--space-6);
    border-left: 1px solid var(--line);
  }
}
@media (min-width: 1000px) {
  .features-dashboard-head {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: end;
  }
  .features-dashboard-figure {
    margin-inline: auto;
  }
  .features-dashboard.mock-body {
    padding: var(--space-6) var(--space-7);
  }
}

/* ---- The parts that don't change: hairline rows, no icons ------------------------------- */
.features-truths {
  padding-top: var(--section-y);
}
.features-truths h2 {
  margin-bottom: var(--space-6);
  font-size: calc(var(--fs-h2) * 0.85);
}
.truth-list {
  display: grid;
  gap: 0 var(--space-7);
  margin: 0;
}
.truth-list > div {
  padding: var(--space-5) 0 var(--space-6);
  border-top: 1px solid var(--line);
}
.truth-list dt {
  font-weight: 600;
}
.truth-list dd {
  margin: var(--space-2) 0 0;
  color: var(--muted);
}
@media (min-width: 600px) {
  .truth-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) {
  .truth-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- Feature cards (hub and explainer) ---------------------------------------------------
 * <ul class="card-grid cols-2"><li><a class="card link-card feature-card" href="/features/x/">
 *   <span class="feature-icon"><svg class="icon" …></span><strong>Name {{soon:x}}</strong>
 *   <span>One or two sentences.</span><span class="text-link">About x <svg …></span></a></li>
 * </ul>
 */
.feature-index .section-head {
  margin-bottom: var(--space-7);
}
.feature-card {
  gap: var(--space-2);
}
.feature-card .feature-icon {
  margin-bottom: var(--space-3);
}
.feature-card > strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--lh-heading);
}
.feature-card > span:not([class]) {
  max-width: 460px;
  color: var(--muted);
}
.feature-index-foot {
  margin: var(--space-6) 0 0;
  color: var(--muted);
}

/* ---- Feature pages -------------------------------------------------------------------------
 * The status note sits between the h1 and the lede; a mid heading in a .feature-row is an h2
 * sized like the hub's step titles.
 */
.feature-hero .soon-note {
  margin-top: var(--space-5);
}
.feature-row-title {
  font-size: calc(var(--fs-h2) * 0.75);
  font-weight: 500;
  letter-spacing: var(--track-heading);
}
.feature-copy > .eyebrow {
  margin-bottom: var(--space-4);
}
.feature-copy > .text-link {
  margin-top: var(--space-5);
}
.feature-copy code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink-2);
}
.feature-detail .card > .chip {
  margin-bottom: var(--space-4);
}
.feature-detail .card h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* An inbox list with each label drawn before the subject, the way Gmail shows labels. */
.inbox-list .mail-row:last-child {
  border-bottom: 0;
}
.inbox-list .mail-subject .chip {
  margin-right: var(--space-2);
  padding: 2px 6px;
  font-size: var(--fs-eyebrow);
  vertical-align: 1px;
}
.inbox-list + .mail-bottom {
  border-top: 1px solid var(--line);
}
.inbox-list .mail-meta {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.inbox-list .is-important .sender {
  color: var(--ink);
}
.inbox-list .is-important .mail-meta {
  color: var(--tone-deadline);
  --icon-size: 16px;
}
.inbox-list .is-important .mail-meta .icon {
  fill: currentColor;
}

/* demos.js: new mail arrives unread, a placeholder shows while it's read, then its label. */
.inbox-list .is-unread {
  background: var(--hover);
}
.inbox-list .is-unread .sender,
.inbox-list .is-unread .mail-subject {
  font-weight: 600;
  color: var(--ink);
}
.chip-pending {
  display: inline-block;
  width: 64px;
  height: 16px;
  margin-right: var(--space-2);
  border-radius: var(--radius-xs);
  vertical-align: -3px;
  background: var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .inbox-list {
    transition: opacity 0.3s;
  }
  .inbox-list.is-leaving {
    opacity: 0;
  }
  .inbox-list .is-arriving {
    animation: mail-arrive 0.45s var(--ease);
  }
  .chip-pending {
    background: linear-gradient(90deg, var(--line) 25%, var(--hover) 50%, var(--line) 75%);
    background-size: 300% 100%;
    animation: pending-sweep 1s linear infinite;
  }
  .inbox-list .chip.is-labeled {
    animation: label-in 0.4s var(--ease);
  }
}
@keyframes mail-arrive {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes pending-sweep {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -50% 0;
  }
}
@keyframes label-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

/* Label counts: the Syfft labels in a mail sidebar. */
.label-counts {
  display: grid;
  gap: var(--space-1);
}
.label-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 34px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.label-count:nth-child(2) {
  background: var(--hover);
}

/* Suggested rules: icon, senders and what happens, the label, a checkbox; a button below. */
.mock-rules {
  display: grid;
}
.mock-rule {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  --icon-size: 16px;
}
.mock-rule > .icon {
  color: var(--subtle);
}
.mock-rule strong {
  display: block;
  font-weight: 600;
  color: var(--ink-2);
}
.mock-rule .chip {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
}
.mock-rule .mock-check {
  grid-column: 3;
  grid-row: 1 / 3;
}
.mock-rules .mock-button {
  justify-self: end;
  margin-top: var(--space-4);
}
@media (min-width: 600px) {
  .mock-rule {
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
  }
  .mock-rule .chip {
    grid-column: 3;
    grid-row: 1;
  }
  .mock-rule .mock-check {
    grid-column: 4;
    grid-row: 1;
  }
}

/* "Want some senders out of your inbox?": a one-line pointer to another feature. */
.feature-callout {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--page);
  --icon-size: 20px;
}
.feature-callout > .icon {
  color: var(--blue);
}
.feature-callout p {
  margin: 0;
  color: var(--muted);
}
.feature-callout strong {
  color: var(--ink);
}
.feature-callout .text-link {
  grid-column: 2;
}
@media (min-width: 760px) {
  .feature-callout {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
  }
  .feature-callout .text-link {
    grid-column: 3;
  }
}

/* ---- Explainer (/ai-email-organizer/): long-form answer, then the feature cards ----------- */
.explainer {
  padding-bottom: var(--section-y);
}
.explainer .prose {
  max-width: 760px;
}
.explainer .prose > h2:first-child {
  margin-top: 0;
}
.explainer .guide-demo {
  margin: var(--space-6) 0;
  min-width: 0;
}
.explainer .demo-section {
  padding-top: 0;
}
.explainer .demo-section .demo-caption {
  text-align: left;
  padding-inline: 0;
}
.explainer .guide-demo > figcaption {
  margin-top: var(--space-3);
  font-size: var(--fs-meta);
  color: var(--subtle);
}
.explainer .table-scroll {
  margin-block: var(--space-5);
}
.explainer-features {
  margin-top: var(--space-7);
}
