/* PDF Eye home page. Everything animates with CSS; home.js only drives the steps, the typing
   demo, the gallery tabs and starts animations when sections scroll into view. */

/* ---------- hero ---------- */
.pe-hero { padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); overflow: hidden; }
.pe-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.pe-hero .lead { margin: 22px 0 28px; }
.pe-platforms { color: var(--ink-3); font-size: 14px; margin-top: 14px; }
.pe-stage { position: relative; height: clamp(460px, 52vw, 640px); }
.pe-phone {
  position: absolute; left: 50%; top: 50%; width: clamp(230px, 24vw, 300px); transform: translate(-40%, -50%) rotate(3deg);
  border-radius: 44px; padding: 9px; background: #1e2127; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pe-float 7s ease-in-out infinite;
}
.pe-phone img { border-radius: 36px; }
.pe-laser {
  position: absolute; left: 9px; right: 9px; top: 18%; height: 3px; border-radius: 3px; background: var(--signal);
  box-shadow: 0 0 18px 4px rgba(229,20,27,.55), 0 -40px 50px -10px rgba(229,20,27,.18);
  animation: pe-scan 3.8s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes pe-scan { 0% { top: 16%; opacity: 0 } 8% { opacity: 1 } 78% { top: 82%; opacity: 1 } 90%, 100% { top: 82%; opacity: 0 } }
@keyframes pe-float { 0%, 100% { transform: translate(-40%, -50%) rotate(3deg) } 50% { transform: translate(-40%, -53%) rotate(2deg) } }
.pe-lens { position: absolute; width: clamp(140px, 15vw, 190px); left: 2%; top: 8%; filter: drop-shadow(0 18px 30px rgba(28,31,36,.3)); animation: pe-bob 6s ease-in-out infinite; }
.pe-blades { transform-origin: 100px 100px; animation: pe-aperture 5s ease-in-out infinite; }
@keyframes pe-aperture { 0%, 100% { transform: rotate(0) scale(1) } 50% { transform: rotate(30deg) scale(.82) } }
@keyframes pe-bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.pe-chip {
  position: absolute; font-family: var(--font-display); font-weight: 800; color: var(--signal); background: var(--sheet);
  border: 1px solid color-mix(in srgb, var(--signal) 30%, transparent); border-radius: 999px; padding: 8px 14px; font-size: 15px;
  box-shadow: var(--shadow-sm); animation: pe-rise 4.5s ease-in-out infinite;
}
.pe-chip.c1 { right: 4%; top: 18%; } .pe-chip.c2 { right: 0; top: 52%; animation-delay: 1.2s; } .pe-chip.c3 { left: 8%; bottom: 10%; animation-delay: 2.3s; }
@keyframes pe-rise { 0% { opacity: 0; transform: translateY(16px) } 20%, 70% { opacity: 1; transform: translateY(0) } 100% { opacity: 0; transform: translateY(-20px) } }

/* ---------- steps ---------- */
.pe-how { padding: clamp(60px, 8vw, 110px) 0; }
.pe-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pe-step { position: relative; background: var(--sheet); border: 1px solid var(--line); border-radius: 24px; padding: 22px 22px 26px; transition: transform .4s, box-shadow .4s, border-color .4s; }
.pe-step.on { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--signal) 40%, transparent); }
.pe-num { font-family: var(--font-mono); color: var(--signal); font-weight: 700; font-size: 13px; }
.pe-step h3 { font-size: 26px; margin: 6px 0 8px; }
.pe-step p { color: var(--ink-2); margin: 0 0 18px; font-size: 16px; }
.pe-bar { display: block; height: 3px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.pe-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--signal), var(--crimson)); }
.pe-step.on .pe-bar span { animation: pe-fill 4s linear forwards; }
@keyframes pe-fill { to { width: 100% } }
.pe-step-art { height: 170px; display: grid; place-items: center; margin-bottom: 14px; background: var(--paper); border-radius: 16px; position: relative; overflow: hidden; }
.pe-page { position: relative; width: 104px; height: 136px; background: #fff; border-radius: 6px; box-shadow: var(--shadow-sm); padding: 18px 14px; display: grid; gap: 9px; align-content: start; }
.pe-page i { display: block; height: 7px; border-radius: 4px; background: rgba(28,31,36,.22); }
.pe-page i:nth-child(2n) { width: 82%; } .pe-page i:nth-child(3n) { width: 64%; }
.pe-page::before, .pe-page::after { content: ""; position: absolute; width: 22px; height: 22px; border: 3px solid var(--ink); }
.pe-page.scan::before { left: -14px; top: -14px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.pe-page.scan::after { right: -14px; bottom: -14px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.pe-page.ocr::before, .pe-page.ocr::after, .pe-page.edit::before, .pe-page.edit::after { display: none; }
.pe-beam { position: absolute; left: -10px; right: -10px; height: 3px; background: var(--signal); box-shadow: 0 0 12px 3px rgba(229,20,27,.5); top: 10%; animation: pe-beam 2.6s ease-in-out infinite; }
@keyframes pe-beam { 0% { top: 8% } 50% { top: 90% } 100% { top: 8% } }
.pe-step.on .pe-page.ocr i { animation: pe-word .5s forwards; outline: 0 solid transparent; }
.pe-page.ocr i { transition: background .3s; }
.pe-step.on .pe-page.ocr i:nth-child(1) { animation-delay: .2s } .pe-step.on .pe-page.ocr i:nth-child(2) { animation-delay: .5s }
.pe-step.on .pe-page.ocr i:nth-child(3) { animation-delay: .8s } .pe-step.on .pe-page.ocr i:nth-child(4) { animation-delay: 1.1s }
.pe-step.on .pe-page.ocr i:nth-child(5) { animation-delay: 1.4s } .pe-step.on .pe-page.ocr i:nth-child(6) { animation-delay: 1.7s }
@keyframes pe-word { to { background: rgba(28,31,36,.55); box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px rgba(229,20,27,.6) } }
.pe-page.edit i.sel { position: relative; background: rgba(48,79,187,.25); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--signal); }
.pe-step.on .pe-page.edit i.sel { animation: pe-retype 3s ease-in-out infinite; }
@keyframes pe-retype { 0%, 30% { width: 64% } 50% { width: 20% } 80%, 100% { width: 86%; background: rgba(229,20,27,.6) } }

/* ---------- editor demo ---------- */
.pe-edit, .pe-sign, .pe-pro, .pe-types, .pe-private, .pe-gallery, .pe-cta { padding: clamp(60px, 8vw, 110px) 0; }
.pe-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.pe-split.rev > :first-child { order: 0; }
.pe-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.pe-list li { padding-left: 30px; position: relative; color: var(--ink-2); }
.pe-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border: 2.5px solid var(--signal); border-radius: 4px; }
.pe-list b { color: var(--ink); }
.pe-invoice { background: var(--sheet); border-radius: 18px; padding: 28px 30px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); transform: rotate(-1.5deg); }
.pe-inv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.pe-inv-head em { margin-left: auto; font-style: normal; font-family: var(--font-display); font-weight: 800; letter-spacing: .14em; }
.pe-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--signal); }
.pe-inv-row, .pe-inv-total { display: flex; justify-content: space-between; padding: 9px 0; color: var(--ink-2); border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.pe-inv-total { border-bottom: 0; padding-top: 18px; font-size: 22px; color: var(--ink); align-items: center; }
.pe-amount { position: relative; padding: 4px 8px; border-radius: 6px; transition: background .3s, box-shadow .3s; font-weight: 600; }
.pe-amount.sel { box-shadow: 0 0 0 2px var(--signal); background: rgba(48,79,187,.12); }
.pe-amount.sel::before, .pe-amount.sel::after { content: ""; position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid var(--signal); }
.pe-amount.sel::before { left: -6px; top: -6px; } .pe-amount.sel::after { right: -6px; bottom: -6px; }
.pe-amount.done .pe-typed { font-family: var(--font-display); color: var(--signal); font-weight: 800; }
.pe-caret { display: inline-block; width: 2px; height: 1em; background: var(--pen); vertical-align: -2px; margin-left: 2px; opacity: 0; }
.pe-amount.typing .pe-caret { opacity: 1; animation: pe-blink .8s steps(1) infinite; }
@keyframes pe-blink { 50% { opacity: 0 } }
.pe-fonts { display: flex; gap: 10px; margin-top: 22px; align-items: center; }
.pe-fonts span { width: 52px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; background: var(--paper); transition: all .3s; }
.pe-fonts .serif { font-family: var(--font-display); font-weight: 800; }
.pe-fonts .mono { font-family: var(--font-mono); }
.pe-invoice.styled .pe-fonts .serif { background: var(--signal); color: #fff; border-color: var(--signal); }
.pe-fonts .pe-swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--signal); border: 3px solid #fff; box-shadow: var(--shadow-sm); }

/* ---------- page types ---------- */
.pe-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pe-type { background: var(--sheet); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
.pe-type h3 { font-size: 22px; margin: 18px 0 6px; } .pe-type p { color: var(--ink-2); margin: 0; font-size: 16px; }
.pe-glyph { width: 76px; height: 96px; border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); padding: 16px 12px; display: grid; gap: 9px; align-content: start; border: 1px solid var(--line); }
.pe-glyph i { height: 6px; border-radius: 3px; background: var(--ink); } .pe-glyph i:nth-child(4) { width: 60%; }
.pe-glyph.ti, .pe-glyph.io { background: linear-gradient(135deg, #efe9da, #ddd6c4); }
.pe-glyph.io i { background: rgba(28,31,36,.4); outline: 1.5px dashed rgba(229,20,27,.55); outline-offset: 3px; }
.pe-sizes { margin-top: 26px; }

/* ---------- sign ---------- */
.pe-lease { background: var(--sheet); border-radius: 18px; padding: 34px 34px 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-family: var(--font-display); color: var(--ink-2); transform: rotate(1.2deg); }
.pe-lease p { margin: 0 0 16px; font-size: 17px; }
.pe-mark { background: linear-gradient(transparent 38%, color-mix(in srgb, var(--marker) 85%, transparent) 38%, color-mix(in srgb, var(--marker) 85%, transparent) 92%, transparent 92%) no-repeat; background-size: 0 100%; color: inherit; transition: background-size 1.2s ease; padding: 0 2px; }
.pe-lease.in .pe-mark { background-size: 100% 100%; }
.pe-sig { width: 70%; margin: 18px 0 -10px 30%; overflow: visible; }
.pe-sig path { fill: none; stroke: var(--pen); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; transition: stroke-dashoffset 2.6s ease .9s; }
.pe-lease.in .pe-sig path { stroke-dashoffset: 0; }
.pe-line { border-top: 1px solid var(--ink-3); margin-left: 30%; padding-top: 6px; font-family: var(--font); font-size: 13px; color: var(--ink-3); }

/* ---------- privacy ---------- */
.pe-badges-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.pe-badges-row span { border: 1.5px solid var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 15px; background: var(--sheet); }

/* ---------- gallery ---------- */
.pe-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); margin-top: 14px; }
.pe-tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.pe-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.pe-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 250px); gap: 22px; overflow-x: auto; padding: 10px 4px 26px; scroll-snap-type: x mandatory; }
.pe-rail.wide { grid-auto-columns: minmax(300px, 420px); }
.pe-rail figure { margin: 0; scroll-snap-align: center; }
.pe-rail img { border-radius: 30px; box-shadow: var(--shadow-lg); border: 8px solid #1e2127; }
.pe-rail.wide img { border-radius: 26px; border-width: 10px; }
.pe-rail figcaption { text-align: center; color: var(--ink-2); font-weight: 600; margin-top: 12px; font-size: 15px; }

/* ---------- PRO receipt ---------- */
.pe-receipt {
  background: var(--sheet); padding: 24px 26px 38px; box-shadow: var(--shadow-lg);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/18px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/18px 100%;
}
.pe-r-head, .pe-r-row { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; text-align: center; }
.pe-r-head { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 10px; }
.pe-r-head span:first-child, .pe-r-row span:first-child { text-align: left; }
.pe-r-head .pro { color: #fff; background: linear-gradient(100deg, var(--signal), var(--crimson)); border-radius: 999px; padding: 3px 0; font-family: var(--font-display); }
.pe-r-row { padding: 12px 0; border-top: 1px dashed var(--line); }
.pe-r-row .pro { color: var(--signal); font-weight: 800; font-family: var(--font-display); font-size: 18px; }

.pe-cta .badges { justify-content: center; margin-top: 26px; }

/* ---------- responsive / motion ---------- */
@media (max-width: 900px) {
  .pe-hero-grid, .pe-split { grid-template-columns: 1fr; }
  .pe-stage { height: 520px; }
  .pe-steps, .pe-type-grid { grid-template-columns: 1fr; }
  .pe-split.rev > :first-child { order: 2; }
}
@media (max-width: 520px) {
  .pe-stage { height: 470px; }
  .pe-phone { width: 220px; }
  .pe-lens { width: 120px; left: 0; top: 2%; }
  .pe-invoice, .pe-lease { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .pe-phone, .pe-lens, .pe-blades, .pe-chip, .pe-laser, .pe-beam { animation: none !important; }
  .pe-mark { transition: none; background-size: 100% 100%; }
  .pe-sig path { transition: none; stroke-dashoffset: 0; }
}
.pe-rail[hidden] { display: none; }
