:root {
  --bg: #000;
  --surface: #121214;
  --surface-2: #1b1b1f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #8b8b95;
  --accent: #f04452;
  --accent-2: #ff6b76;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* red light that slowly drifts behind the hero */
.glow {
  position: fixed;
  top: -20vh;
  left: 50%;
  width: 900px;
  height: 900px;
  max-width: 160vw;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(240, 68, 82, 0.28), transparent 62%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateX(-58%) scale(1); }
  to   { transform: translateX(-42%) scale(1.12); }
}

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px max(16px, calc((100vw - 1040px) / 2));
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.top.scrolled {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-color: var(--line);
}
.brand { color: var(--text); font-size: 22px; font-weight: 800; text-decoration: none; letter-spacing: -0.03em; }
.top nav { display: flex; gap: 4px; }
.top nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.top nav a:hover { color: var(--text); background: var(--surface-2); }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* hero */
.hero {
  min-height: calc(100svh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0 80px;
  position: relative;
}
.eyebrow { color: var(--accent); font-weight: 700; font-size: 15px; margin: 0 0 16px; }
.hero h1 {
  margin: 0;
  font-size: clamp(48px, 11vw, 112px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.line > .rise { display: inline-block; }
.accent {
  background: linear-gradient(100deg, var(--accent) 20%, var(--accent-2) 60%, var(--accent) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero.ready .accent { animation: shine 4s ease-in-out 1.2s infinite; }
@keyframes shine { 50% { background-position: 100% 0; } }

.sub { color: var(--muted); font-size: clamp(17px, 2.4vw, 21px); margin: 24px 0 36px; font-weight: 500; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  padding: 15px 26px;
  border-radius: 16px;
  transition: background 0.2s, transform 0.25s var(--spring), box-shadow 0.3s;
}
.pill.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 30px rgba(240, 68, 82, 0.35); }
.pill.primary:hover { background: var(--accent-2); box-shadow: 0 10px 40px rgba(240, 68, 82, 0.5); }
.pill.ghost { background: var(--surface-2); color: var(--text); }
.pill.ghost:hover { background: #26262b; }

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
}
.scroll-hint span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

/* entrance: rises once on load, staggered by --d */
.rise {
  opacity: 0;
  transform: translateY(40px);
  animation: rise 0.9s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 0.09s + 0.1s);
}
.line > .rise { transform: translateY(105%); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* scroll reveal, toggled by script.js */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--stagger, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* press feedback like a native app */
.press { -webkit-tap-highlight-color: transparent; }
.press:active { transform: scale(0.96); transition-duration: 0.1s; }

/* product sections */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 48px;
  align-items: start;
  padding: 100px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 60px;
}
.intro { position: sticky; top: 110px; }
.icon {
  display: block;
  border-radius: 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 40px rgba(240, 68, 82, 0.25);
  transition: transform 0.5s var(--spring);
}
.product:hover .icon { transform: rotate(-6deg) scale(1.05); }
.chip {
  display: inline-block;
  background: rgba(240, 68, 82, 0.14);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.product h2 { font-size: clamp(36px, 6vw, 56px); margin: 10px 0 12px; letter-spacing: -0.04em; line-height: 1.1; }
.intro p { color: var(--muted); font-size: 18px; margin: 0; font-weight: 500; }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.features li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), background 0.25s, border-color 0.25s;
}
.features li.in:hover { background: var(--surface-2); border-color: rgba(240, 68, 82, 0.35); transform: translateY(-3px); }
.features b { display: block; font-size: 18px; margin-bottom: 4px; }
.features span { color: var(--muted); font-size: 15px; }

.download {
  grid-column: 2;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  padding: 22px 26px;
  box-shadow: 0 10px 36px rgba(240, 68, 82, 0.3);
  transition: opacity 0.8s var(--ease), transform 0.25s var(--spring), background 0.2s, box-shadow 0.3s;
}
.download:hover { background: var(--accent-2); box-shadow: 0 14px 48px rgba(240, 68, 82, 0.5); }
.download.in:hover { transform: translateY(-2px); }
.download .label { font-weight: 800; font-size: 19px; }
.download .meta { font-size: 14px; opacity: 0.85; font-weight: 600; white-space: nowrap; }
.download::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  transform: translateX(-100%);
}
.download:hover::after { transform: translateX(100%); transition: transform 0.8s var(--ease); }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple 0.6s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* steps */
.steps { padding: 100px 0 120px; border-top: 1px solid var(--line); }
.steps h2 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 32px; letter-spacing: -0.04em; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.num {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(240, 68, 82, 0.14);
  color: var(--accent-2);
  font-weight: 800;
}
.steps b { display: block; font-size: 17px; }
.steps li span:not(.num) { color: var(--muted); font-size: 15px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 16px 48px; border-top: 1px solid var(--line); }

/* toast pops up from the bottom */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, calc(100% + 40px));
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s var(--spring);
  white-space: nowrap;
  z-index: 20;
}
.toast.show { transform: translate(-50%, 0); }
.toast::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: 8px; }

/* feature preview: a small animated mock of the hovered feature */
.features li { cursor: default; outline: none; }
.features li.active { background: var(--surface-2); border-color: rgba(240, 68, 82, 0.5); }

.preview {
  position: relative;
  margin-top: 36px;
  aspect-ratio: 16 / 10;
  max-width: 400px;
  border-radius: 22px;
  background: linear-gradient(160deg, #18181c, #0d0d10);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.4s;
}
.preview.showing { border-color: rgba(240, 68, 82, 0.35); box-shadow: 0 20px 60px rgba(240, 68, 82, 0.18); }
.intro .preview .hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 14px;
  color: #55555f;
  transition: opacity 0.3s;
}
.preview.showing .hint { opacity: 0; }

.scene {
  position: absolute;
  inset: 0;
  padding: 20px;
  opacity: 0;
  transform: scale(0.96) translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
  font-size: 13px;
}
.scene.on { opacity: 1; transform: none; }
.scene .pop { opacity: 0; }
.scene.on .pop { animation: pop 0.55s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.92); } to { opacity: 1; transform: none; } }

.bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.scene.on .bar i { animation: grow 0.9s var(--ease) 0.35s forwards; }
@keyframes grow { to { width: var(--w); } }

/* launcher: profiles */
.win { display: flex; gap: 12px; height: 100%; }
.side { width: 38%; display: flex; flex-direction: column; gap: 6px; }
.pf { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.pf i { width: 8px; height: 8px; border-radius: 50%; background: #3a3a42; }
.pf small { margin-left: auto; font-size: 11px; color: #5c5c66; }
.pf.on { background: rgba(240, 68, 82, 0.14); color: var(--text); }
.pf.on i { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.main { flex: 1; display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, 0.03); border-radius: 12px; padding: 12px; }
.main b { font-size: 16px; }
.mods { display: flex; flex-wrap: wrap; gap: 6px; }
.mods span { background: var(--surface-2); border: 1px solid var(--line); padding: 4px 9px; border-radius: 8px; font-size: 12px; }
.play { margin-top: auto; align-self: flex-start; background: var(--accent); color: #fff; font-weight: 700; padding: 7px 14px; border-radius: 10px; }

/* launcher: snapshots */
.rows { display: flex; flex-direction: column; justify-content: center; gap: 12px; height: 100%; }
.row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; }
.row b { font-size: 12px; font-weight: 600; color: var(--muted); }
.saved { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: rgba(240, 68, 82, 0.12); color: var(--muted); }
.saved b { color: var(--accent-2); }

/* launcher: branch switch */
[data-scene="nl-branch"] { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; }
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 80px); background: var(--surface-2); border-radius: 14px; padding: 4px; }
.seg span:not(.knob) { position: relative; text-align: center; padding: 10px 0; font-weight: 700; color: var(--text); }
.knob { position: absolute; top: 4px; left: 4px; width: 80px; height: calc(100% - 8px); border-radius: 10px; background: var(--accent); }
.scene.on .knob { animation: slide 2.4s var(--ease) 0.4s infinite; }
@keyframes slide { 0%, 25% { transform: none; } 45%, 80% { transform: translateX(80px); } 100% { transform: none; } }
.pending { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.pending i { width: 8px; height: 8px; border-radius: 50%; background: #f5a524; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* launcher: empty state */
[data-scene="nl-empty"] { display: grid; place-items: center; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 36px; border: 1.5px dashed #33333b; border-radius: 16px; color: var(--muted); }
.plus { background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 12px; }
.scene.on .plus { animation: pulse 1.6s ease-in-out 0.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 68, 82, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(240, 68, 82, 0); } }

/* tweaks: result screen */
[data-scene="nt-result"] { display: grid; grid-template-columns: 42% 1fr; gap: 14px; }
.rank { position: relative; display: grid; place-items: center; }
.rank::before { content: ""; position: absolute; inset: 22% -30%; background: var(--accent); transform: skewY(-12deg); opacity: 0.9; }
.stamp { position: relative; font-size: 64px; font-weight: 900; font-style: italic; letter-spacing: -0.05em; text-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); opacity: 0; }
.scene.on .stamp { animation: stamp 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) 0.15s both; }
@keyframes stamp { from { opacity: 0; transform: scale(2.4) rotate(-8deg); } to { opacity: 1; transform: none; } }
.rank small { position: absolute; bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: var(--accent-2); }
.judge { display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.judge > b { font-size: 24px; letter-spacing: -0.03em; margin-bottom: 2px; }
.jr { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; }
.jr em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); }
.jr.dim { opacity: 0.4; }

/* tweaks: editor */
[data-scene="nt-edit"] { display: flex; gap: 10px; padding: 14px; }
.tools { display: flex; flex-direction: column; gap: 5px; }
.tools i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.tools i.on { background: var(--accent); color: #fff; }
.canvas { position: relative; flex: 1; border-radius: 10px; background: #1d1414; overflow: hidden; }
.ruler { position: absolute; inset: 0 0 auto; height: 12px; background: repeating-linear-gradient(90deg, #3a3a42 0 1px, transparent 1px 10px) #141418; }
.sel { position: absolute; left: 22%; top: 40%; padding: 8px 12px; border: 1.5px solid var(--accent); font-weight: 800; font-size: 14px; }
.scene.on .sel { animation: drag 2.6s var(--ease) 0.3s infinite; }
@keyframes drag { 0%, 15% { transform: none; } 50%, 75% { transform: translate(30px, -16px); } 100% { transform: none; } }
.sel i { position: absolute; width: 7px; height: 7px; background: #fff; border: 1.5px solid var(--accent); }
.h1 { left: -4px; top: -4px; } .h2 { right: -4px; top: -4px; } .h3 { left: -4px; bottom: -4px; } .h4 { right: -4px; bottom: -4px; }
.guide { position: absolute; top: 12px; bottom: 0; left: 50%; border-left: 1px dashed rgba(240, 68, 82, 0.6); opacity: 0; }
.scene.on .guide { animation: guide 2.6s linear 0.3s infinite; }
@keyframes guide { 0%, 40% { opacity: 0; } 50%, 75% { opacity: 1; } 85%, 100% { opacity: 0; } }
.layers { display: flex; flex-direction: column; gap: 4px; width: 72px; }
.layers em { font-style: normal; font-size: 11px; padding: 6px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.layers em.on { background: rgba(240, 68, 82, 0.18); color: var(--text); }

/* tweaks: sources and default layout share a fake game stage */
.stage { position: relative; height: 100%; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 30% 60%, #3a1418, #120c0e 70%); }
.stage::after { content: ""; position: absolute; left: 10%; right: 10%; top: 58%; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent); }
.cam { position: absolute; right: 10px; top: 10px; width: 34%; aspect-ratio: 4 / 3; border-radius: 10px; background: #26262c; border: 1.5px solid rgba(255, 255, 255, 0.15); overflow: hidden; }
.face { position: absolute; left: 50%; bottom: -20%; width: 56%; aspect-ratio: 1; margin-left: -28%; border-radius: 50%; background: #3a3a42; }
.face::before { content: ""; position: absolute; left: 30%; top: -42%; width: 40%; aspect-ratio: 1; border-radius: 50%; background: #3a3a42; }
.cam small { position: absolute; left: 6px; top: 4px; font-size: 9px; font-weight: 800; color: var(--muted); }
.img { position: absolute; left: 10px; top: 10px; width: 46px; height: 46px; border-radius: 10px; background: url(assets/nowtweaks.png) center / cover; }
.chat { position: absolute; left: 10px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.chat span { background: rgba(0, 0, 0, 0.55); padding: 5px 9px; border-radius: 9px; font-size: 11px; }
.rec { position: absolute; right: 10px; bottom: 12px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.55); padding: 5px 9px; border-radius: 9px; }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s ease-in-out infinite; }

.prog { position: absolute; left: 10px; right: 10px; top: 10px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); }
.scene.on .prog i { animation: grow-full 3s linear 0.4s infinite; }
@keyframes grow-full { to { width: 100%; } }
.acc { position: absolute; right: 12px; top: 22px; font-size: 15px; }
.combo { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); text-align: center; font-size: 30px; font-weight: 900; line-height: 1; }
.scene.on .combo { animation: pop 0.55s var(--spring) 0.22s both, beat 0.5s ease-out 1s infinite; }
@keyframes beat { 0% { scale: 1.08; } 100% { scale: 1; } }
.combo small { display: block; font-size: 10px; letter-spacing: 0.15em; color: var(--muted); }
.keys { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; }
.keys i { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid rgba(255, 255, 255, 0.2); }
.scene.on .keys i.hit { animation: hit 0.5s steps(1) infinite; }
.scene.on .keys i.hit + i + i.hit { animation-delay: 0.25s; }
@keyframes hit { 50% { background: var(--accent); border-color: var(--accent); } }

@media (max-width: 760px) {
  .top nav a { padding: 8px; font-size: 13px; }
  .product { grid-template-columns: 1fr; padding: 72px 0; }
  .intro { position: static; }
  .download { grid-column: 1; }
  .steps ol { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise, .line > .rise, .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
