/* email-and-document-agents.css
   New sections for email-and-document-agents.html.
   Hero (agh), FAQ (agf) and buttons come from agent.css. */

.ed-page {
  --ed-orange: #E75C23;
  --ed-orange-dark: #C44A18;
  --ed-amber: #FFA213;
  --ed-pale: #FFF3EB;
  --ed-ink: #1A1A1A;
  --ed-ink-2: #2D2D2D;
  --ed-muted: #7A6F68;
  --ed-bg: #FFFFFF;
  --ed-bg-2: #F8F6F4;
  --ed-line: #E8E2DC;
  --ed-line-2: #D4CCC4;
  --ed-ok: #1F8A5B;
  --ed-warn: #B45309;
  --ed-radius: 14px;
  --ed-ease: cubic-bezier(.22, .8, .3, 1);
}

/* ───────── shared layout ───────── */
.ed-sec { padding: clamp(56px, 8vw, 104px) 0; background: var(--ed-bg); color: var(--ed-ink); }
.ed-sec:nth-of-type(even) { background: var(--ed-bg-2); }
.ed-wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.ed-eyebrow { margin: 0 0 12px; font-size: .9rem; font-weight: 600; color: var(--ed-orange-dark); }
.ed-title { margin: 0 0 16px; font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.1; font-weight: 600; letter-spacing: -.02em; max-width: 20ch; }
.ed-lead { margin: 0; font-size: 1.1rem; line-height: 1.6; color: var(--ed-ink-2); max-width: 60ch; }
.ed-lead a, .edx-lead a, .edx-checks a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ed-orange); }
.ed-lead a:hover { color: var(--ed-orange-dark); }
.ed-page a:focus-visible, .ed-page button:focus-visible, .ed-page input:focus-visible, .edf-card:focus-visible, .edt-item:focus-visible {
  outline: 3px solid var(--ed-amber); outline-offset: 3px;
}

/* scroll reveal (only when JS is running) */
.ed-js .ed-rise { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ed-ease), transform .6s var(--ed-ease); transition-delay: var(--rd, 0ms); }
.ed-js .ed-rise.is-in { opacity: 1; transform: none; }

/* ───────── 2. intro + scanning document ───────── */
.edi-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.edi-more { margin: 20px 0 0; line-height: 1.7; color: var(--ed-muted); max-width: 60ch; }

.edi-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.edi-doc {
  position: relative; overflow: hidden; aspect-ratio: 3 / 4; padding: 18px 16px;
  background: #fff; border: 1px solid var(--ed-line-2); border-radius: 10px;
  box-shadow: 0 18px 40px -22px rgba(26, 26, 26, .35);
  display: flex; flex-direction: column; gap: 10px;
}
.edi-file { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; color: var(--ed-ink-2); padding-bottom: 10px; border-bottom: 1px solid var(--ed-line); }
.edi-file i { color: var(--ed-orange); font-size: 1rem; }
.edi-line { display: block; height: 8px; width: var(--w, 80%); border-radius: 4px; background: var(--ed-line); }
.edi-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 56px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(231, 92, 35, 0), rgba(231, 92, 35, .22));
  border-bottom: 2px solid var(--ed-orange);
  animation: edi-scan 3.6s ease-in-out infinite;
}
@keyframes edi-scan { 0% { transform: translateY(-60px); } 100% { transform: translateY(calc(100cqh)); } }
.edi-doc { container-type: size; }

.edi-out { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.edi-out li {
  padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--ed-line);
  border-left: 3px solid var(--ed-orange); font-size: .92rem; font-weight: 600; color: var(--ed-ink);
  opacity: 0; transform: translateX(-10px);
  animation: edi-pop 3.6s var(--ed-ease) infinite; animation-delay: calc(var(--d) * .45s);
}
.edi-out li span { display: block; font-size: .72rem; font-weight: 500; color: var(--ed-muted); margin-bottom: 2px; }
@keyframes edi-pop {
  0%, 8% { opacity: 0; transform: translateX(-10px); }
  20%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}

/* ───────── 3. inbox triage demo ───────── */
.edt-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 24px; margin-top: 40px; align-items: start; }
.edt-inbox { display: flex; flex-direction: column; border: 1px solid var(--ed-line); border-radius: var(--ed-radius); background: #fff; overflow: hidden; }
.edt-item {
  display: grid; gap: 4px; width: 100%; text-align: left; padding: 14px 16px; background: #fff; border: 0;
  border-bottom: 1px solid var(--ed-line); border-left: 3px solid transparent; cursor: pointer; font: inherit; color: inherit;
  transition: background .2s, border-color .2s;
}
.edt-item:last-child { border-bottom: 0; }
.edt-item:hover { background: var(--ed-bg-2); }
.edt-item[aria-selected="true"] { background: var(--ed-pale); border-left-color: var(--ed-orange); }
.edt-from { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; font-weight: 600; }
.edt-from time { font-weight: 400; color: var(--ed-muted); }
.edt-subj { font-size: .95rem; font-weight: 500; }
.edt-snip { font-size: .82rem; color: var(--ed-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.edt-detail { border: 1px solid var(--ed-line); border-radius: var(--ed-radius); background: #fff; padding: clamp(20px, 3vw, 32px); min-height: 380px; }
.edt-detail.is-swap > * { animation: edt-in .35s var(--ed-ease) both; }
@keyframes edt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.edt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.edt-head h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.edt-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--ed-pale); color: var(--ed-orange-dark); }
.edt-tag.is-human { background: #FEF3C7; color: var(--ed-warn); }
.edt-tag.is-auto { background: #E3F5EC; color: var(--ed-ok); }
.edt-body { margin: 0 0 20px; color: var(--ed-muted); font-size: .95rem; line-height: 1.6; }
.edt-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 0; }
.edt-steps li { position: relative; padding: 0 0 14px 28px; font-size: .95rem; line-height: 1.5; }
.edt-steps li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--ed-orange); }
.edt-steps li::after { content: ""; position: absolute; left: 9px; top: 19px; bottom: -3px; width: 2px; background: var(--ed-line); }
.edt-steps li:last-child::after { display: none; }
.edt-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 20px; }
.edt-fields div { padding: 10px 12px; border-radius: 10px; background: var(--ed-bg-2); }
.edt-fields dt { font-size: .74rem; color: var(--ed-muted); margin-bottom: 2px; }
.edt-fields dd { margin: 0; font-size: .92rem; font-weight: 600; }
.edt-meter { display: flex; align-items: center; gap: 12px; font-size: .85rem; font-weight: 600; }
.edt-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--ed-line); overflow: hidden; }
.edt-bar i { display: block; height: 100%; width: var(--c, 0%); background: var(--ed-orange); border-radius: inherit; transition: width .6s var(--ed-ease); }
.edt-bar i.is-low { background: var(--ed-warn); }

/* ───────── 4. flip cards ───────── */
.edf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.edf-card { perspective: 1000px; min-height: 240px; outline-offset: 4px; border-radius: var(--ed-radius); }
.edf-in { position: relative; width: 100%; height: 100%; min-height: 240px; transition: transform .6s var(--ed-ease); transform-style: preserve-3d; }
.edf-card:hover .edf-in, .edf-card:focus-visible .edf-in, .edf-card.is-flipped .edf-in { transform: rotateY(180deg); }
.edf-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 24px; border-radius: var(--ed-radius); border: 1px solid var(--ed-line);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.edf-front { background: #fff; }
.edf-front i { font-size: 1.9rem; color: var(--ed-orange); margin-bottom: 4px; }
.edf-front h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.edf-front p { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ed-muted); }
.edf-back { background: radial-gradient(at 8% 8%,#0a000f,transparent 42%),radial-gradient(at 88% 15%,rgba(72,0,88,.75),transparent 50%),radial-gradient(at 90% 82%,rgba(231,92,35,.5),transparent 48%),linear-gradient(148deg,#0d000f 0%,#1a0025 35%,#2a0830 60%,#12001a); color: #fff; border-color: var(--ed-ink); transform: rotateY(180deg); }
.edf-back h4 { margin: 0 0 4px; font-size: .95rem; font-weight: 600; color: var(--ed-amber); }
.edf-back ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.edf-back li { position: relative; padding-left: 22px; font-size: .95rem; }
.edf-back li::before {
  content: ""; position: absolute; left: 2px; top: .4em; width: 10px; height: 6px;
  border-left: 2px solid var(--ed-amber); border-bottom: 2px solid var(--ed-amber); transform: rotate(-45deg);
}

/* ───────── 5. confidence slider ───────── */
.edc-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.edc-panel { padding: clamp(20px, 3vw, 32px); background: #fff; border: 1px solid var(--ed-line); border-radius: var(--ed-radius); }
.edc-label { display: block; margin-bottom: 14px; font-size: .95rem; color: var(--ed-ink-2); }
.edc-label strong { color: var(--ed-orange-dark); font-size: 1.1rem; }
.edc-range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; outline-offset: 6px; cursor: pointer;
  background: linear-gradient(to right, var(--ed-orange) var(--fill, 70%), var(--ed-line) var(--fill, 70%)); }
.edc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--ed-orange); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.edc-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--ed-orange); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.edc-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 20px 0 16px; padding-bottom: 16px; border-bottom: 1px solid var(--ed-line); font-size: .92rem; color: var(--ed-muted); }
.edc-sum b { font-size: 1.5rem; font-weight: 700; color: var(--ed-ink); margin-right: 4px; font-variant-numeric: tabular-nums; }
.edc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.edc-list li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--ed-line); font-size: .9rem; transition: background .3s, border-color .3s, opacity .3s;
}
.edc-list li.is-auto { background: #F1FAF5; border-color: #BFE6D2; }
.edc-list li.is-human { background: #FFFBEB; border-color: #F5DFA0; }
.edc-name { font-weight: 500; }
.edc-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.edc-state { font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.is-auto .edc-state { background: #D3F0E1; color: var(--ed-ok); }
.is-human .edc-state { background: #FDEBB0; color: var(--ed-warn); }

/* ───────── 6. CTA ───────── */
.edx { padding: clamp(64px, 9vw, 112px) 0; background: radial-gradient(at 8% 8%,#0a000f,transparent 42%),radial-gradient(at 88% 15%,rgba(72,0,88,.75),transparent 50%),radial-gradient(at 90% 82%,rgba(231,92,35,.5),transparent 48%),linear-gradient(148deg,#0d000f 0%,#1a0025 35%,#2a0830 60%,#12001a); color: #fff; overflow: hidden; }
.edx-wrap { width: min(1200px, 100% - 40px); margin-inline: auto; display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.edx-eyebrow { margin: 0 0 12px; font-size: .9rem; font-weight: 600; color: var(--ed-amber); }
.edx-title { margin: 0 0 16px; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.08; font-weight: 600; letter-spacing: -.02em; max-width: 18ch; }
.edx-lead { margin: 0 0 24px; font-size: 1.1rem; line-height: 1.6; color: rgba(255, 255, 255, .78); max-width: 52ch; }
.edx-checks { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 12px; }
.edx-checks li { display: flex; align-items: flex-start; gap: 10px; color: rgba(255, 255, 255, .9); }
.edx-i { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--ed-amber); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.edx-btns { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.edx .agc-btn { display: inline-flex; align-items: center; padding: 14px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); color: #fff; font-weight: 600; text-decoration: none; transition: background .2s, border-color .2s; }
.edx .agc-btn:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }

.edx-orbit { position: relative; width: min(320px, 80vw); aspect-ratio: 1; margin-inline: auto; }
.edx-orbit::before, .edx-orbit::after { content: ""; position: absolute; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .22); }
.edx-orbit::before { inset: 0; }
.edx-orbit::after { inset: 24%; }
.edx-core {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; font-size: 2.2rem; color: #fff;
  background: linear-gradient(135deg, var(--ed-orange), var(--ed-amber)); box-shadow: 0 0 60px rgba(231, 92, 35, .5);
}
.edx-o {
  position: absolute; inset: 50% auto auto 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center; border-radius: 50%; background: var(--ed-ink-2); border: 1px solid rgba(255, 255, 255, .25); color: var(--ed-amber);
  animation: edx-spin 18s linear infinite; animation-delay: var(--od, 0s);
}
.edx-o1 { --od: 0s; }
.edx-o2 { --od: -6s; }
.edx-o3 { --od: -12s; }
@keyframes edx-spin {
  from { transform: rotate(0deg) translateX(min(160px, 40vw)) rotate(0deg); }
  to { transform: rotate(360deg) translateX(min(160px, 40vw)) rotate(-360deg); }
}

/* ───────── responsive ───────── */
@media (max-width: 1024px) {
  .edf-grid { grid-template-columns: repeat(2, 1fr); }
  .edt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .edi-grid, .edc-grid, .edx-wrap { grid-template-columns: 1fr; }
  .edx-orbit { order: -1; width: 240px; }
}
@media (max-width: 560px) {
  .edf-grid { grid-template-columns: 1fr; }
  .edi-stage { grid-template-columns: 1fr; }
  .edi-doc { aspect-ratio: 4 / 3; }
  .edc-list li { grid-template-columns: 1fr auto; }
  .edc-state { grid-column: 1 / -1; justify-self: start; }
}

/* touch devices: cards flip on tap via JS class, not hover */
@media (hover: none) { .edf-card:hover .edf-in { transform: none; } .edf-card.is-flipped:hover .edf-in { transform: rotateY(180deg); } }

@media (prefers-reduced-motion: reduce) {
  .ed-js .ed-rise { opacity: 1; transform: none; transition: none; }
  .edi-scan, .edx-o { animation: none; }
  .edi-out li { animation: none; opacity: 1; transform: none; }
  .edx-o1 { transform: translate(-110px, -60px); } .edx-o2 { transform: translate(110px, -40px); } .edx-o3 { transform: translate(0, 120px); }
  .edf-in, .edt-bar i { transition: none; }
  .edt-detail.is-swap > * { animation: none; }
}