/* BuildAPI — homepage premium visuals & animation layer (loads on top of main.css) */

/* The header lives in main.css now, as a reusable overlay state rather than a
   homepage special case — this file carried a body.home copy of it, so every
   other page kept the flat white bar. index.php opts in with $headerOverlay. */

/* ============================ HERO ============================ */
.hx {
  position: relative; overflow: hidden; color: #e8ecff;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(56,80,220,.28), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(124,77,255,.22), transparent 55%),
    linear-gradient(180deg, #070b16 0%, #0a1020 60%, #0b1226 100%);
  padding: 120px 24px 90px;
}
.hx-canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: .9; }
.hx-grid { position: absolute; inset: 0; z-index: 0; background-image:
  linear-gradient(rgba(120,140,255,.06) 1px, transparent 1px),
  linear-gradient(90deg, rgba(120,140,255,.06) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 78%); }
.hx-inner { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; display: grid; gap: 56px; grid-template-columns: 1fr; align-items: center; }
.hx-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(124,77,255,.12); border: 1px solid rgba(124,77,255,.35); color: #cbb8ff; font-size: .78rem; font-weight: 700; letter-spacing: .04em; margin-bottom: 22px; }
.hx-eyebrow .pulse { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulseDot 1.8s infinite; }
@keyframes pulseDot { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.55)} 70%{box-shadow:0 0 0 8px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }
.hx h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.03; font-weight: 900; letter-spacing: -.02em; margin: 0 0 22px; color: #fff; }
.hx h1 .grad { background: linear-gradient(100deg, #6ea8ff, #a78bfa 55%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-lead { font-size: 1.15rem; line-height: 1.6; color: #aeb9e6; max-width: 560px; margin: 0 0 30px; }
.hx-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.hx-cta .btn-primary { background: linear-gradient(100deg, #4f46e5, #7c4dff); box-shadow: 0 12px 30px rgba(79,70,229,.4); border: none; }
.hx-cta .btn-primary:hover { filter: brightness(1.08); opacity: 1; }
.hx-cta .btn-glass { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #e8ecff; }
.hx-cta .btn-glass:hover { background: rgba(255,255,255,.12); }
/* A grid, not a flex row with dividers between the items.
 *
 * With three items and separators this was one row that happened to fit. A
 * fourth pushed it to wrap — and a wrapped flex row leaves a divider at the end
 * of the first line, pointing at nothing. A grid puts them 2x2 on a phone and
 * across on a desktop with no separators to strand. */
.hx-trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
@media (min-width: 1200px) { .hx-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hx-trust .t b { display: block; font-size: 1.25rem; font-weight: 800; color: #fff; }
.hx-trust .t span { font-size: .7rem; color: #7d88b8; text-transform: uppercase; letter-spacing: .08em; }
.hx-trust .sep { display: none; }

@media (min-width: 992px) { .hx-inner { grid-template-columns: 1.05fr .95fr; } }

/* Live product panel (right side) */
.hx-panel { position: relative; }
/* The card is the shield's frame of reference now, and it has to let the badge
   hang outside itself on a wide screen. Nothing inside .term paints its own
   background, so the clip .glass sets was not doing any work here. */
.hx-panel .term { position: relative; overflow: visible; }
.hx-panel .float-shield { position: absolute; right: -6px; top: -34px; z-index: 3; width: 74px; height: 74px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(34,197,94,.05)); border: 1px solid rgba(34,197,94,.4);
  display: flex; align-items: center; justify-content: center; color: #4ade80; box-shadow: 0 14px 40px rgba(34,197,94,.25);
  animation: floaty 5s ease-in-out infinite; }
.hx-panel .float-shield svg { width: 34px; height: 34px; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

.glass { background: linear-gradient(180deg, rgba(22,30,55,.9), rgba(14,20,40,.92)); border: 1px solid rgba(120,140,255,.16);
  border-radius: 18px; box-shadow: 0 30px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05); backdrop-filter: blur(10px); overflow: hidden; }

/* Terminal */
.term { }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(120,140,255,.12); }
.term-dot { width: 11px; height: 11px; border-radius: 999px; }
.term-dot.r { background: #ff5f57; } .term-dot.y { background: #febc2e; } .term-dot.g { background: #28c840; }
.term-title { margin-left: 8px; font-size: .74rem; color: #7d88b8; font-family: ui-monospace, monospace; }
.term-body { padding: 18px 18px 20px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .82rem; line-height: 1.75; min-height: 210px; }
.term-body .ln { white-space: pre-wrap; word-break: break-word; }
.term .c-prompt { color: #7c4dff; } .term .c-cmd { color: #e8ecff; } .term .c-flag { color: #6ea8ff; }
.term .c-str { color: #4ade80; } .term .c-key { color: #7dd3fc; } .term .c-num { color: #fca5a5; } .term .c-punct { color: #64748b; }
.term .status-200 { display: inline-block; background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.35); border-radius: 6px; padding: 1px 8px; font-size: .72rem; font-weight: 700; }
.term .caret { display: inline-block; width: 8px; height: 15px; background: #7c4dff; margin-left: 2px; vertical-align: middle; animation: blinkCaret 1s steps(1) infinite; }
@keyframes blinkCaret { 50% { opacity: 0; } }

/* Mini live dashboard under the terminal */
.hx-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.hx-metric { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px 14px; }
.hx-metric .lbl { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: #7d88b8; display: flex; align-items: center; gap: 6px; }
.hx-metric .val { font-size: 1.25rem; font-weight: 800; color: #fff; margin-top: 4px; }
.hx-metric .dot { width: 6px; height: 6px; border-radius: 999px; background: #22c55e; animation: pulseDot 1.8s infinite; }
.spark { display: block; width: 100%; height: 34px; margin-top: 10px; }

/* wave divider */
.hx-wave { position: relative; z-index: 2; line-height: 0; }
.hx-wave svg { display: block; width: 100%; height: 70px; }

/* ============================ LOGO MARQUEE ============================ */
.logos { padding: 40px 24px; background: #fff; border-bottom: 1px solid var(--border); overflow: hidden; }
.logos p { text-align: center; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; margin: 0 0 22px; }
.logos-track { display: flex; align-items: center; gap: 56px; width: max-content; animation: scroll-left 32s linear infinite; }
.logos-track:hover { animation-play-state: paused; }
.logos-track svg { height: 26px; width: auto; color: #94a3b8; opacity: .8; flex-shrink: 0; transition: color .2s, opacity .2s; }
.logos-track svg:hover { color: #334155; opacity: 1; }

/* ============================ SECTION SHELL / REVEAL ============================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.sec-eyebrow { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6366f1; margin-bottom: 14px; }

/* Enhanced feature cards with 3D tilt + glow */
.fx-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 1152px; margin: 0 auto; }
@media (min-width: 640px) { .fx-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .fx-grid { grid-template-columns: repeat(4, 1fr); } }
.fx-card { position: relative; background: #fff; border: 1px solid #e8ecf5; border-radius: 18px; padding: 30px 26px;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s; transform-style: preserve-3d; will-change: transform; }
.fx-card::before { content: ''; position: absolute; inset: 0; border-radius: 18px; padding: 1px;
  background: linear-gradient(135deg, rgba(99,102,241,.5), transparent 40%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .25s; }
.fx-card:hover { box-shadow: 0 24px 50px rgba(37,60,120,.14); border-color: transparent; }
.fx-card:hover::before { opacity: 1; }
.fx-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #4f46e5; transition: transform .25s; }
.fx-card:hover .fx-icon { transform: translateZ(30px) scale(1.06); }
.fx-icon svg { width: 26px; height: 26px; }
.fx-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; color: #0f172a; }
.fx-card p { font-size: .88rem; line-height: 1.6; color: #64748b; margin: 0; }
.fx-badge { position: absolute; top: 18px; right: 18px; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #7c3aed; background: #f3e8ff; padding: 3px 8px; border-radius: 999px; }

/* ============================ FLOW / "IN ACTION" ============================ */
.flow { padding: 96px 24px; background: linear-gradient(180deg, #f8faff, #eef2fb); }
.flow-diagram { max-width: 1000px; margin: 40px auto 0; }
.flow-diagram svg { width: 100%; height: auto; }
.flow .node-label { font: 700 13px/1 -apple-system, system-ui, sans-serif; fill: #0f172a; }
.flow .node-sub { font: 500 10px/1 -apple-system, system-ui, sans-serif; fill: #64748b; }
.flow .dash { stroke-dasharray: 6 10; animation: dashmove 1s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -32; } }

/* ============================ SECURITY (dark) ============================ */
.sec-dark { position: relative; overflow: hidden; padding: 100px 24px; color: #e8ecff;
  background: radial-gradient(800px 500px at 80% 0%, rgba(34,197,94,.14), transparent 60%), linear-gradient(180deg, #0a1020, #070b16); }
.sec-dark .wrap { max-width: 1152px; margin: 0 auto; display: grid; gap: 56px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .sec-dark .wrap { grid-template-columns: 1fr 1fr; } }
.sec-dark h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: #fff; margin: 0 0 18px; letter-spacing: -.02em; }
.sec-dark p.lead { color: #aeb9e6; font-size: 1.05rem; line-height: 1.65; margin: 0 0 26px; }
.sec-list { display: flex; flex-direction: column; gap: 14px; }
.sec-list li { list-style: none; display: flex; gap: 12px; align-items: flex-start; }
.sec-list .ic { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.34); color: #4ade80; display: flex; align-items: center; justify-content: center; }
.sec-list .ic svg { width: 16px; height: 16px; }
.sec-list h4 { font-size: .95rem; font-weight: 700; color: #fff; margin: 0 0 2px; }
.sec-list p { font-size: .84rem; color: #8f9cc9; margin: 0; }

/* Animated shield visual */
.shield-viz { position: relative; display: flex; align-items: center; justify-content: center; min-height: 340px; }
.shield-ring { position: absolute; border: 1px solid rgba(34,197,94,.25); border-radius: 999px; animation: ringPulse 3.5s ease-out infinite; }
.shield-ring.r1 { width: 180px; height: 180px; }
.shield-ring.r2 { width: 260px; height: 260px; animation-delay: .7s; }
.shield-ring.r3 { width: 340px; height: 340px; animation-delay: 1.4s; }
@keyframes ringPulse { 0%{transform:scale(.75);opacity:.7} 100%{transform:scale(1.05);opacity:0} }
.shield-core { position: relative; z-index: 2; width: 132px; height: 132px; border-radius: 32px;
  background: linear-gradient(135deg, rgba(34,197,94,.28), rgba(16,120,80,.12)); border: 1px solid rgba(34,197,94,.5);
  display: flex; align-items: center; justify-content: center; color: #4ade80; box-shadow: 0 20px 60px rgba(34,197,94,.3); }
.shield-core svg { width: 62px; height: 62px; }

/* ============================ METRICS BAND ============================ */
.metrics { padding: 70px 24px; background: linear-gradient(100deg, #4f46e5, #7c4dff); color: #fff; }
.metrics .wrap { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(2,1fr); gap: 30px; text-align: center; }
@media (min-width: 768px) { .metrics .wrap { grid-template-columns: repeat(4,1fr); } }
.metrics .m b { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; letter-spacing: -.02em; display: block; }
.metrics .m span { font-size: .82rem; color: rgba(255,255,255,.75); }

/* ============================ INDUSTRY (reuse dark styling via home) ============================ */
.ind2 { position: relative; overflow: hidden; padding: 96px 24px; background: #0b1020; color: #fff; }
.ind2 .wrap { max-width: 1152px; margin: 0 auto; }
.ind2-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 44px; }
@media (min-width: 768px) { .ind2-grid { grid-template-columns: 1fr 1fr; } }
.ind2-card { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.09); border-radius: 18px; padding: 34px; overflow: hidden; transition: transform .2s, border-color .2s; }
.ind2-card:hover { transform: translateY(-4px); border-color: rgba(124,77,255,.5); }
.ind2-card .ic { width: 50px; height: 50px; border-radius: 13px; background: #fff; color: #0b1020; display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.ind2-card h3 { font-size: 1.35rem; font-weight: 700; margin: 0 0 8px; }
.ind2-card p { color: #94a3b8; margin: 0; line-height: 1.6; }
.ind2-card .glow { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; background: radial-gradient(circle, rgba(124,77,255,.35), transparent 70%); opacity: 0; transition: opacity .3s; }
.ind2-card:hover .glow { opacity: 1; }

/* ===================== HERO ON A PHONE =====================
 * There were no mobile rules here at all: the hero ran on desktop padding
 * (120px top, 90px bottom) with everything stacked, so on a 375px screen the
 * headline alone took five lines and the first thing a visitor saw was a
 * fragment of a sentence with the buttons somewhere below the fold.
 *
 * Two screens now, deliberately. The first is the pitch and finishes inside
 * the viewport; the second is the live request panel. Nothing is cut off,
 * because these are MIN heights — content taller than the screen still grows
 * the section rather than being clipped.
 *
 * svh, not vh. On a phone vh is the height with the browser chrome RETRACTED,
 * so a hero sized to 100vh has its last line hidden under the address bar on
 * first paint, which is exactly the "cut off" being complained about. svh is
 * the small viewport — chrome showing — and vh stays as the fallback above it
 * for engines that do not know svh.
 * ======================================================================== */
@media (max-width: 991px) {
  .hx { padding: 0 20px 64px; }
  .hx-inner { gap: 0; }

  .hx-text {
    min-height: calc(100vh - var(--hx-hdr));
    min-height: calc(100svh - var(--hx-hdr));
    display: flex; flex-direction: column; justify-content: center;
    padding: 26px 0 30px;
  }
  .hx { --hx-hdr: 78px; }

  .hx-eyebrow { font-size: .74rem; padding: 5px 12px; }
  .hx h1 { font-size: clamp(1.95rem, 8.4vw, 2.9rem); line-height: 1.08; margin: 14px 0 14px; }
  .hx-lead { font-size: .95rem; line-height: 1.55; margin: 0 0 22px; }

  /* Side by side. They were stacked full-width, which is two big slabs down
   * the screen for what is one decision. */
  .hx-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
  .hx-cta .btn { width: 100%; justify-content: center; padding: 0 10px; height: 48px; font-size: .92rem; }
  .hx-cta .btn .icon { width: 15px; height: 15px; }

  /* 2x2, and the dividers go — they were drawn between items that are no
   * longer in a row. */
  .hx-trust { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
  .hx-trust .sep { display: none; }
  .hx-trust .t b { font-size: 1.02rem; }
  .hx-trust .t span { font-size: .66rem; letter-spacing: .06em; }

  /* The second screen: the live request, given room of its own. */
  .hx-panel {
    min-height: calc(100vh - var(--hx-hdr));
    min-height: calc(100svh - var(--hx-hdr));
    display: flex; flex-direction: column; justify-content: center;
    padding: 20px 0 10px;
  }
  /* On a phone the hero is two screens: the pitch, then the request panel.
   *
   * Measured against the PANEL, every offset was a guess about where the fold
   * falls: the panel's top edge is roughly the bottom of the first screen, so
   * a small offset left the badge peeking above the fold and a large one was
   * only correct for one handset. Anchored to the BOTTOM of the terminal card
   * it is hundreds of pixels into the second screen on any phone, and it is on
   * the empty part of the card rather than over the typed request. */
  .hx-panel .float-shield { width: 48px; height: 48px; top: auto; bottom: 16px; right: 14px; border-radius: 14px; }
  .hx-panel .float-shield svg { width: 24px; height: 24px; }
  .hx-metrics { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hx-metric { padding: 10px; }
  .hx-metric .val { font-size: 1rem !important; }
}

/* Shorter phones — a 667px screen is an iPhone SE or an 8, and it is still very
 * common. At the sizes above, the hero measured 697px against 667 of viewport,
 * so the last row of the 2x2 block sat under the fold: the exact fault this was
 * meant to remove, just on a different handset. Everything gives a little
 * rather than one thing giving a lot. */
@media (max-width: 991px) and (max-height: 740px) {
  .hx-text { padding: 18px 0 20px; }
  .hx-eyebrow { font-size: .7rem; padding: 4px 11px; }
  .hx h1 { font-size: clamp(1.75rem, 7.4vw, 2.4rem); margin: 12px 0 11px; }
  .hx-lead { font-size: .88rem; line-height: 1.5; margin: 0 0 18px; }
  .hx-cta { gap: 9px; margin-bottom: 18px; }
  .hx-cta .btn { height: 44px; font-size: .87rem; }
  .hx-trust { gap: 12px 10px; }
  .hx-trust .t b { font-size: .95rem; }
  .hx-trust .t span { font-size: .62rem; }
}

/* Very short screens — a landscape phone, or a small window. Centring inside a
 * full viewport there would push the buttons off the bottom, so the hero stops
 * trying to fill the screen and simply flows. */
@media (max-width: 991px) and (max-height: 560px) {
  .hx-text, .hx-panel { min-height: 0; padding: 24px 0; }
}
