/* SILACOD glass & light layer — techniques from the owner's references (Luna ring card, frosted-finger player, blue glass
   toolbar, black & white lens pill, glowing object in the dark), redrawn in SILACOD navy / coral / violet.
   Loaded after sila-polish.css on the homepage, agent, studio and dashboard. Login & signup are left out on purpose:
   Chromium mis-draws backdrop blur over their moving 3D website wall.
   Glass recipe used everywhere (back → front): background blur → tint → 1px edge lit from the top → inner top highlight +
   darker bottom (thickness) → grain. The background is already soft, so large surfaces need tint only, not costly blur. */

@property --rim { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ───────── 1 · rim light + bloom on the coral buttons (reference: glowing object — light travels around the edge) ───────── */
.btn-coral, .btn.pri { position: relative; isolation: isolate; }
.btn-coral::before, .btn.pri::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--rim), transparent 0 52%, rgba(255,255,255,.0) 56%, #fff 68%, #ffd6c8 74%, rgba(139,108,255,.9) 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: silaRim 2.6s linear infinite; transition: opacity .35s var(--sp-ease, ease);
}
@keyframes silaRim { to { --rim: 360deg; } }
.btn-coral:hover::before, .btn-coral:focus-visible::before, .btn.pri:hover::before, .btn.pri:focus-visible::before, [aria-busy="true"]::before { opacity: 1; }
/* bloom: the coral bleeds softly outside the button on hover */
.btn-coral:hover, .btn.pri:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset, 0 18px 46px -12px rgba(240,99,67,.95), 0 0 42px -6px rgba(255,138,107,.55); }
/* the main call-to-action on each page keeps a slow, quiet rim all the time */
.hero .ctas .btn-coral::before, .after-hero .btn-coral::before, #ctaForm button[type="submit"]::before, .ag-hero .btn-coral::before, .st-hero .btn-coral::before { opacity: .75; animation-duration: 4.2s; }
/* glass highlight on the coral surface itself (thickness) */
.btn-coral, .btn.pri { background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 46%, rgba(0,0,0,.06)); }

/* ───────── 2 · glass buttons: edge lit from the top, darker bottom (reference: blue toolbar / B&W pill) ───────── */
.btn-glass { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.18), 0 10px 30px -16px rgba(0,0,0,.5); }
.btn-glass:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(0,0,0,.18), 0 14px 34px -16px rgba(0,0,0,.55); }

/* ───────── 3 · dashboard: moving SILACOD mesh behind everything (reference: blue toolbar background) ───────── */
.ap::before {           /* four soft lights on one big layer that slowly turns: compositor-only, no repaint */
  content: ""; position: fixed; z-index: -1; pointer-events: none; left: 50%; top: 50%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax;
  background:
    radial-gradient(closest-side at 32% 36%, rgba(240,99,67,.34), transparent 70%),
    radial-gradient(closest-side at 70% 30%, rgba(139,108,255,.30), transparent 70%),
    radial-gradient(closest-side at 62% 72%, rgba(74,125,255,.26), transparent 70%),
    radial-gradient(closest-side at 28% 74%, rgba(35,40,99,.55), transparent 72%);
  filter: saturate(1.1); animation: silaMesh 48s linear infinite; }
@keyframes silaMesh { to { transform: rotate(360deg); } }
html[data-theme="light"] .ap::before { opacity: .45; }
.ap::after {            /* fine grain so big soft gradients never band */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
html[data-theme="light"] .ap::after { opacity: .05; mix-blend-mode: multiply; }

/* surfaces become glass over the mesh: tint + lit edge + thickness (no blur needed — the mesh is already soft) */
.ap .card { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.015) 40%), rgba(13,15,48,.66);
  border-color: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.25), 0 24px 60px -40px rgba(0,0,0,.7); }
html[data-theme="light"] .ap .card { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74)); border-color: rgba(17,19,68,.07);
  box-shadow: inset 0 1px 0 #fff, 0 24px 60px -42px rgba(17,19,68,.45); }
.ap-side { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0) 30%), rgba(13,15,48,.72); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06); }
html[data-theme="light"] .ap-side { background: rgba(255,255,255,.72); }
.ap-top { background: color-mix(in srgb, var(--bg) 58%, transparent) !important; -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  border-bottom-color: transparent !important; box-shadow: inset 0 -1px 0 rgba(255,255,255,.07), 0 1px 0 rgba(0,0,0,.25); }
html[data-theme="light"] .ap-top { box-shadow: inset 0 -1px 0 rgba(17,19,68,.06); }
/* the active sidebar item gets the same travelling rim, slower */
.ap-nav a[aria-current="page"] { position: relative; }
.ap-nav a[aria-current="page"]::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--rim), transparent 0 60%, rgba(255,138,107,.9) 75%, rgba(139,108,255,.7) 85%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: silaRim 5s linear infinite; }

/* ───────── 4 · phone tab bar: dark lens glass (reference: black & white pill) ───────── */
@media (max-width: 900px) {
  .tb-bg { background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02) 45%), rgba(10,12,40,.58) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.7) brightness(1.04); backdrop-filter: blur(18px) saturate(1.7) brightness(1.04);
    border-color: rgba(255,255,255,.12) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.35) !important; }
  html[data-theme="light"] .tb-bg { background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.62)) !important; border-color: rgba(17,19,68,.08) !important;
    box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(17,19,68,.06) !important; }
  .tb-bubble { box-shadow: 0 12px 26px -8px rgba(240,99,67,.75), 0 0 30px -4px rgba(255,138,107,.55), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 4px rgba(120,30,10,.25); }
  .ap-side { -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); }
}

/* ───────── 5 · homepage / agent / studio: lit edges on existing glass and stage cards ───────── */
nav.top { box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.25), 0 20px 50px -24px rgba(0,0,0,.6); }
.fstage { box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 60px 120px -50px rgba(6,7,29,.7), 0 0 0 1px rgba(255,255,255,.08), 0 0 90px -30px rgba(139,108,255,.45); }

@media (prefers-reduced-motion: reduce) {
  .btn-coral::before, .btn.pri::before, .ap-nav a[aria-current="page"]::before, .ap::before { animation: none; }
}
