/* ============================================
   KAMEI CYLIN ® — HERO (Light Theme)
   ============================================ */

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #ffffff;
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 0.6s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.typewriter-cursor.done { display: none; }

/* ── Glitch Effect (triggered once after typewriter completes) ── */
@keyframes glitch-skew {
  0%   { text-shadow: none;                  transform: none; }
  15%  { text-shadow: -3px 0 #e62b1e, 3px 0 #0066ff;  transform: translate(-2px, 0) skewX(-1deg); }
  30%  { text-shadow: 3px 0 #e62b1e, -3px 0 #00ccff;   transform: translate(2px, 1px) skewX(1deg); }
  45%  { text-shadow: -2px 0 #ff00ff, 2px 0 #00ff66;   transform: translate(-1px, -1px) skewX(-0.5deg); }
  60%  { text-shadow: 2px 0 #00ffff, -2px 0 #ff0000;   transform: translate(3px, 0) skewX(0.5deg); }
  80%  { text-shadow: -1px 0 #ffff00, 1px 0 #0000ff;   transform: translate(1px, -2px); }
  100% { text-shadow: none;                  transform: none; }
}
.hero-title.glitch {
  animation: glitch-skew 0.45s ease;
}

.hero {
  position: relative; z-index: 10;
  display: flex; align-items: flex-start;
  min-height: 100vh; overflow: hidden;
  margin-top: 0; background: var(--bg);
}
.hero.split { overflow: visible; }

.hero-left {
  position: relative; width: 100%; flex-shrink: 0;
  height: 100vh; display: flex; align-items: center;
  justify-content: center; overflow: hidden;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  background: #111;
}
.hero.split .hero-left {
  width: 55%; position: sticky; top: 70px;
  height: calc(100vh - 70px);
}

.hero-left-bg {
  position: absolute; inset: 0;
  background: #111; transition: opacity 0.6s ease; z-index: 0;
}

.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 0; opacity: 0; transition: opacity 1s ease;
}
.hero-video.loaded { opacity: 1; }

/* Preview wrapper — contain mode with gradient blur sides */
.hero-preview-wrapper {
  position: absolute; inset: 0;
  z-index: 1; opacity: 0;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.hero-preview-wrapper.active { opacity: 1; }

.hero-preview-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
}

.hero-preview-gradient {
  position: absolute; top: 0; bottom: 0; width: 16%;
  z-index: 2; pointer-events: none;
}
.hero-preview-gradient-left {
  left: 0;
  background: linear-gradient(to right, rgba(17,17,17,0.97), transparent);
}
.hero-preview-gradient-right {
  right: 0;
  background: linear-gradient(to left, rgba(17,17,17,0.97), transparent);
}

/* Preview text overlay — image name as title */
.hero-preview-text {
  position: absolute; inset: 0;
  z-index: 3; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 40px;
}
.hero-preview-text.active { opacity: 1; }

.hero-preview-title {
  font-size: clamp(3.6rem, 6.5vw, 5.6rem);
  font-weight: 900; line-height: 1.02;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-align: center;
  word-break: break-word;
}

.hero-left-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 16px;
  padding: 80px 60px; max-width: 1040px; width: 100%;
  transition: opacity 0.3s ease;
}

.hero-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.3em;
  color: #e62b1e; font-weight: 700;
  text-transform: uppercase; margin-bottom: 0;
  visibility: hidden; opacity: 0;
}
/* Title wrapper */
.hero-title-line {
  display: block;
  position: relative;
}
.hero-title {
  font-size: clamp(2rem, 4.2vw, 4.5rem);
  font-weight: 900; line-height: 1.02;
  letter-spacing: -0.04em; margin-bottom: 0;
  color: #ffffff; visibility: hidden; opacity: 0;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* Subtitle group — left-aligned block, internal lines left-aligned */
.hero-subtitle-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
}
.hero-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  color: rgba(255,255,255,0.72); font-weight: 400;
  margin: 0; line-height: 1.4;
  visibility: hidden; opacity: 0;
  white-space: nowrap;
}
.hero-description {
  font-size: clamp(0.85rem, 1.3vw, 1.1rem);
  color: rgba(255,255,255,0.7); font-weight: 400;
  line-height: 1.65;
  visibility: hidden; opacity: 0;
  display: block;
}
.btn-primary {
  align-self: center;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px; background: transparent;
  border: 1.5px solid #ffffff; color: #ffffff;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: all 0.35s ease; position: relative;
  overflow: hidden; visibility: hidden; opacity: 0;
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: #ffffff; transform: scaleX(0);
  transform-origin: left; transition: transform 0.35s ease; z-index: -1;
}
.btn-primary:hover { color: #111; }
.btn-primary:hover::before { transform: scaleX(1); }

/* Right panel */
.hero-right {
  width: 0; flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero.split .hero-right {
  width: 45%; overflow-y: auto; overflow-x: hidden;
}
.hero-right-inner {
  padding: 80px 56px 80px; width: 100%; min-width: 0;
  max-width: 720px; margin: 0 auto;
}

/* ── Cover image/video at top of right panel ── */
.hero-right-cover {
  width: 100%; margin-bottom: 36px;
  border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  background: var(--bg-card);
}
.hero-right-cover-media {
  width: 100%; max-height: 420px;
  object-fit: cover; display: block;
}

/* ── Right panel two-column text section ── */
.hero-right-text-section {
  display: grid; grid-template-columns: 38% 62%; gap: 24px 32px;
  margin-bottom: 36px; align-items: start;
}
.hero-right-text-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 900; line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero-right-text-body {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  line-height: 1.75;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero-right-text-body.revealed {
  opacity: 1; transform: translateY(0);
}

.hero-right-label {
  font-size: 0.6rem; letter-spacing: 0.25em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 10px; font-weight: 700;
}

/* Right panel text section (scroll-revealed) — legacy */
.hero-right-text {
  margin-bottom: 30px;
}
.hero-right-text .hero-right-desc {
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 8px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero-right-text .hero-right-desc.revealed {
  opacity: 1; transform: translateY(0);
}

/* Grid */
.hero-image-grid.single {
  display: flex; flex-direction: column; gap: 30px;
}
.hero-image-grid.double {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
}

/* Image reveal animation — hidden until typewriter completes */
.hero-image-item.stagger-hidden {
  opacity: 0; transform: translateY(18px);
}
.hero-right-text .hero-right-desc.stagger-hidden {
  opacity: 0; transform: translateY(10px);
}

.hero-image-item {
  position: relative; cursor: pointer; overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 500px; width: 100%;
}
.hero-image-item:hover {
  transform: translateY(-3px);
  border-color: rgba(230,43,30,0.4);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08); z-index: 2;
}
.hero-image-item.horizontal { aspect-ratio: 16 / 9; }
.hero-image-item.vertical { aspect-ratio: 3 / 4; }
.hero-image-item:not(.horizontal):not(.vertical) { aspect-ratio: 4 / 5; }

.hero-image-item-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: filter 0.4s ease, transform 0.5s ease;
}
.hero-image-item:hover .hero-image-item-img {
  filter: brightness(1.05); transform: scale(1.04);
}

.hero-image-item-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8e8e8, #ddd);
  position: relative; min-height: 120px;
}
.placeholder-plus {
  font-size: 2.5rem; color: rgba(0,0,0,0.12);
  font-weight: 300; line-height: 1; user-select: none;
}

/* Caption: white, centered, filename without extension */
.hero-image-item-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  opacity: 1; transition: opacity 0.3s ease; text-align: center;
}
.hero-image-item-caption .item-title {
  font-size: 0.85rem; font-weight: 700;
  color: #ffffff; line-height: 1.2; text-align: center;
}

/* Video in hero grid */
.hero-image-item video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

@media (max-width: 1024px) {
  .hero { flex-direction: column; min-height: auto; overflow: visible; }
  .hero.split .hero-left { position: relative; top: auto; width: 100% !important; height: 70vh; }
  .hero.split .hero-right { width: 100% !important; border-left: none; border-top: 1px solid var(--border); }
  .hero-right-inner { padding: 40px 24px; max-width: none; }
  .hero-image-grid.double { grid-template-columns: 1fr 1fr; }
  .hero-left-content {
    padding: 60px 40px; max-width: 100%;
  }
}
@media (max-width: 768px) {
  .hero-left-content { padding: 60px 24px; }
  .hero-right-inner { padding: 30px 20px; min-width: auto; max-width: none; }
  .hero.split .hero-left { height: 55vh; }
  .hero-image-grid.double { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   Split Right Panel — New Layout
   ═══════════════════════════════════════════ */

/* ── Title character-by-character bounce + flicker (1.2s total) ── */
@keyframes hero-char-bounce {
  0%   { opacity: 0;   transform: translateY(-4px); }
  25%  { opacity: 1;   transform: translateY(0); }
  40%  { opacity: 0.3; transform: translateY(-1px); }
  60%  { opacity: 1;   transform: translateY(0); }
  75%  { opacity: 0.7; transform: translateY(-1px); }
  90%  { opacity: 1;   transform: translateY(0); }
  100% { opacity: 1;   transform: translateY(0); }
}

.hero-right-title-char {
  display: inline-block;
  opacity: 0;
  animation: hero-char-bounce 0.35s ease-out both;
  animation-play-state: paused;
}

.hero-right-title-char.animating {
  animation-play-state: running;
}

/* ── Magazine layout area: title float-left + content wraps around ── */
.hero-right-magazine-area {
  margin-bottom: 36px;
}

/* Right panel title — floated left, bold display type for magazine feel */
.hero-right-title {
  float: left;
  width: 42%;
  margin-right: 24px;
  margin-bottom: 6px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Right panel content text — block element; inline text wraps around the floated title */
.hero-right-content-text {
  font-size: clamp(0.82rem, 1.35vw, 0.95rem);
  color: var(--text-secondary);
  line-height: 1.75;
  min-height: 1.5em;
}
.hero-right-content-text p { text-indent: 2em; margin-bottom: 0.6em; }
.hero-right-content-text p:last-child { margin-bottom: 0; }

/* Clearfix — ensures magazine area container extends below the floated title */
.hero-right-magazine-clear {
  clear: both;
  height: 0;
}

/* Narrow right panel — stack title and content vertically */
@media (max-width: 900px) {
  .hero-right-title {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 16px;
  }
}

/* ── Pull-to-close hint (inside right panel, slides in from top) ── */
.hero-scroll-hint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 20px 10px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%);
}

.hero-scroll-hint.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-scroll-hint-arrow {
  font-size: 0.9rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
}

.hero-scroll-hint-text {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em;
  font-weight: 400;
}