/* Loopin 회사 첫 화면 (loopin.work)
   디자인 방향(ui-ux-pro-max 추천 참고): 스크롤 스토리텔링 + 벤토 그리드, 모션 중심이지만 가볍게.
   검정 바탕 + 흰 CTA, Loopin 그라데이션은 강조에만. 아이콘은 이모지 대신 SVG.
   성능: 화면 전체 크기 요소에 blur·blend 금지, 끝없이 반복되는 애니메이션 없음, 움직임은 transform/opacity 만. */
:root {
  --bg: #07070b;
  --card: #0f0f16;
  --card-2: #16161f;
  --border: #26262f;
  --border-hi: #3f3f4a;
  --fg: #fafafa;
  --muted: #a1a1aa;       /* --bg 위 대비 약 7.6:1 */
  --cta: #f8fafc;
  --on-cta: #0f172a;
  --ring: #c4b5fd;
  --grad: linear-gradient(100deg, #5b8cff 0%, #a855f7 45%, #ec4899 80%);
  --grad-text: linear-gradient(90deg, #7aa7ff 0%, #b98bff 50%, #f08fc8 100%);
  --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 180ms; --t-med: 260ms;
  --font: 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-num: 'Space Grotesk', var(--font);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a, button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 10px; }
[id] { scroll-margin-top: 96px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--cta); color: var(--on-cta); padding: 12px 18px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* 배경: 위쪽에만 은은한 빛 (고정 아님 → 스크롤 때 다시 그리지 않음) */
.glow { position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50% 60% at 18% 0%, rgba(91,140,255,.28), transparent 70%),
    radial-gradient(45% 55% at 90% 18%, rgba(168,85,247,.22), transparent 70%),
    radial-gradient(40% 40% at 55% 70%, rgba(236,72,153,.10), transparent 70%);
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.num { font-family: var(--font-num); font-feature-settings: 'tnum'; }

/* 상단 바 */
.nav-wrap { position: sticky; top: 0; z-index: 30; padding: 12px 0; }
.nav {
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: rgba(15,15,22,.92); border: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; margin-right: auto; min-height: 44px; }
.brand img { width: 26px; height: 26px; }
.nav .links { display: flex; gap: 2px; }
.nav .links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; transition: color var(--t-fast), background var(--t-fast); }
.nav .links a:hover { color: var(--fg); background: var(--card-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; border: 1px solid transparent; font-family: inherit;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast);
}
.btn svg { width: 18px; height: 18px; transition: transform var(--t-fast) var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.97); }
.btn.cta { background: var(--cta); color: var(--on-cta); }
.btn.cta:hover { background: #fff; }
.btn.ghost { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--border-hi); background: var(--card-2); }
.nav .btn { min-height: 44px; font-size: 15px; padding: 0 18px; }
@media (max-width: 760px) { .nav .links { display: none; } }

/* 히어로 */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 56px 0 32px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-num); font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #c9c2ff; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
.hero h1 { font-size: clamp(40px, 7.4vw, 80px); line-height: 1.08; letter-spacing: -.045em; font-weight: 800; margin: 20px 0; text-wrap: balance; }
.lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); margin: 0 0 28px; max-width: 32em; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 40px 0 0; padding: 0; list-style: none; }
.stats b { display: block; font-size: clamp(30px, 5vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 14px; }

/* 히어로 오른쪽: 게임 화면 세 장을 겹친 콜라주 */
.stack { position: relative; aspect-ratio: 1 / .82; }
.stack a { position: absolute; width: 66%; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border-hi); box-shadow: 0 24px 60px rgba(0,0,0,.55); transition: transform var(--t-med) var(--ease); }
.stack a:nth-child(1) { left: 0; top: 0; transform: rotate(-4deg); z-index: 1; }
.stack a:nth-child(2) { right: 0; top: 27%; transform: rotate(3deg); z-index: 2; }
.stack a:nth-child(3) { left: 8%; bottom: 0; transform: rotate(-1deg); z-index: 3; }
.stack a:hover { transform: rotate(0) translateY(-6px) scale(1.02); z-index: 4; }
.stack img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.stack .label { position: absolute; left: 10px; top: 10px; background: rgba(7,7,11,.86); color: var(--fg); font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .stack { max-width: 520px; width: 100%; margin: 0 auto; }
}

/* 챕터 머리 */
.chapter { padding-top: 88px; }
.ch-head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 8px 20px; margin-bottom: 24px; }
.ch-no { font-family: var(--font-num); font-size: 56px; font-weight: 700; line-height: .9; color: transparent; -webkit-text-stroke: 1px var(--border-hi); }
.ch-head h2 { font-size: clamp(26px, 4.4vw, 40px); font-weight: 800; letter-spacing: -.035em; line-height: 1.2; margin: 6px 0 0; }
.ch-head p { color: var(--muted); margin: 6px 0 0; }
.ch-head .btn { align-self: center; }
@media (max-width: 760px) {
  .ch-head { grid-template-columns: 1fr; }
  .ch-no { font-size: 40px; }
  .ch-head .btn { justify-self: start; }
}

/* 벤토 그리드 */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med);
}
.tile:hover { transform: translateY(-4px); border-color: var(--border-hi); }
.tile .media { overflow: hidden; background: var(--card-2); }
.tile .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.tile:hover .media img { transform: scale(1.04); }
.tile .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile h3 { font-size: 22px; letter-spacing: -.025em; margin: 0; line-height: 1.3; }
.tile p { color: var(--muted); font-size: 15px; margin: 0; }
.tile .meta { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.tile .meta .host { color: var(--muted); font-family: var(--font-num); }
.tile .meta .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.tile .meta .go svg { width: 18px; height: 18px; transition: transform var(--t-fast) var(--ease); }
.tile:hover .meta .go svg { transform: translateX(3px); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border); color: #d4d4d8; }

.t-room { grid-column: span 2; grid-row: span 2; }
.t-room .media { aspect-ratio: 16 / 10; }
.t-room h3 { font-size: 28px; }
.t-side { grid-column: span 2; flex-direction: row; }
.t-side .media { width: 48%; flex: none; }
.t-side .media img { aspect-ratio: auto; }
@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .t-room, .t-side { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .t-room, .t-side { grid-column: auto; }
  .t-side { flex-direction: column; }
  .t-side .media { width: 100%; aspect-ratio: 16 / 10; }
}

/* 웹 장난감: 실제 화면 6장 */
.toys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.toys a { display: block; text-decoration: none; border-radius: var(--r-md); overflow: hidden; background: var(--card); border: 1px solid var(--border); transition: transform var(--t-med) var(--ease), border-color var(--t-med); }
.toys a:hover { transform: translateY(-4px); border-color: var(--border-hi); }
.toys .media { aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.toys .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.toys a:hover .media img { transform: scale(1.04); }
.toys .cap { padding: 14px 16px 16px; }
.toys b { display: block; font-size: 17px; letter-spacing: -.02em; }
.toys span { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .toys { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .toys { grid-template-columns: 1fr; } }

/* 토스 미니앱 */
.toss { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; }
.toss .intro { padding: 28px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.toss .intro::before { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 70% at 0% 0%, rgba(168,85,247,.20), transparent 70%); pointer-events: none; }
.toss .intro > * { position: relative; }
.toss .intro h3 { font-size: 26px; letter-spacing: -.03em; margin: 0; line-height: 1.3; }
.toss .intro p { color: var(--muted); margin: 0; }
.toss .intro .btns { margin-top: auto; }
.note { font-size: 13px !important; }
.apps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0; padding: 18px; list-style: none; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border); }
.apps a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; min-height: 44px; border-radius: var(--r-sm); text-decoration: none; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.3; transition: background var(--t-fast), transform var(--t-fast) var(--ease); }
.apps a:hover { background: var(--card-2); transform: translateY(-2px); }
.apps img { width: 56px; height: 56px; border-radius: 15px; }
@media (max-width: 860px) { .toss { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .apps { grid-template-columns: repeat(3, 1fr); } }

/* 실험실 */
.lab { display: grid; grid-template-columns: 1.15fr 1fr; }
.lab .media img { aspect-ratio: 16 / 10; }
.lab .body { padding: clamp(22px, 4vw, 40px); justify-content: center; }
.lab h3 { font-size: clamp(24px, 3.6vw, 30px); }
@media (max-width: 760px) { .lab { grid-template-columns: 1fr; } }

/* 원칙 */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.values li { padding: 24px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); }
.values .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--border); color: #c9c2ff; }
.values .ic svg { width: 22px; height: 22px; }
.values b { display: block; font-size: 18px; margin: 16px 0 4px; letter-spacing: -.02em; }
.values span { color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .values { grid-template-columns: 1fr; } }

/* 마지막 CTA */
.finale { margin-top: 88px; text-align: center; padding: clamp(36px, 7vw, 72px) 20px; border-radius: 32px; position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.finale::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 50% 0%, rgba(168,85,247,.28), transparent 70%), radial-gradient(40% 60% at 85% 100%, rgba(236,72,153,.16), transparent 70%); pointer-events: none; }
.finale > * { position: relative; }
.finale h2 { font-size: clamp(30px, 6vw, 56px); letter-spacing: -.04em; line-height: 1.15; margin: 0 0 12px; font-weight: 800; }
.finale p { color: var(--muted); margin: 0 auto 28px; max-width: 28em; }
.finale .btns { justify-content: center; }
.finale .btn.cta { background: var(--grad); color: #fff; border: 0; }
.dice { transition: transform var(--t-med) var(--ease); }
.btn:hover .dice { transform: rotate(90deg); }

footer { margin: 64px 0 0; padding: 28px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 0 6px; }
footer nav a { text-decoration: none; padding: 10px 8px; min-height: 44px; display: inline-flex; align-items: center; }
footer nav a:hover { color: var(--fg); text-decoration: underline; }

/* 등장 효과: 아래에서 살짝 떠오르며, 같은 묶음 안에서는 차례로(--i). JS 가 .in 을 붙인다 */
.js .rv { opacity: 0; transform: translateY(20px) scale(.98); transition: opacity 500ms var(--ease), transform 500ms var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .rv.in { opacity: 1; transform: none; }
.js .stack.rv a { opacity: 0; transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.js .stack.rv a:nth-child(1) { transform: rotate(-10deg) translateY(30px); }
.js .stack.rv a:nth-child(2) { transform: rotate(10deg) translateY(30px); transition-delay: 90ms; }
.js .stack.rv a:nth-child(3) { transform: rotate(-6deg) translateY(40px); transition-delay: 180ms; }
.js .stack.rv.in a { opacity: 1; }
.js .stack.rv.in a:nth-child(1) { transform: rotate(-4deg); }
.js .stack.rv.in a:nth-child(2) { transform: rotate(3deg); }
.js .stack.rv.in a:nth-child(3) { transform: rotate(-1deg); }
.js .stack.rv.in a:hover { transform: rotate(0) translateY(-6px) scale(1.02); transition-delay: 0ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; transition-delay: 0ms !important; }
  .js .rv, .js .stack.rv a { opacity: 1 !important; }
}

/* 글 페이지 (소개·개인정보처리방침) */
.doc { max-width: 760px; margin: 0 auto; padding: 40px 0 0; }
.doc h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 800; letter-spacing: -.035em; line-height: 1.2; margin: 16px 0 12px; text-wrap: balance; }
.doc .sub { color: var(--muted); margin: 0 0 8px; }
.doc h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 40px 0 10px; padding-top: 20px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 17px; margin: 22px 0 6px; }
.doc p, .doc li { color: #e4e4e7; line-height: 1.8; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li + li { margin-top: 4px; }
.doc a { color: var(--ring); }
.doc strong { color: var(--fg); }
.doc .toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.doc .toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--fg); font-size: 14px; }
.doc .toc a:hover { border-color: var(--border-hi); }
.tbl { overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--r-sm); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); line-height: 1.6; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; }
.tbl td:first-child { white-space: nowrap; font-weight: 600; color: var(--fg); }
.box { padding: 18px 20px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); margin: 16px 0; }
.box p { margin: 0; }
.svc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; padding: 0; list-style: none; }
.svc-list li { margin: 0 !important; }
.svc-list a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 16px 18px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--fg); transition: border-color var(--t-fast); }
.svc-list a:hover { border-color: var(--border-hi); }
.svc-list b { font-size: 16px; }
.svc-list span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.svc-list .host { font-family: var(--font-num); font-size: 13px; color: #c9c2ff; }
@media (max-width: 560px) { .svc-list { grid-template-columns: 1fr; } }
.doc .svc-list, .doc .toc { padding-left: 0; }
