/* Palm Eye Cloud portal — the first-run ceremony (ceremony.js, 2026-10-13): the living brand backdrop behind the public
 * auth pages, the welcome after a sign-in, The Eye's guide (dim, a soft cut-out, a small card), the two rewards
 * (a burst of light, a self-drawing check), and the micro-interactions that make a client's portal feel like the app.
 * Owner, 2026-10-13: "buttery animations, micro interactions, just small things, to the last detail done excruciatingly
 * well … it must not feel like a dashboard". Scope: client users (body.role-customer) and the public auth pages
 * (.eye-auth) only — the admin's dense tools are untouched. Motion is transform / opacity (and the individual
 * translate / scale properties, so an entrance never fights a hover); every bit of it stops under
 * prefers-reduced-motion. Copyright © 2026 Palm Digitalz. All rights reserved. */

/* ---------- tokens (dark first, like styles.css; light from the system or the manual switch) ---------- */
:root {
  --eye-dim: rgba(4, 4, 6, .62);
  --eye-dim-edge: rgba(4, 4, 6, .34);
  --eye-ring: rgba(232, 163, 61, .42);
  --eye-glow: rgba(232, 163, 61, .22);
  --eye-field-a: rgba(232, 163, 61, .16);
  --eye-field-b: rgba(255, 196, 107, .07);
  --eye-line: rgba(245, 245, 247, .16);
  --eye-iris: rgba(232, 163, 61, .5);
  --eye-iris-soft: rgba(232, 163, 61, .18);
  --eye-grain: .07;
  --eye-card: rgba(22, 22, 26, .86);
  --eye-card-shadow: 0 28px 70px -18px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .3);
  --eye-lift: 0 20px 44px -20px rgba(0, 0, 0, .75);
  --eye-spring: cubic-bezier(.34, 1.56, .64, 1);
  --eye-soft: cubic-bezier(.22, 1.2, .36, 1);
  --eye-ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --eye-dim: rgba(18, 18, 24, .4); --eye-dim-edge: rgba(18, 18, 24, .2); --eye-ring: rgba(168, 101, 10, .5);
    --eye-glow: rgba(232, 163, 61, .2); --eye-field-a: rgba(232, 163, 61, .16); --eye-field-b: rgba(255, 214, 150, .3);
    --eye-line: rgba(17, 17, 19, .12); --eye-iris: rgba(168, 101, 10, .42); --eye-iris-soft: rgba(168, 101, 10, .14);
    --eye-grain: .045; --eye-card: rgba(255, 255, 255, .9);
    --eye-card-shadow: 0 28px 70px -20px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .06); --eye-lift: 0 18px 40px -20px rgba(0, 0, 0, .28);
  }
}
:root[data-theme="light"] {
  --eye-dim: rgba(18, 18, 24, .4); --eye-dim-edge: rgba(18, 18, 24, .2); --eye-ring: rgba(168, 101, 10, .5);
  --eye-glow: rgba(232, 163, 61, .2); --eye-field-a: rgba(232, 163, 61, .16); --eye-field-b: rgba(255, 214, 150, .3);
  --eye-line: rgba(17, 17, 19, .12); --eye-iris: rgba(168, 101, 10, .42); --eye-iris-soft: rgba(168, 101, 10, .14);
  --eye-grain: .045; --eye-card: rgba(255, 255, 255, .9);
  --eye-card-shadow: 0 28px 70px -20px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .06); --eye-lift: 0 18px 40px -20px rgba(0, 0, 0, .28);
}

/* ---------- The Eye's mark (ceremony/mark.js) ---------- */
.eye-mark { display: block; overflow: visible; color: var(--label); }
.eye-mark .lids, .eye-mark .iris { transform-box: view-box; transform-origin: 24px 24px; }
.eye-mark .lid { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.eye-mark .iris-ring { fill: var(--eye-iris-soft); stroke: var(--accent); stroke-width: 3; }
.eye-mark .pupil { fill: currentColor; }
.eye-mark .glint { fill: #fff; opacity: .9; }
.eye-card-mark .iris { transition: transform .5s var(--eye-ease); }

/* ---------- the welcome ---------- */
.eye-welcome { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; background: var(--ground); cursor: default; -webkit-user-select: none; user-select: none; }
.eye-welcome-glow { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(130vmin, 980px); height: min(130vmin, 980px); border-radius: 50%; background: radial-gradient(closest-side, var(--eye-glow), transparent 72%); pointer-events: none; }
.eye-welcome-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; text-align: center; }
.eye-welcome-markwrap { position: relative; width: 104px; height: 104px; margin-bottom: 6px; }
.eye-welcome-mark .lid { stroke-width: 1.9; }
.eye-welcome-mark .iris-ring { stroke-width: 2.6; }
.eye-welcome-ring { position: absolute; inset: 30px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; }
.eye-welcome-title { font-size: clamp(28px, 5.4vw, 46px); line-height: 1.08; font-weight: 650; letter-spacing: -.032em; color: var(--label); max-width: 18ch; }
.eye-welcome-title span { display: inline-block; }
.eye-welcome-org { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); max-width: 32ch; }

/* ---------- the brand backdrop (public auth pages) ---------- */
.eye-auth { position: relative; isolation: isolate; }
.eye-backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ground); contain: strict; }
.eye-bd-field { position: absolute; border-radius: 50%; opacity: 0; transition: opacity .6s var(--eye-ease); will-change: transform; }
.eye-bd-field.f1 { width: 80vmax; height: 80vmax; left: -28vmax; top: -34vmax; background: radial-gradient(closest-side, var(--eye-field-a), transparent); }
.eye-bd-field.f2 { width: 70vmax; height: 70vmax; right: -30vmax; bottom: -36vmax; background: radial-gradient(closest-side, var(--eye-field-b), transparent); }
.eye-bd-field.f3 { left: 50%; top: 50%; translate: -50% -50%; width: 64vmin; height: 64vmin; background: radial-gradient(closest-side, var(--eye-glow), transparent 75%); }
.eye-backdrop.is-in .eye-bd-field { opacity: 1; }
.eye-bd-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s var(--eye-ease); }
.eye-backdrop.is-in .eye-bd-art { opacity: 1; }
.eye-bd-lids { transform-box: view-box; transform-origin: 500px 300px; scale: 1 .04; transition: scale .5s var(--ease); }
.eye-backdrop.is-in .eye-bd-lids { scale: 1 1; }
.eye-backdrop.is-in.is-shy .eye-bd-lids { scale: 1 .46; transition-duration: .55s; transition-delay: 0s; }
.eye-bd-lid { fill: none; stroke: var(--eye-line); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.eye-bd-iris { transform-box: view-box; transform-origin: 500px 300px; translate: var(--gx, 0) var(--gy, 0); transition: translate 1.2s var(--eye-ease), opacity .6s; }
.eye-backdrop.is-shy .eye-bd-iris { translate: 0 26px; opacity: .55; }
.eye-bd-ring { fill: none; vector-effect: non-scaling-stroke; }
.eye-bd-ring.r1 { stroke: var(--eye-iris); stroke-width: 1.4; }
.eye-bd-ring.r2 { stroke: var(--eye-iris-soft); stroke-width: 1; stroke-dasharray: 2 7; }
.eye-bd-ring.r3 { stroke: var(--eye-line); stroke-width: 1; }
.eye-bd-grain { position: absolute; inset: 0; opacity: var(--eye-grain); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.eye-backdrop.is-paused, .eye-backdrop.is-paused * { animation-play-state: paused !important; }
/* the card floats over it: the only hazed surface, like the app's chrome */
.eye-auth .card { background: color-mix(in srgb, var(--surface) 84%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); border-color: var(--hairline); box-shadow: var(--eye-card-shadow), inset 0 1px 0 var(--glass-top); }
body.eye-auth-page .page { animation: eyeFade .3s ease-out both; }  /* opacity only: a transform would re-anchor the fixed backdrop */
@media (max-width: 640px) { .eye-bd-field.f2 { display: none; } .eye-bd-ring.r3 { display: none; } }

/* ---------- The Eye's guide ---------- */
.eye-guide { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.eye-guide.is-in { animation: eyeFade var(--dur) ease-out both; }
.eye-spot { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 12px; box-shadow: 0 0 0 200vmax var(--eye-dim), inset 0 0 18px 2px var(--eye-dim-edge); will-change: transform; transition: opacity .35s ease-out; }
.eye-spot::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 1px var(--eye-ring); transition: opacity .3s; }
.eye-spot::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); opacity: 0; }
.eye-spot.is-empty::before { opacity: 0; }
.eye-spot.arrive::after { animation: eyeArrive .4s var(--ease) both; }
.eye-guide.is-min .eye-spot { opacity: 0; }

.eye-card { position: absolute; left: 0; top: 0; width: 348px; max-width: calc(100vw - 32px); pointer-events: auto; padding: 16px 16px 12px; color: var(--label); background: var(--eye-card); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); border: 1px solid var(--hairline); border-radius: 18px; box-shadow: var(--eye-card-shadow), inset 0 1px 0 var(--glass-top); will-change: transform; animation: eyeCardIn .55s var(--eye-soft) both; }
.eye-card:focus { outline: none; }
.eye-card-head { display: flex; gap: 12px; align-items: flex-start; }
.eye-card-mark { flex: none; width: 30px; height: 30px; margin-top: 1px; }
.eye-card-check { display: none; flex: none; width: 34px; height: 34px; overflow: visible; }
.eye-card.is-done .eye-card-mark { display: none; }
.eye-card.is-done .eye-card-check { display: block; }
.eye-card-body { min-width: 0; flex: 1; }
.eye-card-title { font-size: 15px; font-weight: 650; letter-spacing: -.012em; line-height: 1.3; margin: 4px 0 4px; }
.eye-card.is-first .eye-card-title, .eye-card.is-done .eye-card-title { font-size: 17px; }
.eye-card-text { font-size: 13.5px; line-height: 1.5; color: var(--secondary); }
.eye-card-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; min-height: 30px; }
.eye-card-btns { display: flex; gap: 6px; margin-left: auto; }
.eye-card-btns .btn { min-width: 0; }
.eye-skip { color: var(--tertiary); }
.eye-dots { display: flex; gap: 5px; align-items: center; padding-left: 42px; }
.eye-dot { display: block; width: 6px; height: 6px; border-radius: 3px; background: var(--quaternary); transition: width var(--dur) var(--ease), background-color var(--dur); }
.eye-dot.seen { background: color-mix(in srgb, var(--accent) 45%, var(--quaternary)); }
.eye-dot.on { width: 18px; background: var(--accent); }
.eye-card.is-celebrating { border-color: color-mix(in srgb, var(--green) 35%, var(--hairline)); }
.eye-min { display: none; }
.eye-card.is-min { width: auto; padding: 5px; border-radius: 999px; }
.eye-card.is-min > :not(.eye-min) { display: none; }
.eye-card.is-min .eye-min { display: flex; align-items: center; gap: 2px; }
.eye-resume { position: relative; height: 32px; padding: 0 12px 0 34px; border: 0; border-radius: 999px; background: none; color: var(--label); font-size: 13px; font-weight: 600; }
.eye-resume::before { content: ""; position: absolute; left: 10px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-radius: 50%; border: 2.5px solid var(--accent); background: var(--eye-iris-soft); }
.eye-resume:hover { background: var(--surface2); }
.eye-end { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--secondary); display: grid; place-items: center; }
.eye-end:hover { background: var(--surface2); color: var(--label); }
.eye-end path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* a phone: the card docks to the bottom, above the home indicator */
.eye-card.is-dock { left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; animation-name: eyeDockIn; }
.eye-card.is-dock.is-min { left: auto; }
.eye-card.is-dock .eye-dots { padding-left: 0; }
body.eye-docked #app { padding-bottom: calc(48px + var(--eye-dock-h, 0px)); }
@media (max-width: 380px) { .eye-card.is-dock .eye-skip { padding: 0 6px; } }

/* ---------- the rewards: a self-drawing check, a burst of light ---------- */
.eye-tick { position: fixed; z-index: 1001; pointer-events: none; transform: translate(-50%, -50%); overflow: visible; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .25)); }
.eye-tick-ring { fill: color-mix(in srgb, var(--green) 16%, var(--surface)); stroke: var(--green); stroke-width: 2.2; stroke-dasharray: 120; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 22px 22px; }
.eye-tick-path { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 0; }
.eye-card-check .eye-tick-ring { fill: color-mix(in srgb, var(--green) 14%, transparent); }
.eye-burst { position: fixed; z-index: 1001; width: 0; height: 0; pointer-events: none; }
.eye-mote { display: block; position: absolute; left: 0; top: 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); opacity: 0; }
.eye-mote.t1 { background: #FFC46B; box-shadow: 0 0 8px #FFC46B; }
.eye-mote.t2 { background: var(--green); box-shadow: 0 0 8px var(--green); }

@keyframes eyeFade { from { opacity: 0; } }
@keyframes eyeArrive { 0% { opacity: 0; transform: scale(1.07); } 35% { opacity: .85; } 100% { opacity: 0; transform: scale(1); } }
@keyframes eyeCardIn { from { opacity: 0; scale: .94; translate: 0 10px; } }
@keyframes eyeDockIn { from { opacity: 0; translate: 0 24px; } }

/* ---------- micro-interactions: clients and the auth pages only, and only for people who welcome motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* 2026-10-23 (owner: "feels extremely sluggish … No gimmicky weird terrible animation"): the light behind the sign-in
     drifts slowly and that is all — no blinking, breathing, staggered arrivals, overshoots or bouncing icons; every
     response is on the portal's one curve and inside 300 ms (styles.css --dur / --ease). */
  .eye-bd-field.f1 { animation: eyeDriftA 38s ease-in-out infinite alternate; }
  .eye-bd-field.f2 { animation: eyeDriftB 46s ease-in-out infinite alternate; }
  .eye-auth .card { animation: eyeAuthIn var(--dur-sheet) var(--ease) both; }
  .eye-auth .input { transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }

  :is(body.role-customer, .eye-auth) .btn { transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast), filter var(--dur-fast), color var(--dur-fast); }
  :is(body.role-customer, .eye-auth) .btn:active:not(:disabled) { transform: scale(.97); }

  body.role-customer .page { animation: eyePageIn var(--dur) var(--ease) both; }

  body.role-customer .mine-tile { transition: transform var(--dur) var(--ease), border-color var(--dur-fast); }
  body.role-customer .mine-tile:hover { border-color: var(--hairline); }
  body.role-customer .mine-tile:active { transform: scale(.99); }

  body.role-customer .seg button { transition: background-color var(--dur-fast), color var(--dur-fast); }

  @keyframes eyeDriftA { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
  @keyframes eyeDriftB { to { transform: translate(-12vmax, -8vmax) scale(1.08); } }
  @keyframes eyeAuthIn { from { opacity: 0; translate: 0 8px; } }
  @keyframes eyePageIn { from { opacity: 0; } }
}

/* ---------- reduced motion: a still composition, nothing drifts, blinks or glides ---------- */
@media (prefers-reduced-motion: reduce) {
  .eye-bd-lids, .eye-backdrop .eye-bd-field, .eye-bd-art { transition: none; }
  .eye-guide.is-in, .eye-card, .eye-spot.arrive::after { animation: none; }
  .eye-card-mark .iris { transition: none; }
}
