/* Homepage refresh (owner request, Nov 2026): a lighter purple look, rounded
   menu buttons with icons, and the welcome banner "ทุกความบันเทิง เริ่มต้นที่นี่"
   with the floating AT NOVEL mascot. Loaded after homepage.css. */

/* Brand mark: the transparent mascot instead of the square app icon. */
body.home-compact .site-header .brand img{width:52px;height:39px;object-fit:contain;border-radius:0;background:none;box-shadow:none}

/* Menu: rounded buttons with an icon. */
body.home-compact .desktop-nav{gap:8px;padding:2px 0 4px}
body.home-compact .desktop-nav a{gap:8px;padding:0 16px;border-radius:999px;border:1px solid #e4d9fa;background:#fff;color:#3b2a5c;font-weight:600;text-decoration:none;transition:background .15s,border-color .15s}
body.home-compact .desktop-nav a:hover{background:#f4edff;border-color:#cdb8f6}
body.home-compact .site-header .desktop-nav a.active,body.home-compact[data-theme] .site-header .desktop-nav a.active,body.home-compact .site-header .desktop-nav a.active:hover{background:#7c3aed;border:1px solid #7c3aed;color:#fff;box-shadow:0 6px 16px rgba(124,58,237,.25)}
body.home-compact .desktop-nav a.active::after{display:none}
body.home-compact .desktop-nav a:focus-visible{outline:3px solid #a78bfa;outline-offset:2px}
body.home-compact .desktop-nav .nav-icon{flex:none}
body[data-theme="dark"].home-compact .desktop-nav a{background:#1c1626;border-color:#3a2d4d;color:#e9e1f7}
body[data-theme="dark"].home-compact .desktop-nav a:hover{background:#2a2038}
body[data-theme="dark"].home-compact .desktop-nav a.active{background:#7c3aed;border-color:#7c3aed;color:#fff}

/* Every banner: softer, rounder card. */
body.home-compact .hero.ai-portal{border-radius:28px}
body.home-compact .hero.ai-portal .hero-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
body.home-compact .hero.ai-portal .hero-video[hidden],body.home-compact .hero.ai-portal .hero-image[hidden]{display:none}

/* Welcome banner: light lavender, dark text, mascot on the right. */
body.home-compact .hero.ai-portal.hero-welcome{background:linear-gradient(120deg,#fff 0%,#f1e8ff 55%,#e6d8ff 100%);color:#241b35;border:1px solid #e6dafb}
body.home-compact .hero.ai-portal.hero-welcome .hero-overlay{display:none}
body.home-compact .hero.ai-portal.hero-welcome .hero-image{left:auto;right:4%;top:50%;width:min(40%,440px);height:auto;max-height:92%;object-fit:contain;transform:translateY(-50%);filter:drop-shadow(0 18px 24px rgba(76,29,149,.25));animation:atWelcomeFloat 4s ease-in-out infinite}
body.home-compact .hero.ai-portal.hero-welcome .hero-shell{min-height:360px;display:flex;align-items:center;padding:40px 48px 72px}
body.home-compact .hero.ai-portal.hero-welcome .hero-content{width:min(560px,56%)}
body.home-compact .hero.ai-portal.hero-welcome h1{text-shadow:none;color:#241b35;font-size:clamp(30px,4vw,52px);line-height:1.22}
body.home-compact .hero.ai-portal.hero-welcome h1 em{color:#7c3aed}
body.home-compact .hero.ai-portal.hero-welcome p{color:#4a3d63;font-size:16px}
body.home-compact .hero.ai-portal.hero-welcome .eyebrow{display:inline-block;padding:5px 12px;border-radius:999px;background:#fff;border:1px solid #e4d9fa;color:#6d28d9;font-weight:700;letter-spacing:.4px}
body.home-compact .hero.ai-portal.hero-welcome .hero-actions>a{display:inline-flex;align-items:center;gap:6px;line-height:1;border-radius:999px;padding:0 24px;background:#7c3aed;color:#fff;box-shadow:0 10px 24px rgba(124,58,237,.3)}
body.home-compact .hero.ai-portal.hero-welcome .hero-pagination button::after{background:#cdbdf0;box-shadow:none}
body.home-compact .hero.ai-portal.hero-welcome .hero-pagination button[aria-current="true"]::after{background:#7c3aed}
body.home-compact .hero.ai-portal.hero-welcome .hero-pagination button:focus-visible{outline-color:#7c3aed}
@keyframes atWelcomeFloat{0%,100%{transform:translateY(-50%)}50%{transform:translateY(calc(-50% - 12px))}}

body[data-theme="dark"].home-compact .hero.ai-portal.hero-welcome{background:linear-gradient(120deg,#1b1328 0%,#2a1846 60%,#3a1f63 100%);color:#fff;border-color:#3a2d4d}
body[data-theme="dark"].home-compact .hero.ai-portal.hero-welcome h1{color:#fff}
body[data-theme="dark"].home-compact .hero.ai-portal.hero-welcome h1 em{color:#d8c2ff}
body[data-theme="dark"].home-compact .hero.ai-portal.hero-welcome p{color:#e4dbf3}
body[data-theme="dark"].home-compact .hero.ai-portal.hero-welcome .eyebrow{background:#2a2038;border-color:#4a3866;color:#e0ccff}

/* Phones: a short banner so the works below show on the first screen
   (reader feedback, Nov 2026): mascot small on the right, text on the left. */
@media(max-width:720px){
  body.home-compact .hero.ai-portal{margin:12px auto 16px;border-radius:22px}
  body.home-compact .hero.ai-portal .hero-shell{min-height:0;padding:18px 18px 56px}
  body.home-compact .hero.ai-portal h1{font-size:22px;margin:6px 0}
  body.home-compact .hero.ai-portal p{font-size:13px;margin:0 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  body.home-compact .hero.ai-portal .hero-pagination{inset:auto 8px 4px}
  body.home-compact .hero.ai-portal.hero-welcome .hero-image{right:8px;top:50%;width:112px;max-height:none;margin:0;animation-name:atWelcomeFloat}
  body.home-compact .hero.ai-portal.hero-welcome .hero-shell{min-height:0;padding:18px 128px 56px 18px}
  body.home-compact .hero.ai-portal.hero-welcome .hero-content{width:100%}
  body.home-compact .hero.ai-portal.hero-welcome h1{font-size:24px;line-height:1.25}
  body.home-compact .hero.ai-portal.hero-welcome p{font-size:13px}
  body.home-compact .hero.ai-portal.hero-welcome .eyebrow{font-size:10px;padding:3px 9px}
  body.home-compact .hero.ai-portal .hero-actions>a{min-height:44px;padding:0 18px;font-size:14px}
}
@keyframes atWelcomeFloatSmall{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}

@media(prefers-reduced-motion:reduce){body.home-compact .hero.ai-portal.hero-welcome .hero-image{animation:none}}

/* Phones: more works on screen, like a bookstore shelf (owner request, Nov
   2026): about three covers per row, tighter section spacing, swipe instead of
   arrow buttons. */
@media(max-width:720px){
  body.home-compact main .content-section{padding-top:16px;padding-bottom:16px}
  body.home-compact .content-section .section-heading{margin:0 0 8px}
  body.home-compact #novels .section-heading h2,body.home-compact #series .section-heading h2,body.home-compact #manga .section-heading h2{font-size:22px}
  body.home-compact #novels .novel-shelves{gap:14px}
  body.home-compact .novel-shelf-head{margin-bottom:6px}
  body.home-compact .novel-shelf-head h3{font-size:17px}
  body.home-compact .novel-shelf-head p{display:none}
  body.home-compact .novel-shelf-head button{display:none}
  body.home-compact .novel-shelves .original-library.novel-rail{grid-auto-columns:calc((100% - 20px)/3.15);gap:10px;padding-bottom:8px}
  body.home-compact .book-card-info{display:block;padding:8px 0 0}
  body.home-compact .book-card-info h3{font-size:14px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  body.home-compact .book-card-info p{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.home-compact .book-card-info small{display:none}
  body.home-compact .book-card-info>button{display:none}
  body.home-compact .book-card .free-ribbon,body.home-compact .book-card .complete-badge{font-size:9px;padding:3px 6px}
  body.home-compact .book-card .complete-badge{display:none}
  body.home-compact .manga-scroll{gap:10px}
  body.home-compact .manga-scroll>.manga-card{flex:0 0 calc((100% - 24px)/3.15)}
  body.home-compact .manga-card .manga-info p{display:none}
  body.home-compact .manga-card .manga-info h3{font-size:14px;line-height:1.35}
  body.home-compact .streaming-card{flex-basis:62%}
}

/* Smoother scrolling on phones and tablets.
   Frosted-glass blur behind fixed bars, cards and dialogs is repainted on every
   scroll frame and is the main cause of stutter on mid-range phones. Use solid
   tinted backgrounds there instead. */
@media (hover:none),(pointer:coarse),(max-width:900px){
  *,*::before,*::after{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
  .mobile-nav{background:rgba(18,10,32,.97)!important}
  body[data-theme="light"] .mobile-nav{background:rgba(255,255,255,.98)!important}
  .modal-backdrop{background:rgba(10,6,18,.78)!important}
  .site-header.scrolled{background:rgba(18,10,32,.96)!important}
  body[data-theme="light"] .site-header.scrolled{background:rgba(255,255,255,.97)!important}
}
/* Sections below the first screen are laid out and painted only when they come near the screen. */
#series,#manga,.continue-section,.at-support-strip,.membership,footer{content-visibility:auto;contain-intrinsic-size:auto 640px}

/* Homepage banners on a turning 3D ring (app.js renderHomepageRing). */
body .hero.hero-ring-mode{height:auto!important;min-height:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important;display:block;padding:8px 0 4px}
.hero.hero-ring-mode>:not(.hero-ring){display:none!important}
.hero-ring{--ring-card:clamp(170px,20vw,240px);position:relative;width:100%;user-select:none;touch-action:pan-y}
.hero-ring-stage{position:relative;height:calc(var(--ring-card) * 1.5 + 36px);perspective:1100px;perspective-origin:50% 45%;overflow:hidden;mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);-webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent)}
.hero-ring-track{position:absolute;left:50%;top:50%;translate:-50% -50%;width:var(--ring-card);aspect-ratio:2/3;transform-style:preserve-3d;transition:transform .9s cubic-bezier(.2,.75,.25,1)}
.hero-ring-card{position:absolute;inset:0;display:block;border-radius:14px;overflow:hidden;backface-visibility:hidden;background:#1a1424;box-shadow:0 18px 40px rgba(30,16,48,.28);transition:opacity .9s ease,box-shadow .3s ease}
.hero-ring-card img,.hero-ring-card video{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.hero-ring-card.is-front{box-shadow:0 22px 50px rgba(109,40,217,.38);outline:2px solid rgba(196,168,255,.55);outline-offset:-2px}
.hero-ring-arrow{position:absolute;top:calc(var(--ring-card) * .75 + 18px);translate:0 -50%;z-index:2;width:44px;height:44px;border-radius:50%;border:0;background:rgba(255,255,255,.88);color:#3b1d6e;font:700 28px/1 sans-serif;cursor:pointer;box-shadow:0 6px 18px rgba(30,16,48,.2)}
.hero-ring-arrow.prev{left:3%}
.hero-ring-arrow.next{right:3%}
.hero-ring-caption{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 14px;text-align:center;padding:10px 16px 0}
.hero-ring-caption span{width:100%;font:700 12px/1.4 "Noto Sans Thai",sans-serif;letter-spacing:.08em;color:#8b5cf6}
.hero-ring-caption b{font:800 clamp(18px,2.2vw,26px)/1.3 "Noto Sans Thai",sans-serif;color:var(--ink,#1d1430)}
.hero-ring-caption .gold-button{padding:10px 20px;font-size:15px}
body[data-theme=dark] .hero-ring-caption b{color:#f3eefc}
@media (max-width:720px){.hero-ring-arrow{display:none}.hero-ring{--ring-card:46vw}.hero-ring-stage{mask-image:none;-webkit-mask-image:none}}
@media (prefers-reduced-motion:reduce){.hero-ring-track,.hero-ring-card{transition:none}}

.hero-ring-card.is-logo{background:radial-gradient(circle at 50% 40%,#2a1d4a,#120b22)}
.hero-ring-card.is-logo img{object-fit:contain;padding:6%}

/* Portrait cover ring (owner, 19 Nov 2026): one 2:3 cover per work for novels, manga and series alike. */
.hero-ring-card .hero-ring-fallback{display:grid;place-items:center;width:100%;height:100%;padding:0 14px;color:#fff;font:800 17px/1.5 "Noto Sans Thai",sans-serif;text-align:center;background:linear-gradient(135deg,#7c4ddb,#1d1430)}
.hero-ring-caption .hero-ring-meta{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%;font:600 13px/1.6 "Noto Sans Thai",sans-serif;letter-spacing:0;color:inherit}
.hero-ring-caption .hero-ring-meta i{font-style:normal;padding:2px 10px;border-radius:999px;background:#7c4ddb;color:#fff;font-weight:700}
.hero-ring-caption .hero-ring-meta em{font-style:normal;opacity:.75}
.hero-ring-caption .hero-ring-meta i:empty,.hero-ring-caption .hero-ring-meta em:empty{display:none}
.hero-ring-caption b{width:100%;max-width:28ch}
.hero-ring-dots{display:flex;justify-content:center;gap:6px;width:100%;min-height:22px;align-items:center}
.hero-ring-dots i{display:block;width:6px;height:6px;border-radius:999px;background:currentColor;opacity:.25;transition:width .3s,opacity .3s,background .3s}
.hero-ring-dots i.on{width:20px;background:#7c4ddb;opacity:1}
