/*
Theme Name: Cengkerik V3
Theme URI: https://cengkerik.com/
Author: Cengkerik Sdn Bhd
Author URI: https://cengkerik.com/
Description: An elegant, cinematic, fast and SEO-friendly WordPress theme for film studios, animation houses and creative portfolios. Near-black and gold palette, Cinzel + Inter typography, accessible navigation, Customizer-driven hero and contact settings.
Version: 3.1.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cengkerik-royal-v3
Tags: portfolio, entertainment, blog, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ---------------------------------------------------------------- tokens */
:root {
  --color-bg: #070707;
  --color-bg-deep: #020202;
  --color-surface: #10100f;
  --color-surface-soft: #171612;
  --color-gold: #c9a227;
  --color-gold-bright: #f3d77d;
  --color-gold-pale: #fff1c9;
  --color-text: #f4f0e7;
  --color-muted: #aaa59b;
  --color-muted-dark: #777269;
  --color-border: rgba(244, 228, 188, 0.16);
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Inter", Arial, Helvetica, sans-serif;
  --container: 1200px;
  --header-h: 84px;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-gold-bright); text-decoration: none; }
a:hover { color: var(--color-gold-pale); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-gold-pale);
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1.2em; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute !important; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--color-gold); color: #0a0a08; padding: 10px 18px;
  border-radius: 0 0 8px 8px; font-weight: 600; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; color: #0a0a08; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }
.center { text-align: center; }

.kicker {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-bottom: 1.1em;
}
.lead { font-size: 1.15rem; color: var(--color-muted); }

/* --------------------------------------------------------------- buttons */
.button {
  display: inline-block;
  padding: 14px 34px;
  border-radius: 999px;
  border: 1px solid var(--color-gold);
  color: var(--color-gold-bright);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}
.button:hover { transform: translateY(-2px); background: rgba(201, 162, 39, 0.12); }
.button.gold {
  background: linear-gradient(120deg, var(--color-gold), var(--color-gold-bright));
  color: #171204;
  border: none;
}
.button.gold:hover { color: #0d0a02; filter: brightness(1.06); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(4, 4, 3, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.header-inner {
  width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-branding a {
  display: flex; align-items: baseline; gap: 10px; color: var(--color-gold-pale);
}
.site-title {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700; letter-spacing: 0.08em; margin: 0;
}
.site-title .accent { color: var(--color-gold); }
.custom-logo { max-height: 52px; width: auto; }

.primary-navigation ul {
  display: flex; gap: 30px; list-style: none; margin: 0; padding: 0;
}
.primary-navigation a {
  color: var(--color-text); font-size: 0.92rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 2px; position: relative;
}
.primary-navigation a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--color-gold-bright);
  transition: right 0.3s var(--ease);
}
.primary-navigation a:hover::after,
.primary-navigation .current-menu-item > a::after { right: 0; }

.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--color-border);
  color: var(--color-gold-pale); border-radius: 10px;
  padding: 10px 14px; font-size: 0.85rem; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer;
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; min-height: 96vh;
  display: flex; align-items: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 78% -10%, rgba(201, 162, 39, 0.22), transparent 62%),
    radial-gradient(900px 480px at 8% 112%, rgba(201, 162, 39, 0.12), transparent 60%),
    linear-gradient(180deg, #0d0c09 0%, var(--color-bg) 58%, var(--color-bg-deep) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg, rgba(244, 228, 188, 0.035) 0 1px, transparent 1px 160px);
}
.hero::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(760px, 86vw); height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  opacity: 0.65;
}
.hero-inner { position: relative; padding: calc(var(--header-h) + 60px) 24px 90px; }
.hero .lead { max-width: 560px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 2em; }
.hero-frame {
  display: inline-block; margin-bottom: 1.6em;
  padding: 10px 26px; border: 1px solid var(--color-border); border-radius: 999px;
  color: var(--color-muted); font-size: 0.8rem; letter-spacing: 0.28em; text-transform: uppercase;
}

/* -------------------------------------------------------------- sections */
.section { padding: 110px 0; }
.section.alt { background: linear-gradient(180deg, var(--color-bg-deep), var(--color-bg)); }
.section-head { max-width: 720px; margin-bottom: 56px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- studio */
.studio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.studio-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 36px 30px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.studio-card:hover { transform: translateY(-6px); border-color: rgba(201, 162, 39, 0.5); }
.studio-card .num {
  font-family: var(--font-display); color: var(--color-gold);
  font-size: 0.95rem; letter-spacing: 0.2em; display: block; margin-bottom: 14px;
}
.studio-card p { color: var(--color-muted); margin: 0; font-size: 0.98rem; }

/* ----------------------------------------------------------------- works */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.film-card {
  position: relative; display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--color-text);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.film-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: rgba(201, 162, 39, 0.55); color: var(--color-text); }
.film-card .thumb { aspect-ratio: 3 / 2; overflow: hidden; background: var(--color-surface-soft); }
.film-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.film-card:hover .thumb img { transform: scale(1.05); }
.film-card .thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(360px 200px at 50% 0%, rgba(201, 162, 39, 0.16), transparent 70%),
    var(--color-surface-soft);
  color: var(--color-gold); font-family: var(--font-display); font-size: 2rem;
}
.film-card .body { padding: 24px 26px 28px; }
.film-card h3 { margin-bottom: 8px; }
.film-card .meta { color: var(--color-muted-dark); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; }
.film-card .excerpt { color: var(--color-muted); font-size: 0.95rem; margin: 10px 0 0; }

.works-empty {
  border: 1px dashed var(--color-border); border-radius: var(--radius);
  padding: 60px 30px; text-align: center; color: var(--color-muted);
}

/* --------------------------------------------------------------- contact */
.contact { background: linear-gradient(180deg, var(--color-bg), #0b0a07 70%, #0d0b06); }
.contact .form-wrap { margin: 2.2em auto 0; max-width: 640px; text-align: left; }
.contact-email { margin-top: 1.6em; }
.contact-email a { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.04em; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 54px 0 40px; background: var(--color-bg-deep);
  color: var(--color-muted); font-size: 0.9rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer-navigation ul { display: flex; flex-wrap: wrap; gap: 22px; list-style: none; margin: 0; padding: 0; }
.footer-navigation a { color: var(--color-muted); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-navigation a:hover { color: var(--color-gold-bright); }

/* ------------------------------------------------------- inner pages/blog */
.page-shell { padding: calc(var(--header-h) + 70px) 0 100px; }
.entry-header { max-width: 820px; margin: 0 auto 40px; padding: 0 24px; }
.entry-meta { color: var(--color-muted-dark); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; }
.entry-thumb { max-width: var(--container); margin: 0 auto 48px; padding: 0 24px; }
.entry-thumb img { border-radius: var(--radius); }
.entry-content { max-width: 820px; margin: 0 auto; padding: 0 24px; color: #e9e4d8; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content img { border-radius: 10px; }
.entry-content blockquote {
  border-left: 3px solid var(--color-gold); margin: 1.6em 0; padding: 4px 0 4px 22px;
  color: var(--color-muted); font-style: italic;
}
.post-nav { max-width: 820px; margin: 60px auto 0; padding: 0 24px; display: flex; justify-content: space-between; gap: 20px; }

.archive-grid { max-width: var(--container); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.pagination { text-align: center; margin-top: 60px; }
.pagination .page-numbers {
  display: inline-block; min-width: 42px; padding: 9px 12px; margin: 0 3px;
  border: 1px solid var(--color-border); border-radius: 10px; color: var(--color-text);
}
.pagination .page-numbers.current { background: var(--color-gold); color: #171204; border-color: var(--color-gold); }

/* ------------------------------------------------------------------- 404 */
.error-404 { min-height: 70vh; display: flex; align-items: center; text-align: center; }
.error-404 .code { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 10rem); color: var(--color-gold); line-height: 1; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1024px) {
  .studio-grid, .works-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .menu-toggle { display: inline-block; }
  .primary-navigation {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: rgba(4, 4, 3, 0.97); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    padding: 18px 24px 30px;
    display: none;
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { flex-direction: column; gap: 4px; }
  .primary-navigation a { display: block; padding: 13px 6px; font-size: 1rem; }
  .section { padding: 80px 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .studio-grid, .works-grid, .archive-grid { grid-template-columns: 1fr; }
  .hero { min-height: 88vh; }
  .hero-actions .button { width: 100%; text-align: center; }
}

/* ==================================================== motion layer (v3.1) */
/* Scroll progress bar (injected by main.js into the fixed header) */
.scroll-progress {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  transform: scaleX(var(--scroll-progress, 0)); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-pale));
  pointer-events: none;
}

/* Hero: animated parallax light layers */
.hero-motion {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  transform: translate3d(0, calc(var(--hero-scroll, 0) * 110px), 0);
}
.hero-motion .orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5;
  will-change: transform;
}
.hero-motion .orb-a {
  width: 560px; height: 560px; right: -140px; top: -180px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.34), transparent 70%);
  animation: orb-drift-a 18s var(--ease) infinite alternate;
}
.hero-motion .orb-b {
  width: 460px; height: 460px; left: -160px; bottom: -200px;
  background: radial-gradient(circle, rgba(243, 215, 125, 0.16), transparent 70%);
  animation: orb-drift-b 22s var(--ease) infinite alternate;
}
.hero-motion .beam {
  position: absolute; top: -25%; bottom: -25%; width: 190px; left: 0;
  background: linear-gradient(90deg, transparent, rgba(243, 215, 125, 0.07), transparent);
  animation: beam-sweep 11s ease-in-out infinite;
}
.hero-motion .grain {
  position: absolute; inset: -60px; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.4s steps(4) infinite;
}
@keyframes orb-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-70px, 60px, 0) scale(1.12); }
}
@keyframes orb-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(80px, -50px, 0) scale(1.08); }
}
@keyframes beam-sweep {
  from { transform: translateX(-40vw) rotate(16deg); }
  to   { transform: translateX(140vw) rotate(16deg); }
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); } 25% { transform: translate(-18px, 12px); }
  50% { transform: translate(14px, -16px); } 75% { transform: translate(-10px, -8px); }
  100% { transform: translate(0, 0); }
}

/* Hero content: cinematic entrance + gentle scroll fade */
.hero-inner {
  transform: translateY(calc(var(--hero-scroll, 0) * -42px));
  opacity: calc(1 - var(--hero-scroll, 0) * 0.55);
}
.hero .hero-frame { animation: rise-in 0.9s var(--ease) both; }
.hero h1 { animation: cinematic-in 1.15s 0.15s var(--ease) both; }
.hero .lead { animation: rise-in 1s 0.4s var(--ease) both; }
.hero .hero-actions { animation: rise-in 1s 0.55s var(--ease) both; }
@keyframes cinematic-in {
  from { opacity: 0; transform: translateY(34px); filter: blur(12px); letter-spacing: 0.08em; }
  to   { opacity: 1; transform: none; filter: blur(0); letter-spacing: 0.01em; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* Reveal-on-scroll: add a cinematic blur to the existing rise */
.reveal {
  opacity: 0; transform: translateY(28px); filter: blur(7px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease), filter 0.75s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* Marquee ticker between hero and studio */
.marquee {
  overflow: hidden; padding: 20px 0;
  border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-deep);
}
.marquee-track {
  display: flex; align-items: center; gap: 44px; width: max-content; white-space: nowrap;
  font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--color-muted);
  animation: marquee 36s linear infinite;
}
.marquee-track .dot { color: var(--color-gold); font-size: 0.7rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .hero-motion { transform: none; }
  .hero-inner { transform: none; opacity: 1; }
  .marquee-track { width: auto; }
}
