:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --mist: #f6f7f9;
  --mist-2: #edf0f4;
  --ink: #111317;
  --ink-sec: #424854;
  --muted: #68707d;
  --crimson: #d92d1b;
  --crimson-dark: #b91c1c;
  --crimson-soft: rgba(217, 45, 27, 0.10);
  --border: #e2e6ec;
  --border-strong: #cdd4de;
  --dark-bg: #0e1013;
  --dark-card: #16191f;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 12px rgba(17, 19, 23, 0.05);
  --shadow: 0 22px 54px rgba(17, 19, 23, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2.5px solid var(--crimson);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ==================== HEADER ==================== */
.rf-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}

.rf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.rf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rf-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.rf-brand strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.rf-brand strong span { color: var(--crimson); }

.rf-brand small {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.rf-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rf-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-sec);
  transition: background 0.15s, color 0.15s;
}

.rf-nav a:hover {
  background: var(--crimson-soft);
  color: var(--ink);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 18px;
  min-height: 40px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-crimson {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #ffffff;
}

.btn-crimson:hover {
  background: var(--crimson-dark);
  border-color: var(--crimson-dark);
  box-shadow: 0 6px 18px rgba(217, 45, 27, 0.25);
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.btn-dark:hover {
  background: #232730;
  border-color: #232730;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--crimson);
  background: #fff6f5;
}

.btn-outline.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

/* ==================== SECTIONS & STAGE ==================== */
.rf-hero-intro {
  padding: 40px 0 28px;
  background: radial-gradient(circle at 80% 0%, rgba(217, 45, 27, 0.06), transparent 52%), var(--bg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 8px;
}

.rf-hero-intro h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.rf-hero-intro p {
  max-width: 680px;
  font-size: 15px;
  color: var(--ink-sec);
}

.rf-section {
  padding: 42px 0 56px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 72px;
}

.rf-section-mist { background: var(--mist); }

.section-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.section-top h2 {
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 900;
  line-height: 1.18;
}

.section-top p {
  font-size: 14px;
  color: var(--ink-sec);
  max-width: 520px;
}

.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: var(--mist);
  border-top: 1px solid var(--border);
}

.stage-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-3d-viewport {
  width: 100%;
  height: clamp(320px, 48vw, 490px);
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #eef2f6 100%);
  position: relative;
}

.stage-3d-viewport.is-dark {
  background: radial-gradient(circle at 50% 42%, #1d2129 0%, #0b0d10 100%);
}

.stage-2d-viewport {
  width: 100%;
  height: clamp(280px, 42vw, 440px);
  background: radial-gradient(circle at 50% 46%, #ffffff 0%, #f4f6f9 100%);
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stage-2d-viewport.is-dark {
  background: radial-gradient(circle at 50% 46%, #191d24 0%, #0b0d10 100%);
}

/* ==================== 2D CINEMA ANIMATION CHOREOGRAPHY ==================== */
.rf2-stage-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.rf2-svg {
  width: min(100%, 740px);
  height: 100%;
  max-height: 390px;
  overflow: visible;
}

.is-square .rf2-svg {
  width: min(100%, 360px);
}

/* Default once timing (2.8s play + crisp locked hold) vs continuous 4.6s loop */
.rf2-once { --dur: 2.8s; --count: 1; }
.rf2-loop { --dur: 4.6s; --count: infinite; }

.rf2-viewfinder {
  animation: rf2Viewfinder var(--dur) ease-out var(--count) both;
}

.rf2-guide {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: rf2GuideDraw var(--dur) cubic-bezier(0.35, 0, 0.2, 1) var(--count) both;
}

.rf2-frame-top {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: rf2FrameTop var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-frame-bot {
  transform-box: fill-box;
  transform-origin: center top;
  animation: rf2FrameBot var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-lens-backing {
  transform-box: fill-box;
  transform-origin: center;
  animation: rf2LensBacking var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-lens-ring {
  animation: rf2LensRing var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-blade {
  animation: rf2ShutterBlade var(--dur) cubic-bezier(0.16, 1, 0.3, 1) var(--count) both;
}

.rf2-shutter-group {
  animation: rf2ShutterFade var(--dur) linear var(--count) both;
}

.rf2-flash-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: rf2FlashRing var(--dur) ease-out var(--count) both;
}

.rf2-lens-pupil {
  animation: rf2Pupil var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-lens-glint {
  animation: rf2Glint var(--dur) ease-out var(--count) both;
}

.rf2-glyph-f {
  transform-box: fill-box;
  transform-origin: center;
  animation: rf2GlyphCenter var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-glyph-col1,
.rf2-glyph-col2 {
  transform-box: fill-box;
  transform-origin: center;
  animation: rf2GlyphColon var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-glyph-e,
.rf2-glyph-R {
  animation: rf2GlyphLeft var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-glyph-t,
.rf2-glyph-o2 {
  animation: rf2GlyphRight var(--dur) cubic-bezier(0.22, 1, 0.36, 1) var(--count) both;
}

.rf2-sheen-sweep {
  animation: rf2Sheen var(--dur) ease-in-out var(--count) both;
}

@keyframes rf2Viewfinder {
  0% { opacity: 0; }
  8%, 35% { opacity: 0.72; }
  58%, 100% { opacity: 0; }
}

@keyframes rf2GuideDraw {
  0% { stroke-dashoffset: 1; opacity: 0.95; }
  16% { stroke-dashoffset: 0; opacity: 1; }
  26%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes rf2FrameTop {
  0%, 10% { opacity: 0; transform: translateY(16px) scaleY(0.76); }
  24%, 92% { opacity: 1; transform: translateY(0) scaleY(1); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes rf2FrameBot {
  0%, 10% { opacity: 0; transform: translateY(-16px) scaleY(0.76); }
  24%, 92% { opacity: 1; transform: translateY(0) scaleY(1); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes rf2LensBacking {
  0%, 15% { opacity: 0; transform: scale(0.4); }
  26%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes rf2LensRing {
  0%, 14% { opacity: 0; transform: scale(0.65) rotate(-42deg); }
  30% { opacity: 1; transform: scale(1.04) rotate(0deg); }
  38%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes rf2ShutterBlade {
  0%, 24% { transform: rotate(0deg); }
  44%, 100% { transform: rotate(66deg); }
}

@keyframes rf2ShutterFade {
  0%, 18% { opacity: 0; }
  21%, 41% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@keyframes rf2FlashRing {
  0%, 28% { opacity: 0; transform: scale(0.88); }
  35% { opacity: 0.9; transform: scale(1.16); }
  50%, 100% { opacity: 0; transform: scale(1.38); }
}

@keyframes rf2Pupil {
  0%, 27% { opacity: 0; transform: scale(0.15); }
  38% { opacity: 1; transform: scale(1.12); }
  44%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes rf2Glint {
  0%, 36% { opacity: 0; }
  46%, 100% { opacity: 0.88; }
}

@keyframes rf2GlyphCenter {
  0%, 25% { opacity: 0; transform: scale(0.82); }
  40%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes rf2GlyphColon {
  0%, 30% { opacity: 0; transform: scale(0.35); }
  44%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes rf2GlyphLeft {
  0%, 32% { opacity: 0; transform: translateX(48px); }
  52%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes rf2GlyphRight {
  0%, 34% { opacity: 0; transform: translateX(-48px); }
  54%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes rf2Sheen {
  0%, 54% { transform: translateX(-160px); opacity: 0; }
  60% { opacity: 1; }
  78% { transform: translateX(1020px); opacity: 1; }
  82%, 100% { transform: translateX(1020px); opacity: 0; }
}

/* ==================== 3D & 2D GALLERY GRIDS ==================== */
.gallery-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.asset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.asset-preview {
  aspect-ratio: 16 / 10;
  background: var(--mist);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.asset-preview.bg-dark { background: var(--dark-bg); }
.asset-preview.bg-white { background: #ffffff; }
.asset-preview.bg-3d { padding: 0; }

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-preview.bg-3d img {
  object-fit: cover;
}

.asset-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.asset-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--crimson-soft);
  color: var(--crimson);
}

.asset-body h3 {
  font-size: 16px;
  font-weight: 800;
}

.asset-body p {
  font-size: 13px;
  color: var(--ink-sec);
  flex: 1;
}

.asset-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

/* ==================== FULLSCREEN PLAYER PAGES ==================== */
.player-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.player-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 24px 0;
}

.player-main .stage-card { width: 100%; }
.player-main .stage-3d-viewport { height: clamp(360px, 64vh, 620px); }
.player-main .stage-2d-viewport { height: clamp(340px, 60vh, 560px); }

/* ==================== FOOTER ==================== */
.rf-footer {
  padding: 22px 0 28px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
}

.rf-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .rf2-once *, .rf2-loop * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 920px) {
  .rf-nav { display: none; }
  .gallery-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .rf-hero-intro { padding: 26px 0 18px; }
  .rf-section { padding: 30px 0 38px; }
  .stage-toolbar { padding: 12px 14px; }
  .stage-controls { width: 100%; }
  .stage-controls .btn { flex: 1 1 auto; min-height: 44px; font-size: 12.5px; padding: 9px 12px; }
}
