/* css/grid/optimal.css  -  /optimal (grid/optimal.php), 2026-11-25. Sits on landing.css. */

/* On now: the dated highlights */
.op-his { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 6px 0 4px; }
.op-hi { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; border-radius: 14px; text-decoration: none !important;
  background: rgba(92,184,92,.12); border: 2px solid rgba(92,184,92,.7); box-shadow: 0 0 24px rgba(92,184,92,.18);
  transition: transform .2s ease, background .2s ease; }
.op-hi:hover, .op-hi:focus-visible { transform: translateY(-2px); background: rgba(92,184,92,.2); outline: none; }
.op-hi-k { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #7fd17f; }
.op-hi-t { font-size: 22px; line-height: 1.25; font-weight: bold; color: #fff; }
.op-hi-p { font-size: 16px; line-height: 1.5; color: #e7edf4; }
.op-hi-b { margin-top: auto; padding-top: 6px; font-weight: bold; color: #7fd17f; }

/* What you can do here */
.op-sts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 6px 0 4px; }
.op-st { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border-radius: 12px; text-decoration: none !important;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); transition: transform .2s ease, border-color .2s ease; }
.op-st:hover, .op-st:focus-visible { transform: translateY(-2px); border-color: #83e6ff; outline: none; }
.op-st-i { font-size: 26px; line-height: 1; }
.op-st-k { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: #83e6ff; }
.op-st-t { font-size: 18px; line-height: 1.3; font-weight: bold; color: #fff; }
.op-st-p { font-size: 14.5px; line-height: 1.5; color: #cfd8e2; }

/* The box, at the very bottom */
.op-ask { max-width: 640px; margin: 0 auto; text-align: center; }
.op-tried { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: #aab6c3; }
.op-tried code { display: inline-block; max-width: 100%; vertical-align: bottom; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.08); color: #e7edf4; font-size: 13px; }   /* always one line */
.op-form { display: flex; gap: 8px; }
.op-form input[type=search] { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,.45); color: #fff; font-size: 16px; }
.op-form input[type=search]:focus { outline: 2px solid #83e6ff; outline-offset: 1px; }
.op-form button { padding: 12px 20px; border: 0; border-radius: 10px; background: #1f5fd0; background-image: linear-gradient(135deg, #1f5fd0, #2a9df4);
  color: #fff; font-weight: bold; font-size: 16px; cursor: pointer; }
.op-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.op-res { text-align: left; margin-top: 14px; }
.op-say { margin: 0 0 8px; color: #e7edf4; }
.op-list { margin: 0 0 14px; padding-left: 22px; }
.op-list li { margin: 0 0 12px; line-height: 1.5; color: #cfd8e2; font-size: 15px; }
.op-list a { color: #83e6ff; font-weight: bold; font-size: 16.5px; }
.op-k { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: #9fb3c4; }
.op-web { display: inline-block; padding: 9px 16px; border-radius: 9px; border: 1px solid rgba(131,230,255,.55); color: #83e6ff !important; text-decoration: none !important; font-size: 14.5px; }
@media (max-width: 560px) { .op-form { flex-direction: column; } .op-hi-t { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .op-hi, .op-st { transition: none; } }

/* ===================== 2026-11-25: heart and motion (grid/_optimal-art.php) ===================== */

/* A lone node finds the grid */
.op-lost { margin: -4px 0 18px; }
.op-lost svg { display: block; width: 100%; height: auto; overflow: visible; }
.op-lat line { stroke: rgba(131,230,255,.22); stroke-width: 1.2; }
.op-nodes circle { fill: #83e6ff; opacity: .55; transform-box: fill-box; transform-origin: center; animation: op-ripple 10s ease-out infinite; animation-delay: calc(6.4s + var(--d)); }
.op-broken { fill: none; stroke: #f0932b; stroke-width: 2.4; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .75; animation: op-broken 10s linear infinite; }
.op-reach { stroke: #5cb85c; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: op-reach 10s ease-out infinite; }
.op-me { animation: op-travel 10s cubic-bezier(.45,.05,.3,1) infinite; }
.op-me-dot { fill: #f0932b; stroke: #ffe3b0; stroke-width: 2; animation: op-turn 10s linear infinite; }
.op-me-halo { animation: op-halo 10s ease-in-out infinite; }
@keyframes op-travel {
  0%   { transform: translate(10px, 190px); opacity: 0; }
  6%   { opacity: 1; }
  30%  { transform: translate(190px, 150px); }
  38%  { transform: translate(202px, 150px); }       /* the gap in the link: it hesitates */
  52%  { transform: translate(318px, 118px); }
  92%  { transform: translate(318px, 118px); opacity: 1; }
  100% { transform: translate(318px, 118px); opacity: 0; }
}
@keyframes op-broken { 0%, 55% { opacity: .75; } 70%, 100% { opacity: .12; } }
@keyframes op-reach  { 0%, 54% { stroke-dashoffset: 80; } 64%, 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes op-turn   { 0%, 62% { fill: #f0932b; } 68%, 100% { fill: #5cb85c; stroke: #d8ffd8; } }
@keyframes op-halo   { 0%, 62% { opacity: .9; } 70%, 100% { opacity: .25; } }
@keyframes op-ripple { 0% { transform: scale(1); opacity: .55; fill: #83e6ff; } 6% { transform: scale(2.1); opacity: 1; fill: #b8ffb8; } 16%, 100% { transform: scale(1); opacity: .55; fill: #83e6ff; } }

/* Flatland beside the grid */
.op-fig { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 12px; }
.op-fig figure, .op-fig-json { margin: 0; padding: 12px; border-radius: 16px; background: rgba(5,14,26,.75); border: 1px solid rgba(150,185,235,.18); }
.op-fig figcaption, .op-fig-json figcaption { margin-top: 8px; text-align: center; font: 11.5px/1.45 "Space Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: #8fa6c6; }
.op-fig .egx-globe { height: 300px; margin: 0; }
.op-flat { display: block; width: 100%; height: 300px; }
.op-flat-globe { fill: none; stroke: #8fa6c6; stroke-width: 1.3; transform-box: view-box; transform-origin: 180px 150px; animation: op-flatten 12s ease-in-out infinite; }
.op-flat-sheet { opacity: 0; animation: op-sheet 12s ease-in-out infinite; }
.op-flat-sheet line, .op-sh-frame { stroke: #6f86a6; stroke-width: 1.2; fill: none; }
.op-sh-frame { fill: rgba(255,255,255,.03); }
.op-flat-sheet text { fill: #8fa6c6; font: 12px ui-monospace, monospace; text-anchor: middle; }
.op-sh-cursor { fill: rgba(240,147,43,.22); stroke: #f0932b; stroke-width: 2; animation: op-cell 12s steps(1, end) infinite; }
@keyframes op-flatten { 0%, 28% { transform: scale(1, 1); opacity: 1; } 40% { transform: scale(1.25, .06); opacity: .8; } 46%, 100% { transform: scale(1.25, .06); opacity: 0; } }
@keyframes op-sheet   { 0%, 40% { opacity: 0; } 48%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes op-cell {   /* one cell at a time, slowly */
  0%, 50% { transform: translate(0, 0); }  54% { transform: translate(54px, 0); }  58% { transform: translate(108px, 0); }
  62% { transform: translate(162px, 0); }  66% { transform: translate(216px, 0); } 70% { transform: translate(0, 32px); }
  74% { transform: translate(54px, 32px); } 78% { transform: translate(108px, 32px); } 82% { transform: translate(162px, 32px); }
  86% { transform: translate(216px, 32px); } 90%, 100% { transform: translate(0, 64px); }
}

/* How AI holds what it knows: the lines nest in, then one pulse lights them all at once */
.op-fig-json { margin: 0 0 14px; }
.op-json-code { position: relative; overflow: hidden; padding: 14px 16px; border-radius: 10px; background: #020a13;
  font: 13.5px/1.75 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #9fb3c8; white-space: pre; overflow-x: auto; }
.op-jl { display: block; padding-left: calc(var(--in) * 1.6em); opacity: 0; animation: op-jl 9s ease-out infinite; animation-delay: calc(var(--i) * .22s); }
.op-jl b { color: #6f86a6; font-weight: normal; }
.op-jl i { color: #83e6ff; font-style: normal; animation: op-lit 9s linear infinite; }
.op-jl s { color: #ffc27a; text-decoration: none; }
.op-jpulse { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(92,184,92,.0) 40%, rgba(92,184,92,.28) 50%, rgba(92,184,92,0) 60%, transparent 100%);
  transform: translateY(-100%); animation: op-pulse 9s ease-in infinite; }
@keyframes op-jl    { 0% { opacity: 0; transform: translateX(-8px); } 4%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes op-pulse { 0%, 46% { transform: translateY(-100%); } 52% { transform: translateY(100%); } 100% { transform: translateY(100%); } }
@keyframes op-lit   { 0%, 47% { color: #83e6ff; text-shadow: none; } 49%, 60% { color: #d8ffd8; text-shadow: 0 0 10px rgba(92,184,92,.9); } 70%, 100% { color: #83e6ff; text-shadow: none; } }
.op-speed { margin: 6px auto 0; max-width: 40em; text-align: center; font-size: 17px; line-height: 1.6; color: #e7edf4; }

/* On Now: a shine sweeps across */
.op-hi { position: relative; overflow: hidden; }
.op-hi::after { content: ""; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.14), transparent); transform: skewX(-18deg); animation: op-shine 6s ease-in-out infinite; }
.op-hi + .op-hi::after { animation-delay: 1.2s; }
@keyframes op-shine { 0%, 60% { left: -60%; } 85%, 100% { left: 130%; } }
.op-st-i { display: inline-block; transition: transform .3s ease; }
.op-st:hover .op-st-i { transform: translateY(-3px) rotate(-6deg) scale(1.12); }

/* Cards rise in as they come into view (the script adds .op-js and .op-in) */
.op-js .op-st, .op-js .op-hi, .op-js .op-fig figure, .op-js .op-fig-json { opacity: 0; transform: translateY(18px); transition: opacity .7s ease var(--k, 0s), transform .7s cubic-bezier(.2,.8,.2,1) var(--k, 0s); }
.op-js .op-in { opacity: 1 !important; transform: none !important; }

/* Results in the box arrive one by one */
.op-list li { animation: op-li .45s ease both; }
.op-list li:nth-child(2) { animation-delay: .07s; } .op-list li:nth-child(3) { animation-delay: .14s; } .op-list li:nth-child(4) { animation-delay: .21s; }
.op-list li:nth-child(5) { animation-delay: .28s; } .op-list li:nth-child(6) { animation-delay: .35s; }
@keyframes op-li { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .op-fig { grid-template-columns: 1fr; }
  .op-flat, .op-fig .egx-globe { height: 260px; }
  .op-json-code { font-size: 12px; }
  .op-speed { font-size: 16px; }
}

/* Reduced motion: every picture finished and still */
@media (prefers-reduced-motion: reduce) {
  .op-nodes circle, .op-broken, .op-reach, .op-me, .op-me-dot, .op-me-halo, .op-flat-globe, .op-flat-sheet, .op-sh-cursor,
  .op-jl, .op-jl i, .op-jpulse, .op-hi::after, .op-list li { animation: none !important; }
  .op-me { transform: translate(318px, 118px); }
  .op-me-dot { fill: #5cb85c; }
  .op-reach { stroke-dashoffset: 0; }
  .op-broken { opacity: .2; }
  .op-flat-globe { opacity: 0; }
  .op-flat-sheet, .op-jl { opacity: 1; }
  .op-jpulse { display: none; }
}

/* Why Are You Here?: one statement and one button, centred across the full width (2026-11-25) */
#why .egl-sec-art { display: none; }
#why .egl-sec-text { flex: 1 1 100%; max-width: none; width: 100%; }
#why .egl-quote { font-size: 30px; line-height: 1.35; }
#why .egl-center-btns { display: flex; justify-content: center; max-width: none; width: 100%; margin: 18px 0 0; }
#why .egl-btn { font-size: 18px; padding: 14px 30px; animation: op-beckon 3.2s ease-in-out infinite; }
@keyframes op-beckon { 0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(240,147,43,.0); } 80% { box-shadow: 0 0 0 10px rgba(240,147,43,.18); } 90% { box-shadow: 0 0 0 18px rgba(240,147,43,0); } }
@media (max-width: 760px) { #why .egl-quote { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { #why .egl-btn { animation: none; } }
