/* ====================================================================
   AIL LABS — Royal layer (additive, loads LAST after ail-ios-hig.css)
   Super-luxury finish: champagne-gold hairlines, aurora depth, film grain,
   3D tilt + spotlight cards, scroll reveals, and the per-page 3D stage
   drawn by /ail-royal.js. Palette stays on-brand (ink #082f32, cyan
   #0aa7b5, orange #f07b4f) with champagne gold as the single new accent.
   Everything is progressive: without JS the page looks exactly as before.
   Standards kept: Apple HIG (contrast, 44pt targets, reduce-motion).
   ==================================================================== */
:root{
  --rg-1:#f6e4b4;--rg-2:#dcbc72;--rg-3:#b08a38;--rg-deep:#7a5a18;
  --rg-hair:rgba(220,188,114,.55);--rg-hair-soft:rgba(220,188,114,.22);
  --rg-glow:rgba(220,188,114,.28);
  --rg-gold-text:var(--rg-deep);
  --rg-ease:cubic-bezier(.16,1,.3,1);
}
@media(prefers-color-scheme:dark){
  :root{--rg-gold-text:#ecd29a;--rg-hair:rgba(236,210,154,.5);--rg-hair-soft:rgba(236,210,154,.2)}
}

/* ---------- 3D stage + atmosphere (created by JS, behind all content) ---------- */
#royal-stage{position:fixed;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;display:block}
#royal-aurora{position:fixed;inset:-20%;z-index:-1;pointer-events:none;opacity:.9;
  background:
    radial-gradient(40% 36% at 78% 22%,rgba(220,188,114,.20),transparent 70%),
    radial-gradient(46% 40% at 12% 70%,rgba(10,167,181,.16),transparent 72%),
    radial-gradient(34% 30% at 60% 96%,rgba(240,123,79,.10),transparent 74%);
  animation:royal-drift 28s ease-in-out infinite alternate;will-change:transform}
@keyframes royal-drift{to{transform:translate3d(-3%,2%,0) rotate(6deg) scale(1.06)}}
#royal-grain{position:fixed;inset:0;z-index:2;pointer-events:none;opacity:.045;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>")}
@media(prefers-color-scheme:dark){#royal-grain{mix-blend-mode:screen;opacity:.05}}
#royal-progress{position:fixed;left:0;top:0;height:2px;width:100%;z-index:60;pointer-events:none;
  transform-origin:0 50%;transform:scaleX(var(--royal-progress,0));
  background:linear-gradient(90deg,var(--rg-3),var(--rg-1),#5ed7df);box-shadow:0 0 12px var(--rg-glow)}

/* ---------- header: gold hairline + quiet brand shimmer ---------- */
body#ail-domus .site-header{box-shadow:0 1px 0 var(--rg-hair-soft),0 10px 30px rgba(8,47,50,.06)!important}

/* ---------- typography: luxe rhythm, tracked eyebrows, gilded accents ---------- */
body#ail-domus .eyebrow{
  display:inline-flex;align-items:center;gap:.7em;
  color:var(--rg-gold-text)!important;font-weight:600;letter-spacing:.22em;text-transform:uppercase;font-size:.72rem}
body#ail-domus .eyebrow::before{content:"";width:2.2em;height:1px;background:linear-gradient(90deg,transparent,var(--rg-2))}
body#ail-domus h1,body#ail-domus .hero h1{letter-spacing:-.035em;font-weight:700;line-height:1.04}
body#ail-domus h2{letter-spacing:-.025em}
body#ail-domus h1 span{
  background:linear-gradient(100deg,var(--rg-3) 0%,var(--rg-2) 34%,#0aa7b5 78%,var(--rg-3) 100%);
  background-size:220% 100%;-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;animation:royal-sheen 9s linear infinite}
@keyframes royal-sheen{to{background-position:-220% 0}}
@media(prefers-color-scheme:dark){
  body#ail-domus h1 span{background-image:linear-gradient(100deg,#ecd29a 0%,#f6e4b4 34%,#5ed7df 78%,#ecd29a 100%);background-size:220% 100%}
}

/* ---------- cards: champagne rim, depth, spotlight (vars set by JS) ---------- */
body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside,.hero-panel .panel-card,article[data-product]),
body#ail-domus main [class*="rounded-["][class*="border"]{
  position:relative;
  --mx:50%;--my:0%;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    0 0 0 1px var(--rg-hair-soft),
    0 24px 56px rgba(8,47,50,.13),
    0 2px 6px rgba(8,47,50,.06)!important;
  transition:transform .6s var(--rg-ease),box-shadow .6s var(--rg-ease)}
body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside):hover,
body#ail-domus main [class*="rounded-["][class*="border"]:hover{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7),0 0 0 1px var(--rg-hair),0 34px 80px rgba(8,47,50,.20),0 0 46px var(--rg-glow)!important}
body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside)::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;
  background:radial-gradient(420px circle at var(--mx) var(--my),rgba(246,228,180,.30),transparent 62%);
  transition:opacity .5s var(--rg-ease)}
body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside):hover::after{opacity:1}
@media(prefers-color-scheme:dark){
  body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside,.hero-panel .panel-card,article[data-product]),
  body#ail-domus main [class*="rounded-["][class*="border"]{
    box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 0 0 1px var(--rg-hair-soft),0 28px 64px rgba(0,0,0,.5)!important}
  body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside):hover,
  body#ail-domus main [class*="rounded-["][class*="border"]:hover{
    box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 0 0 1px var(--rg-hair),0 36px 90px rgba(0,0,0,.6),0 0 52px var(--rg-glow)!important}
  body#ail-domus :is(.feature,.card,.category,.compliance-card,.stat,.step,.about-aside)::after{
    background:radial-gradient(420px circle at var(--mx) var(--my),rgba(236,210,154,.16),transparent 62%)}
}

/* ---------- primary action: gilded sheen sweep ---------- */
body#ail-domus .button{position:relative;overflow:hidden;isolation:isolate}
body#ail-domus .button::after{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(115deg,transparent 30%,rgba(246,228,180,.55) 50%,transparent 70%);
  transform:translateX(-120%);transition:transform .9s var(--rg-ease)}
body#ail-domus .button:hover::after{transform:translateX(120%)}
body#ail-domus .button-primary{box-shadow:0 12px 30px var(--dm-cyan-glow),0 0 0 1px var(--rg-hair-soft)}


/* metal CTA: HIG forces dark label text; give light mode a champagne-metal
   fill so the label reads (was dark-on-dark). Dark mode keeps the cyan fill. */
@media(prefers-color-scheme:light){
  body#ail-domus .button-primary.btn-metal:not(.cta .btn-metal){
    background:linear-gradient(135deg,#f9ecc4 0%,#e3c47c 46%,#c9a350 100%)!important;color:#031c20!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.7),0 12px 30px rgba(176,138,56,.35),0 0 0 1px var(--rg-hair)!important}
  body#ail-domus .button-primary.btn-metal:not(.cta .btn-metal):hover{background:linear-gradient(135deg,#fff3d2,#ebcd88 46%,#d2ac5a)!important}
}

/* ---------- dock: champagne rim ---------- */
.lg-dock{box-shadow:inset 0 1.5px 0 rgba(255,255,255,.7),0 0 0 1px var(--rg-hair-soft),0 18px 44px rgba(8,47,50,.22)}

/* ---------- scroll reveal (only when JS is running) ---------- */
.royal-js .royal-rv{opacity:0;transform:translate3d(0,26px,0) scale(.985);
  transition:opacity .9s var(--rg-ease),transform .9s var(--rg-ease);transition-delay:calc(var(--rv-i,0)*70ms)}
.royal-js .royal-rv.is-in{opacity:1;transform:none}

/* ---------- reduced motion / print / small screens ---------- */
@media(prefers-reduced-motion:reduce){
  #royal-aurora,body#ail-domus h1 span{animation:none}
  .royal-js .royal-rv{opacity:1;transform:none;transition:none}
  body#ail-domus .button::after{display:none}
}
@media(max-width:720px){#royal-aurora{animation:none}#royal-grain{display:none}}
@media print{#royal-stage,#royal-aurora,#royal-grain,#royal-progress{display:none!important}}
