/* ─── Hero: full-viewport grainy gradient, lavender → purple → mint (reference: Playke-style render) ─── */
.hero {
  /* Tunable effect values (js/tune.js edits these live; defaults are the shipped look) */
  --grain-light: 0;  /* 2026-10-21 사용자 확정값: 노이즈 끔 */
  --grain-dark: 0;
  --wave-period: 1.5; /* multiplier on every band's duration: 0.5 = twice as fast */
  --wave-blur: 40px;
  --wave-opacity: 0.5;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding: var(--space-6) var(--gutter) var(--space-8);
  color: var(--white);
  background-color: var(--brand);
  background-image: linear-gradient(
    100deg,
    #e3ddfb 0%,
    #c9bffd 16%,
    #a593ff 34%,
    #917eff 50%,
    #8a86f4 62%,
    #8fc4ec 76%,
    #8fd8e8 88%,
    #7df3e1 100%
  );
  overflow: hidden;
}

/* Film grain, two layers so it reads on both the light and the saturated areas:
 *  ::before — bright speckles (noise luminance → alpha, white, screen blend)
 *  ::after  — dark speckles  (noise luminance → alpha, black, multiply blend)
 * Tile frequencies are low enough that a speckle is ~2 CSS px, so it stays visible on 2x/3x screens. */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  pointer-events: none;
}
.hero::before {
  opacity: var(--grain-light);
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR type='linear' slope='2.6' intercept='-1.05'/></feComponentTransfer><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  1 0 0 0 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}
.hero::after {
  opacity: var(--grain-dark);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR type='linear' slope='2.6' intercept='-1.15'/></feComponentTransfer><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  1 0 0 0 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 260px 260px;
}

/* Soft vignette (on the wave layer, under the grain) so the type stays readable at the edges. */
.hero-drift::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(231, 229, 250, 0) 86%, rgba(231, 229, 250, 0.85) 100%),
    radial-gradient(120% 90% at 50% 40%, rgba(60, 40, 170, 0) 55%, rgba(60, 40, 170, 0.22) 100%);
}

/* Nav */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  width: min(100%, 1680px);
  margin-inline: auto;
  padding-inline: clamp(0px, 1vw, 24px);
}
.nav-links {
  display: flex;
  gap: clamp(1.5rem, 3vw, 3rem);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--white);
  text-shadow: 0 1px 10px rgba(60, 40, 170, 0.45);
}
.nav-links a {
  padding: var(--space-2) 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--duration-fast);
}
.nav-links a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}
.hero .brand-word {
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.9);
}
.nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-4);
}

/* Body */
.hero-body {
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding-block: clamp(2rem, 6vh, 5rem);
}
.hero-logo {
  width: clamp(64px, 5vw + 32px, 96px);
  height: auto;
  margin-bottom: clamp(1.25rem, 3vh, 2.25rem);
  border-radius: 24%;
  box-shadow:
    0 24px 48px -16px rgba(30, 22, 90, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.5);
}
.hero-eyebrow {
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 12px rgba(80, 60, 200, 0.25);
}
.hero-title {
  margin-top: clamp(0.75rem, 2vh, 1.5rem);
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--mint);
  text-shadow: 0 2px 24px rgba(60, 40, 170, 0.25);
  text-wrap: balance;
}
.hero-title__line {
  display: block;
}
.hero-title__line--soft {
  color: var(--mint);
  opacity: 0.92;
}
.hero-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6) var(--space-8);
  margin-top: clamp(2rem, 6vh, 4.5rem);
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--white);
}
.link-arrow .icon {
  transition: transform var(--duration-fast) var(--ease-out-expo);
}
.link-arrow:hover .icon {
  transform: translateX(4px);
}

/* Bottom facts strip */
.hero-facts {
  text-shadow: 0 1px 10px rgba(60, 40, 170, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: var(--text-lg);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}
.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) clamp(1.25rem, 3vw, 3rem);
  border-left: 1px solid var(--border-on-dark);
}
.hero-facts li:first-child {
  border-left: 0;
}
.hero-facts .icon {
  width: 1.6em;
  height: 1.6em;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .nav {
    grid-template-columns: auto 1fr;
  }
  .nav-links {
    display: none;
  }
}
@media (min-width: 641px) and (max-width: 900px) {
  .hero-facts {
    font-size: var(--text-base);
  }
  .hero-facts li {
    padding-inline: clamp(0.75rem, 2vw, 1.25rem);
    gap: var(--space-2);
  }
}
@media (max-width: 640px) {
  .hero {
    padding-top: var(--space-4);
  }
  .nav-actions .btn {
    display: none;
  }
  .nav {
    gap: var(--space-2);
  }
  .hero-title {
    letter-spacing: -0.02em;
  }
  .hero-ctas {
    flex-direction: column;
    gap: var(--space-5);
  }
  .hero-ctas .btn--lg {
    width: 100%;
  }
  .hero-facts {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-inline: auto;
    width: min(100%, 320px);
  }
  .hero-facts li {
    justify-content: center;
    padding-block: var(--space-3);
    border-left: 0;
    border-top: 1px solid var(--border-on-dark);
  }
  .hero-facts li:first-child {
    border-top: 0;
  }
}
@media (max-width: 400px) {
  .nav .brand-word {
    display: none;
  }
}

/* ─── Wave motion: tilted colour bands sweeping across the hero (transform-only, compositor friendly).
 * Deliberately bold: narrow bands, light blur, wide travel, 5–7.5s periods — the motion must be obvious. ─── */
.hero-drift {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.hero-drift i {
  position: absolute;
  display: block;
  width: 30vmax;
  height: 170vmax;
  top: -35vmax;
  border-radius: 50%;
  filter: blur(var(--wave-blur));
  opacity: var(--wave-opacity);
  will-change: transform;
  transform-origin: 50% 50%;
  mix-blend-mode: screen;
}
.hero-drift i:nth-child(1) {
  --tilt: 9deg;
  --bob: 1;
  left: -6%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
  animation: heroWave calc(6s * var(--wave-period)) cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
.hero-drift i:nth-child(2) {
  --tilt: 24deg;
  --bob: -1.4;
  left: 28%;
  mix-blend-mode: normal;
  background: linear-gradient(90deg, rgba(85, 63, 221, 0) 0%, rgba(85, 63, 221, 0.95) 50%, rgba(85, 63, 221, 0) 100%);
  animation: heroWave calc(7.5s * var(--wave-period)) cubic-bezier(0.45, 0, 0.55, 1) infinite alternate-reverse;
}
.hero-drift i:nth-child(3) {
  --tilt: -12deg;
  --bob: 1.8;
  left: 56%;
  background: linear-gradient(90deg, rgba(125, 243, 225, 0) 0%, rgba(125, 243, 225, 1) 50%, rgba(125, 243, 225, 0) 100%);
  animation: heroWave calc(5.5s * var(--wave-period)) cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
  animation-delay: -3s;
}
.hero-drift i:nth-child(4) {
  --tilt: 17deg;
  --bob: -1;
  left: 76%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(214, 250, 255, 0.95) 50%, rgba(255, 255, 255, 0) 100%);
  animation: heroWave calc(5s * var(--wave-period)) cubic-bezier(0.45, 0, 0.55, 1) infinite alternate-reverse;
  animation-delay: -2s;
}
/* Each band leans at its own angle (--tilt) and bobs vertically by its own amount (--bob),
 * so the four never line up into parallel stripes. */
@keyframes heroWave {
  0% { transform: translate3d(-26vw, calc(-4vh * var(--bob)), 0) rotate(calc(var(--tilt) - 4deg)) scaleX(0.7); }
  50% { transform: translate3d(0, calc(5vh * var(--bob)), 0) rotate(calc(var(--tilt) + 5deg)) scaleX(1.3); }
  100% { transform: translate3d(28vw, calc(-3vh * var(--bob)), 0) rotate(calc(var(--tilt) - 2deg)) scaleX(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-drift i {
    animation: none;
  }
}

/* ─── Effect tuner (dev aid; shown on localhost or with ?tune=1) ─── */
.tune-toggle {
  position: absolute;
  left: var(--gutter);
  bottom: var(--space-6);
  z-index: 5;
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-pill);
  background: rgba(20, 16, 50, 0.45);
  color: var(--white);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tune-toggle:hover {
  background: rgba(20, 16, 50, 0.6);
}
html[data-tune] .tune-toggle {
  display: inline-flex;
}
.tune-panel {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--space-6) + 52px);
  z-index: 6;
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-radius: var(--radius-xl);
  background: rgba(20, 16, 50, 0.78);
  color: var(--white);
  box-shadow: 0 24px 48px -16px rgba(20, 10, 80, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: var(--text-sm);
}
.tune-panel h2 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.tune-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
}
.tune-row label {
  font-weight: 500;
}
.tune-row output {
  font-variant-numeric: tabular-nums;
  color: var(--mint);
}
.tune-row select {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-on-dark);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font: inherit;
  font-size: var(--text-sm);
}
.tune-row select option {
  color: var(--ink);
}
.tune-row input[type='range'] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--mint);
}
.tune-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.tune-actions button {
  flex: 1;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.tune-actions button:hover {
  background: rgba(255, 255, 255, 0.22);
}
.tune-actions button.is-done {
  background: var(--mint);
  color: var(--ink);
}
@media (max-width: 900px) {
  /* Keep the dev toggle clear of the facts strip: top-right, under the nav. */
  .tune-toggle {
    left: auto;
    right: var(--gutter);
    top: 96px;
    bottom: auto;
  }
  .tune-panel {
    left: auto;
    right: var(--gutter);
    top: 144px;
    bottom: auto;
  }
}

/* ─── Pointer text trail (js/text-cursor.js): stamps of "MOHE" in each script, under the content ─── */
.hero > .nav,
.hero > .hero-body,
.hero > .hero-facts {
  position: relative;
  z-index: 1;
}
.text-cursor__layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  line-height: 1;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 18px rgba(60, 40, 170, 0.35);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.text-cursor__item {
  position: absolute;
  top: 0;
  left: 0;
  white-space: pre;
  will-change: transform, opacity;
}
