:root {
  --bg: #06070b;
  --ink: #eef0f7;
  --ink-2: #a4a9bd;
  --ink-3: #6d7288;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --panel: rgba(16, 18, 28, .52);
  --accent: #a193ff;
  --mint: #5cf2c4;
  --amber: #ffb86b;
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(20px, 5vw, 72px);
  --maxw: 1240px;
  --hero-p: 0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
::selection { background: rgba(161, 147, 255, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  transition: top .3s var(--ease);
}
.skip:focus { top: 16px; }

/* ---------- Background layers ---------- */
#gl {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 1.6s var(--ease);
}
.is-ready #gl { opacity: 1; }
.atmos {
  position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 78% 38%, rgba(120, 100, 255, .16), transparent 70%),
    radial-gradient(35% 30% at 12% 85%, rgba(60, 220, 180, .07), transparent 70%),
    radial-gradient(60% 50% at 50% 0%, rgba(40, 50, 110, .25), transparent 70%),
    var(--bg);
}
html:not(.has-gl) .atmos {
  background:
    radial-gradient(28% 28% at 72% 36%, rgba(161, 147, 255, .45), transparent 70%),
    radial-gradient(35% 30% at 12% 85%, rgba(60, 220, 180, .1), transparent 70%),
    var(--bg);
}
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .footer { position: relative; z-index: 1; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; z-index: 40;
  top: max(14px, env(safe-area-inset-top)); left: 50%;
  translate: -50% 0;
  width: min(calc(100% - 28px), var(--maxw));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 10px 18px;
  border: 1px solid transparent; border-radius: 999px;
  transition: background .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s, padding .5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(10, 11, 18, .58);
  border-color: var(--line);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .14em; font-size: 13px; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.brand svg circle { fill: currentColor; stroke: none; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2);
  transition: color .3s, background .3s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.nav-links a.is-current { color: var(--ink); }
.nav-links a.is-current::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent);
}
.nav-gh {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 14px;
  transition: background .3s, transform .5s var(--ease);
}
.nav-gh:hover { background: rgba(255, 255, 255, .11); }
.nav-gh svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(120px + env(safe-area-inset-top)) var(--pad) 64px;
  display: grid; grid-template-rows: 1fr auto; align-items: center;
}
.hero-copy {
  max-width: 820px;
  opacity: calc(1 - var(--hero-p) * 1.3);
  transform: translate3d(0, calc(var(--hero-p) * -60px), 0);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  font-size: 13px; color: var(--ink-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(92, 242, 196, .6); animation: ping 2.4s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(92, 242, 196, 0); } 100% { box-shadow: 0 0 0 0 rgba(92, 242, 196, 0); } }

.hero-title {
  margin: 0; font-weight: 700;
  font-size: clamp(46px, 8.4vw, 112px);
  line-height: 1.02; letter-spacing: -0.045em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); transition: transform 1.3s var(--ease); }
.hero-title .line:nth-child(2) > span { transition-delay: .12s; }
.is-ready .hero-title .line > span { transform: none; }
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, #c9c2ff 0%, var(--accent) 35%, var(--mint) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin: 28px 0 0; max-width: 30ch;
  font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-2); line-height: 1.55;
}
.br-m { display: none; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero-sub, .hero-cta, .eyebrow { opacity: 0; translate: 0 18px; transition: opacity 1s var(--ease), translate 1s var(--ease); }
.is-ready .eyebrow { opacity: 1; translate: 0 0; transition-delay: .05s; }
.is-ready .hero-sub { opacity: 1; translate: 0 0; transition-delay: .35s; }
.is-ready .hero-cta { opacity: 1; translate: 0 0; transition-delay: .5s; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background .3s, border-color .3s, box-shadow .4s, transform .5s var(--ease);
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--ink); color: #0b0c12; box-shadow: 0 10px 40px -10px rgba(161, 147, 255, .6); }
.btn-primary:hover { box-shadow: 0 14px 50px -8px rgba(161, 147, 255, .85); }
.btn-ghost { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .07); }

.hero-stats {
  display: flex; gap: clamp(24px, 5vw, 64px); margin: 0; padding-top: 28px;
  border-top: 1px solid var(--line);
  opacity: calc(1 - var(--hero-p) * 1.6);
}
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.hero-stats dt { font-size: 13px; color: var(--ink-3); }
.hero-stats dd { margin: 0; font-size: 30px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-stats dd.small { font-size: 17px; line-height: 45px; font-weight: 550; letter-spacing: -0.01em; color: var(--ink-2); }

.scroll-cue {
  position: absolute; right: var(--pad); bottom: 64px;
  width: 28px; height: 46px; border: 1.5px solid var(--line-2); border-radius: 999px;
  opacity: calc(1 - var(--hero-p) * 3);
}
.scroll-cue span {
  position: absolute; left: 50%; top: 9px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 3px; background: var(--ink); animation: cue 2s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(16px); } }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(96px, 14vw, 180px) var(--pad) 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.kicker {
  margin: 0 0 14px; font-size: 13px; letter-spacing: .08em; color: var(--ink-3);
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
}
.section h2 {
  margin: 0; font-size: clamp(36px, 5.4vw, 68px); line-height: 1.08; letter-spacing: -0.04em; font-weight: 700;
}
.section-sub { margin: 18px 0 0; color: var(--ink-2); font-size: 17px; max-width: 46ch; }

[data-reveal] { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
  color: var(--ink-2); font-size: 14px; font-weight: 550;
  transition: color .3s, background .3s, border-color .3s;
}
.filter i { width: 7px; height: 7px; border-radius: 50%; }
.filter:hover { color: var(--ink); border-color: var(--line-2); }
.filter[aria-pressed="true"] { color: #0b0c12; background: var(--ink); border-color: var(--ink); }

/* ---------- Cards ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
}
.card { grid-column: span 4; position: relative; perspective: 900px; }
.card.is-featured { grid-column: span 6; }
.card.is-hidden { display: none; }
.card {
  opacity: 0; transform: translate3d(0, 40px, 0);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(min(var(--i), 6) * 60ms);
}
.card.is-in { opacity: 1; transform: none; }
.card-inner {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  padding: 26px 26px 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 24, 36, .62), rgba(12, 13, 20, .58));
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .6s var(--ease), border-color .4s;
  overflow: hidden;
}
.card-inner::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 16%, transparent), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
.card:hover .card-inner { border-color: color-mix(in srgb, var(--c) 40%, transparent); transition: transform .15s linear, border-color .4s; }
.card:hover .card-inner::before { opacity: 1; }
.card-glow {
  position: absolute; inset: 20% 10% -6%; z-index: -1; border-radius: 50%;
  background: var(--c); filter: blur(60px); opacity: 0; transition: opacity .6s;
}
.card:hover .card-glow { opacity: .14; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.card-cat { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.card-cat i { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.card-meta { display: flex; align-items: center; gap: 10px; }
.chip-mini {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; color: var(--ink-2);
  padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
}
.stars { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stars svg { width: 13px; height: 13px; fill: var(--amber); }
.stars b { font-weight: 600; }

.card-title { margin: 0 0 10px; font-size: 25px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; }
.is-featured .card-title { font-size: clamp(28px, 3vw, 36px); }
.card-summary { margin: 0; color: var(--ink); opacity: .86; font-size: 15.5px; }
.card-detail { margin: 10px 0 0; color: var(--ink-3); font-size: 14px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; padding: 0; list-style: none; }
.card-tags li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.card-tags li i { width: 8px; height: 8px; border-radius: 50%; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 24px; }
.card-link {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; background: var(--ink); color: #0b0c12;
  transition: background .3s, color .3s, border-color .3s;
}
.card-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.card-link:hover svg { transform: translate(2px, -2px); }
.card-link.is-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.card-link.is-ghost:hover { border-color: var(--c); color: var(--c); }

/* ---------- Approach ---------- */
.principles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.principles li {
  position: relative; padding: 30px 28px 32px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.principles li:nth-child(2) { transition-delay: .1s; }
.principles li:nth-child(3) { transition-delay: .2s; }
.p-num {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 40px; border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; color: var(--ink);
  background: linear-gradient(135deg, rgba(161, 147, 255, .35), rgba(92, 242, 196, .18));
  border: 1px solid var(--line-2);
}
.principles h3 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.025em; }
.principles p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---------- Playground ---------- */
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.play-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px;
  padding: 18px 26px 18px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color .4s, background .4s, opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.play-card:nth-child(2) { transition-delay: .1s; }
.play-card:hover { border-color: var(--line-2); background: rgba(24, 26, 40, .6); }
.play-visual {
  width: 88px; height: 88px; border-radius: 16px; display: grid; place-items: center; position: relative; overflow: hidden;
  border: 1px solid var(--line);
}
.play-updown { background: radial-gradient(circle at 30% 20%, rgba(255, 184, 107, .35), rgba(255, 184, 107, .04) 70%); }
.play-updown b { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; }
.play-updown i { position: absolute; right: 12px; font-style: normal; font-size: 13px; color: var(--amber); }
.play-updown i:nth-of-type(1) { top: 14px; }
.play-updown i:nth-of-type(2) { bottom: 14px; opacity: .5; }
.play-code { background: radial-gradient(circle at 30% 20%, rgba(92, 242, 196, .3), rgba(92, 242, 196, .03) 70%); gap: 0; align-content: center; }
.play-code code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; color: var(--mint); }
.play-body { display: flex; flex-direction: column; gap: 4px; }
.play-body strong { font-size: 19px; letter-spacing: -0.02em; }
.play-body span { color: var(--ink-2); font-size: 14.5px; }
.play-arrow { font-size: 22px; color: var(--ink-3); transition: transform .5s var(--ease), color .3s; }
.play-card:hover .play-arrow { transform: translateX(6px); color: var(--ink); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(80px, 12vw, 160px); }
.contact-inner {
  position: relative; overflow: hidden;
  padding: clamp(40px, 7vw, 88px);
  border-radius: calc(var(--radius) + 12px);
  border: 1px solid var(--line-2);
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(161, 147, 255, .22), transparent 60%),
    radial-gradient(50% 80% at 0% 100%, rgba(92, 242, 196, .1), transparent 60%),
    rgba(12, 13, 20, .6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.contact h2 { font-size: clamp(40px, 7vw, 92px); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
#copy-mail.is-done { background: var(--mint); }
.socials { list-style: none; margin: 48px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 48px; }
.socials a { display: flex; flex-direction: column; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; transition: color .3s; }
.socials a span { font-size: 13.5px; color: var(--ink-3); font-weight: 450; letter-spacing: 0; }
.socials a:hover { color: var(--accent); }

.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 28px var(--pad) calc(36px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; color: var(--ink-3); font-size: 13.5px;
  border-top: 1px solid var(--line);
}
.footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .card, .card.is-featured { grid-column: span 6; }
  .principles { grid-template-columns: 1fr; }
  .p-num { margin-bottom: 22px; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-gh span { display: none; }
  .nav-gh { padding: 10px; }
  .hero { align-items: end; padding-top: 46svh; padding-bottom: 36px; }
  .hero-copy { max-width: none; }
  .eyebrow { margin-bottom: 20px; }
  .hero-sub { margin-top: 20px; }
  .br-m { display: inline; }
  .hero-cta { margin-top: 28px; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .hero-stats { margin-top: 36px; gap: 22px; }
  .hero-stats dd { font-size: 24px; }
  .hero-stats dd.small { font-size: 14px; line-height: 36px; }
  .scroll-cue { display: none; }
  .filters { gap: 6px; }
  .filter { height: 36px; padding: 0 13px; font-size: 13.5px; }
  .grid { grid-template-columns: 1fr; }
  .card, .card.is-featured { grid-column: auto; }
  .card-inner { padding: 22px 20px 20px; }
  .play-grid { grid-template-columns: 1fr; }
  .play-card { grid-template-columns: auto 1fr; padding: 14px 18px 14px 14px; gap: 16px; }
  .play-visual { width: 68px; height: 68px; }
  .play-arrow { display: none; }
  .contact-actions .btn { width: 100%; justify-content: center; }
  .contact-actions .btn-ghost { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}
