/* IRogen glass layer (v61): translucent surfaces, softer corners and shadows.
   Loaded after app.css; keeps the navy / logo-orange / ribbon-red palette. */
:root{
  --action-start:#ffb066;--action-end:#f0645f;--action-ink:#2a0f06;
  --g-fill:linear-gradient(155deg,rgba(255,255,255,.085),rgba(255,255,255,.025));
  --g-fill-soft:rgba(255,255,255,.045);
  --g-border:rgba(255,255,255,.11);
  --g-hi:inset 0 1px 0 rgba(255,255,255,.09);
  --g-shadow:0 16px 40px rgba(2,6,24,.26);
  --g-blur:blur(22px) saturate(150%);
  --g-glow:0 10px 26px rgba(240,100,95,.22);
  --r-card:24px;--r-panel:28px;--r-btn:18px;--r-square:16px
}
:root[data-theme=light]{
  --g-fill:linear-gradient(155deg,rgba(255,255,255,.78),rgba(255,255,255,.52));
  --g-fill-soft:rgba(255,255,255,.55);
  --g-border:rgba(255,255,255,.75);
  --g-hi:inset 0 1px 0 rgba(255,255,255,.9);
  --g-shadow:0 14px 36px rgba(40,52,95,.10);
  --g-glow:0 10px 24px rgba(240,100,95,.20)
}

/* Backdrop: soft orange and red light behind the glass (own fixed layer, no repaint on scroll) */
:root body{background:var(--bg)}
body:before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:
  radial-gradient(70% 45% at 100% 0,rgba(255,126,69,.16),transparent 70%),
  radial-gradient(65% 45% at 0 80%,rgba(235,22,74,.13),transparent 70%),
  radial-gradient(60% 40% at 50% 45%,rgba(70,80,160,.10),transparent 70%)}
:root[data-theme=light] body:before{background:
  radial-gradient(70% 45% at 100% 0,rgba(255,170,110,.28),transparent 70%),
  radial-gradient(65% 45% at 0 80%,rgba(240,100,120,.18),transparent 70%)}
.ambient{opacity:.26;filter:blur(110px)}
.ambient-one{width:280px;height:280px;background:#ff7e45}
.ambient-two{width:300px;height:300px;background:#eb164a}
:root[data-theme=light] .ambient{opacity:.14}

/* Glass panels */
:root .glass,:root .page-back,:root .toast,:root .search-panel{
  background:var(--g-fill);border:1px solid var(--g-border);
  box-shadow:var(--g-hi),var(--g-shadow);
  -webkit-backdrop-filter:var(--g-blur);backdrop-filter:var(--g-blur)}
:root .glass{border-radius:var(--r-panel)}
:root .user-header{border-radius:26px}
:root .page-back,:root .toast{border-radius:var(--r-square)}
:root[data-theme=light] .glass{box-shadow:var(--g-hi),var(--g-shadow)}

/* Hero: warm wine-to-navy glass, a glow behind the logo, and a light running along its edge */
@property --hero-light{syntax:'<angle>';inherits:false;initial-value:0deg}
:root .hero.glass{border-radius:30px;border-color:rgba(255,190,150,.14);background:
  radial-gradient(58% 78% at 14% 52%,rgba(255,122,60,.26),transparent 66%),
  radial-gradient(55% 65% at 100% 0,rgba(214,32,88,.20),transparent 70%),
  linear-gradient(135deg,rgba(62,18,46,.80) 0%,rgba(28,22,60,.76) 52%,rgba(10,16,42,.82) 100%)}
/* The hero keeps light text in both themes, so it stays dark glass in light mode too */
:root[data-theme=light] .hero.glass{border-color:rgba(255,255,255,.5);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 16px 36px rgba(20,28,60,.22);background:
  radial-gradient(58% 78% at 14% 52%,rgba(255,122,60,.28),transparent 66%),
  radial-gradient(55% 65% at 100% 0,rgba(214,32,88,.22),transparent 70%),
  linear-gradient(135deg,rgba(62,18,46,.94) 0%,rgba(28,22,60,.92) 52%,rgba(10,16,42,.94) 100%)}
:root .hero.glass:before{content:"";position:absolute;inset:0;z-index:3;border-radius:inherit;padding:1.5px;pointer-events:none;
  background:conic-gradient(from var(--hero-light),transparent 0 64%,rgba(255,176,102,.12) 72%,#ffb066 84%,#fff2df 89%,#f0645f 94%,transparent 99%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);
  animation:hero-light 7s linear infinite}
@keyframes hero-light{to{--hero-light:360deg}}
:root .hero .brand-image{filter:drop-shadow(0 12px 22px rgba(240,90,60,.35))}

/* Header controls */
:root .header-square,:root .owner-entry,:root .secondary,:root .load-more,:root .search-close,:root .invite-preview-close{
  background:var(--g-fill-soft);border:1px solid var(--g-border);box-shadow:var(--g-hi)}
:root .header-square{border-radius:var(--r-square)}
:root .owner-entry,:root .secondary,:root .load-more{border-radius:var(--r-btn)}
:root .credit-chip.header-square{background:rgba(255,126,69,.10);border-color:rgba(255,150,100,.30)}
:root[data-theme=light] .credit-chip.header-square{background:rgba(255,150,100,.14);border-color:rgba(200,90,40,.22)}

/* Image and content cards: translucent, rounder, quieter borders */
:root :is(.themed-category,.mini-item,.tool-card,.style-card,.package,.quota-card,.plan-switch){
  background:var(--g-fill);border:1px solid var(--g-border);box-shadow:var(--g-hi),0 10px 28px rgba(2,6,24,.18)}
:root :is(.themed-category,.tool-card,.style-card){border-radius:var(--r-card)}
:root :is(.mini-item){border-radius:20px}
:root :is(.package,.quota-card){border-radius:22px}
:root .plan-switch{border-radius:var(--r-btn)}
:root :is(.profile-stat,.payment-package,.invite-task,.invite-preview-task,figure,code,textarea,.gallery-search){border-radius:20px}
:root :is(.profile-stat,.gallery-search,textarea,code){background:var(--g-fill-soft);border-color:var(--g-border)}
:root .package.best-value{border-color:rgba(255,150,100,.7);box-shadow:var(--g-hi),0 0 0 1px rgba(255,150,100,.35) inset,var(--g-glow)}
:root .themed-category strong,:root .tool-card .tool-cover i{
  background:rgba(8,14,36,.45);border-color:rgba(255,255,255,.16);border-radius:12px;
  -webkit-backdrop-filter:blur(12px) saturate(140%);backdrop-filter:blur(12px) saturate(140%)}
:root[data-theme=light] .themed-category strong,:root[data-theme=light] .tool-card .tool-cover i{background:rgba(255,255,255,.7)}
:root .detail-cost,:root .share-button{border-radius:var(--r-square)}

/* Chips and tabs */
:root :is(.recommendation-tabs,.filter-chips) button{
  background:var(--g-fill-soft);border:1px solid var(--g-border);box-shadow:var(--g-hi)}

/* Actions: logo orange to ribbon red, softer glow */
:root :is(.primary,.invite-primary){border-radius:var(--r-btn);box-shadow:var(--g-glow)}
:root :is(.primary,.invite-primary,.upload-icon,.referral-gift,.package-badge){
  background:linear-gradient(115deg,var(--action-start),var(--action-end));color:var(--action-ink)}
:root :is(.search-toggle.active,.ref-link button,.plan-switch button.active,.invoice-actions .pay-now,.receipt-upload,.filter-chips button.active,.recommendation-tabs button.active,.invite-message>span){
  background:linear-gradient(115deg,var(--action-start),var(--action-end));color:var(--action-ink);
  border-color:rgba(255,170,120,.55);box-shadow:var(--g-glow)}
:root .upload-zone{border-radius:22px;background:rgba(255,126,69,.06);border-color:rgba(255,150,100,.40)}
:root .avatar-wrap.pro{box-shadow:0 0 0 3px rgba(255,126,69,.14),0 8px 20px rgba(240,100,95,.18)}

/* Bottom navigation: floating glass bar */
:root .bottom-nav.glass{border-radius:30px;background:rgba(14,20,44,.52);border:1px solid rgba(255,255,255,.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 14px 36px rgba(2,6,24,.36);
  -webkit-backdrop-filter:blur(26px) saturate(170%);backdrop-filter:blur(26px) saturate(170%)}
:root[data-theme=light] .bottom-nav.glass{background:rgba(255,255,255,.62);border-color:rgba(255,255,255,.8);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 12px 30px rgba(40,52,95,.14)}
:root .bottom-nav button{border-radius:22px}
:root .bottom-nav button.active{background:linear-gradient(115deg,var(--action-start),var(--action-end));color:var(--action-ink);box-shadow:var(--g-glow)}

/* Gentler motion on press */
:root :is(.primary,.secondary,.header-square,.bottom-nav button,.tool-card,.style-card,.mini-item,.themed-category,.package){
  transition:transform .18s ease,box-shadow .25s ease,background-color .25s ease}
:root :is(.primary,.secondary,.header-square,.bottom-nav button,.tool-card,.style-card,.mini-item,.themed-category,.package):active{transform:scale(.97)}

/* No backdrop-filter support: keep text readable with denser surfaces */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  :root:not([data-theme=light]) :is(.glass,.page-back,.toast,.search-panel){background:rgba(16,25,52,.94)}
  :root:not([data-theme=light]) .bottom-nav.glass{background:rgba(12,18,40,.96)}
  :root[data-theme=light] :is(.glass,.bottom-nav.glass){background:rgba(255,255,255,.96)}
}
@media (prefers-reduced-motion:reduce){:root *{transition:none!important}}

/* Categories: a glass box with a smaller photo on top and the text below it */
:root .category{aspect-ratio:auto;justify-content:flex-start;padding:7px 7px 11px;border-radius:24px;
  background:linear-gradient(160deg,rgba(255,255,255,.08),rgba(255,255,255,.02));border:1px solid rgba(255,255,255,.10);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 12px 28px rgba(2,6,24,.22);contain-intrinsic-size:230px}
:root .category:after{display:none}
:root .category img,:root .category .fallback{position:relative;inset:auto;z-index:auto;display:block;width:100%;height:auto;aspect-ratio:16/11;
  object-fit:cover;border-radius:18px;box-shadow:0 8px 18px rgba(0,0,0,.28)}
:root .category strong{top:15px;bottom:auto}
:root .category h3{margin:10px 6px 2px;font-size:14px;line-height:1.6;color:var(--text);text-shadow:none}
:root .category p{margin:0 6px;font-size:12px;line-height:1.7;color:var(--muted);
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
:root .category:hover{border-color:rgba(255,170,120,.34)}
:root .category:active{transform:scale(.98)}
:root[data-theme=light] .category{background:linear-gradient(160deg,rgba(255,255,255,.85),rgba(255,255,255,.6));border-color:rgba(255,255,255,.8);
  box-shadow:inset 0 1px 0 #fff,0 12px 26px rgba(40,52,95,.10)}
:root[data-theme=light] .category h3{color:#18243d}
:root[data-theme=light] .category p{color:#53617c}

/* Recommendations: switching a tab visibly brings in the new samples */
:root #personalized-items .mini-item{animation:rec-in .34s cubic-bezier(.2,.8,.2,1) both}
:root #personalized-items .mini-item:nth-child(2){animation-delay:.04s}
:root #personalized-items .mini-item:nth-child(3){animation-delay:.08s}
:root #personalized-items .mini-item:nth-child(n+4){animation-delay:.12s}
@keyframes rec-in{from{opacity:0;transform:translateY(8px)}}

/* Loading placeholder uses the cleaned logo */
:root .mini-item>img,:root .item>img{background-image:url('/static/irogen-ribbon/logo-v61.webp?v=61')}

/* Narrow screens: nothing wraps mid-word; below 340px the bottom bar shows icons only */
:root #pro-badge,:root #profile-pro{white-space:nowrap}
:root .bottom-nav button>b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
:root .owner-entry{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:360px){
  :root .user-header{padding:8px 10px}
  :root .header-actions{gap:6px}
  :root .header-square{width:40px;height:40px;border-radius:14px}
  :root #pro-badge{font-size:9.5px;padding:1px 4px}
  :root .owner-entry{font-size:12px;padding-inline:10px}
  :root .hero h1{font-size:clamp(18px,6.4vw,22px);line-height:1.5}
  :root .hero h1>*{white-space:nowrap}
}
@media (max-width:340px){
  :root #welcome-label{display:none}
  :root .bottom-nav button>b{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
  :root .bottom-nav button>span{font-size:22px}
  :root .bottom-nav button{min-height:46px}
}

/* Owner's choice: the slow edge light on the hero keeps running even with the
   system's reduce-motion setting (it is a thin, slow glow, no movement of content). */
@media (prefers-reduced-motion:reduce){
  :root .hero.glass:before{animation-duration:7s!important;animation-iteration-count:infinite!important}
}
