/* Authly Grej — manga / anime theme layer (loads after site.css)
   Ink outlines, hard panel shadows, screentones, speed lines, katakana SFX. */
:root {
  --bg: #fbfaf6;
  --paper: #ffffff;
  --ink: #121216;
  --ink-2: #26262d;
  --line: rgba(18, 18, 22, 0.14);
  --line-2: rgba(18, 18, 22, 0.24);
  --pink: #ff4f8b;
  --pink-soft: #ffe3ee;
  --yellow: #ffe45c;
  --accent: #6d28d9;
  --accent-soft: #efe7ff;
  --stroke: 2.5px;
  --pop: 5px 5px 0 var(--ink);
  --pop-lg: 8px 8px 0 var(--ink);
  --font-manga: 'Dela Gothic One', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-jp: 'Zen Kaku Gothic New', 'Inter', system-ui, sans-serif;
}

body { background: var(--bg); }
::selection { background: var(--yellow); color: var(--ink); }

/* ---------- Paper background: screentone corners + faint speed lines ---------- */
.ambient .blob { display: none; }
.ambient::before {
  background-image: radial-gradient(rgba(18, 18, 22, .16) 1.1px, transparent 1.3px);
  background-size: 9px 9px;
  mask-image: radial-gradient(ellipse 42% 38% at 100% 0%, #000 0%, transparent 75%), radial-gradient(ellipse 38% 34% at 0% 100%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 42% 38% at 100% 0%, #000 0%, transparent 75%), radial-gradient(ellipse 38% 34% at 0% 100%, #000 0%, transparent 75%);
  -webkit-mask-composite: source-over; mask-composite: add;
}
.ambient::after {
  content: ""; position: absolute; inset: -20%;
  background: repeating-conic-gradient(from 0deg at 85% 8%, rgba(18,18,22,.05) 0deg .6deg, transparent .6deg 7deg);
  mask-image: radial-gradient(circle at 85% 8%, transparent 18%, #000 45%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 85% 8%, transparent 18%, #000 45%, transparent 75%);
}

/* ---------- Display type ---------- */
.h-display, .h-section, .page-hero h1, .card h1, .quote h2, .cta h2 {
  font-family: var(--font-manga); font-weight: 400; letter-spacing: -.01em;
}
.h-display { line-height: 1.08; }
.h-section { line-height: 1.15; }
.shiny {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, var(--pink) 50%, var(--ink) 60%, var(--ink) 100%);
  background-size: 250% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
}
.marker { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; }

/* Katakana section labels + big outlined watermark */
.section-head { position: relative; isolation: isolate; }
.section-head[data-kana]::before {
  content: attr(data-kana); display: block; margin-bottom: 12px;
  font-family: var(--font-jp); font-weight: 900; font-size: .82rem; letter-spacing: .5em; color: var(--pink);
}
.section-head[data-kana]::after {
  content: attr(data-kana); position: absolute; left: 50%; top: -46px; z-index: -1; transform: translateX(-50%);
  font-family: var(--font-manga); font-size: clamp(5rem, 13vw, 10rem); line-height: 1; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(18,18,22,.08); pointer-events: none;
}

/* ---------- Panels (cards) ---------- */
.feat, .plan, .post, .doc-card, .sdk, .qa, .stats, .paper, .toc, .loop-item, .limit, .cmd-list li, .billing, .app-card {
  border: var(--stroke) solid var(--ink) !important;
  box-shadow: var(--pop) !important;
  border-radius: 14px;
  background-color: var(--paper);
}
.feat:hover, .plan:hover, .post:hover, .sdk:hover, .doc-card:hover {
  transform: translate(-3px, -3px) !important;
  box-shadow: var(--pop-lg) !important;
  border-color: var(--ink) !important;
}
.limit, .cmd-list li { box-shadow: 3px 3px 0 var(--ink) !important; }
.limit.off { background: repeating-linear-gradient(135deg, #f4f3ef 0 6px, #fff 6px 12px); }
.toc { box-shadow: 4px 4px 0 var(--ink) !important; }
.toc a.active { background: var(--yellow); box-shadow: none; color: var(--ink); }
.toc a.active::before { background: var(--ink); }

/* Halftone corner on feature panels */
.feat { position: relative; overflow: hidden; }
.feat::after {
  content: ""; position: absolute; right: -10px; bottom: -10px; width: 130px; height: 130px; pointer-events: none;
  background-image: radial-gradient(var(--ink) 1.2px, transparent 1.5px); background-size: 8px 8px; opacity: .14;
  mask-image: radial-gradient(circle at 100% 100%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 100% 100%, #000 10%, transparent 70%);
}
.feat .ic, .doc-card .dc-ic { border: var(--stroke) solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); }
.feat:hover .ic { background: var(--pink); color: #fff; }
.doc-card .dc-ic { background: var(--yellow); }

/* ---------- Buttons ---------- */
.btn { border: var(--stroke) solid var(--ink); border-radius: 12px; font-weight: 700; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--pink) !important; }
.btn-dark:hover { box-shadow: 6px 6px 0 var(--pink) !important; }
.btn-light { background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--ink) !important; }
.btn-light:hover { box-shadow: 6px 6px 0 var(--ink) !important; }
.btn-dark:active, .btn-light:active { transform: translate(3px, 3px) !important; box-shadow: 1px 1px 0 var(--ink) !important; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: var(--yellow); }
.btn-sm { border-radius: 10px; }

/* ---------- Navbar ---------- */
.nav { background: rgba(255,255,255,.94); border: var(--stroke) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.nav.scrolled { box-shadow: 5px 5px 0 var(--ink); background: #fff; }
.nav-links a:hover { background: var(--yellow); color: var(--ink); }
.mobile-menu { border: var(--stroke) solid var(--ink); box-shadow: var(--pop); }
.brand img { border: 2px solid var(--ink); }

/* ---------- Eyebrow = sticker ---------- */
.eyebrow {
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1.5deg); border-radius: 8px;
}
.eyebrow .dot { background: var(--pink); box-shadow: none; }
.chip-tag { border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); border-radius: 6px; }

/* ---------- Speech bubble ---------- */
.bubble {
  position: absolute; z-index: 4; max-width: 210px; padding: 12px 16px;
  background: #fff; border: var(--stroke) solid var(--ink); border-radius: 22px; box-shadow: 4px 4px 0 var(--ink);
  font-weight: 700; font-size: .92rem; line-height: 1.35; color: var(--ink);
}
.bubble small { display: block; font-family: var(--font-jp); font-weight: 700; font-size: .72rem; color: var(--pink); letter-spacing: .1em; margin-top: 2px; }
.bubble::before, .bubble::after { content: ""; position: absolute; width: 0; height: 0; border-style: solid; }
.bubble.tail-bl::before { left: 26px; bottom: -18px; border-width: 18px 14px 0 0; border-color: var(--ink) transparent transparent transparent; }
.bubble.tail-bl::after { left: 29px; bottom: -11px; border-width: 12px 9px 0 0; border-color: #fff transparent transparent transparent; }
.bubble.tail-br::before { right: 26px; bottom: -18px; border-width: 18px 0 0 14px; border-color: var(--ink) transparent transparent transparent; }
.bubble.tail-br::after { right: 29px; bottom: -11px; border-width: 12px 0 0 9px; border-color: #fff transparent transparent transparent; }

/* ---------- Sound effects ---------- */
.sfx {
  position: absolute; z-index: 5; pointer-events: none; user-select: none;
  font-family: var(--font-manga); line-height: 1; white-space: nowrap;
  color: var(--pink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}
.sfx.pop { animation: sfxPop 2.8s var(--ease) infinite; }
@keyframes sfxPop { 0%, 55% { transform: scale(0) rotate(var(--r, -10deg)); opacity: 0; } 62% { transform: scale(1.25) rotate(var(--r, -10deg)); opacity: 1; } 70%, 90% { transform: scale(1) rotate(var(--r, -10deg)); opacity: 1; } 100% { transform: scale(1) rotate(var(--r, -10deg)); opacity: 0; } }

/* ---------- Speed-line burst (inside manga panels) ---------- */
.burst { position: absolute; inset: -30%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--ink) 0deg .9deg, transparent .9deg 6deg);
  mask-image: radial-gradient(circle, transparent 26%, #000 58%);
  -webkit-mask-image: radial-gradient(circle, transparent 26%, #000 58%);
  opacity: .9; animation: burstSpin 40s linear infinite;
}
@keyframes burstSpin { to { transform: rotate(360deg); } }

/* Manga panel frame */
.manga-panel { position: relative; overflow: hidden; isolation: isolate; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--pop-lg); }
.manga-panel .tone { position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--ink) 1.1px, transparent 1.4px); background-size: 8px 8px; opacity: .1; }

/* ---------- Anime artwork slots (images/anime/*.png) ---------- */
.hero-art {
  position: relative; z-index: 3; display: block; width: auto; height: auto;
  max-width: 92%; max-height: 440px; object-fit: contain;
  filter: drop-shadow(5px 5px 0 var(--ink));
  animation: artBob 4s ease-in-out infinite;
}
@keyframes artBob { 50% { transform: translateY(-10px); } }
/* Line-art cutouts stay hidden until their background is removed */
img[data-cutout] { opacity: 0; transition: opacity .5s var(--ease); }
img[data-cutout].cut { opacity: 1; }
.hero-art.lineart { filter: drop-shadow(5px 5px 0 rgba(255, 79, 139, .9)); }
/* Art cropped at the bottom edge sits on the panel's bottom border, like a manga frame */
.hero-art.anchored { position: absolute; bottom: 0; left: 50%; translate: -50% 0; max-height: 96%; max-width: 92%; animation: none; filter: none; }
/* No artwork yet: hide the speech bubble (nobody to say it) */
.hero-scene:not(:has(.hero-art)) .hero-bubble, .stage:not(:has(.hero-art)) .art-bubble { display: none; }

/* ---------- Sakura petals canvas ---------- */
.sakura { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ---------- Page-specific polish ---------- */
.lic { border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--pink) !important; }
.float { border: 2px solid var(--ink) !important; box-shadow: 3px 3px 0 var(--ink) !important; background: #fff !important; border-radius: 10px; }
.window, .code-block { border: var(--stroke) solid var(--ink); box-shadow: 6px 6px 0 var(--pink) !important; }
.plan.featured { background: var(--ink); box-shadow: 8px 8px 0 var(--pink) !important; }
.plan.featured::before { display: none; }
.plan.featured .tag { background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); transform: rotate(4deg); font-family: var(--font-jp); font-weight: 900; }
.stat { border-color: var(--ink) !important; border-right-width: var(--stroke) !important; }
.stat strong { font-family: var(--font-manga); font-weight: 400; }
.qa.open .pm { background: var(--pink); }
.qa .pm { border: 2px solid var(--ink); }
.step.active { border: var(--stroke) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.step.active .n { background: var(--pink); border-color: var(--ink); }
.step .n { border: 2px solid var(--ink); }
.billing .pill { background: var(--pink); }
.billing .save { background: var(--yellow); color: var(--ink); }
.sdk-badge, .loop-item .badge { border: 2px solid var(--ink); }
.lang-pill { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.cta { border: 3px solid var(--ink); box-shadow: 10px 10px 0 var(--pink); }
.cta::before { background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.14) 0deg 1deg, transparent 1deg 6deg); opacity: 1; animation-duration: 60s; }
.cta::after { background: radial-gradient(60% 80% at 50% 50%, #121216 30%, rgba(18,18,22,.4) 70%, transparent); }
.cta .btn-dark { border-color: #fff; box-shadow: 4px 4px 0 var(--pink) !important; }
.cta .btn-out { border-color: #fff; }
.read-progress { background: var(--pink); height: 4px; }
.prose ul li::before { background: var(--pink); }
.prose ol li::before { background: var(--pink); border: 2px solid var(--ink); }
.toast { border: var(--stroke) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
footer.site-foot .foot { border-bottom: var(--stroke) solid var(--ink); }
.foot-cols a:hover { color: var(--pink); }

@media (max-width: 600px) {
  .section-head[data-kana]::after { top: -24px; }
}
@media (prefers-reduced-motion: reduce) {
  .sakura { display: none; }
}
