/* LifeBuddy main page (shared by main-page.html and main-page-ko.html) */
:root {
  --paper: #f3f1ec;
  --ink: #141414;
  --mute: rgba(20, 20, 20, 0.58);
  --line: rgba(20, 20, 20, 0.12);
  --tint: var(--paper);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pop: cubic-bezier(0.34, 1.45, 0.64, 1);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}
html[lang="ko"] {
  --serif: "Instrument Serif", "Noto Serif KR", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
html[lang="ko"] body { word-break: keep-all; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Header */
header.top { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 22px 4vw; mix-blend-mode: difference; color: #fff; }
header.top .logo { font-family: var(--serif); font-size: 1.7rem; }
header.top .right { display: flex; align-items: center; gap: 28px; }
header.top nav { display: flex; gap: 28px; font-size: 0.92rem; }
header.top nav a { position: relative; }
header.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease); }
header.top nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.lang { display: flex; border: 1px solid currentColor; border-radius: 999px; padding: 3px; font-size: 0.78rem; font-weight: 600; }
.lang a { padding: 4px 10px; border-radius: 999px; opacity: 0.7; }
.lang a.on { background: #fff; color: #000; opacity: 1; }

/* Hero: screenshots floating in 3D depth with pointer parallax */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.space { position: absolute; inset: 0; z-index: 1; perspective: 1400px; transform-style: preserve-3d; }
.poster { position: absolute; left: 0; top: 0; width: 190px; border-radius: 18px; overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.35); will-change: transform; }
.poster img { width: 100%; height: auto; }
.hero h1 { position: relative; z-index: 5; text-align: center; font-family: var(--serif); font-weight: 400; font-size: clamp(3.6rem, 10.5vw, 10.5rem); line-height: 0.88; letter-spacing: -0.03em; }
html[lang="ko"] .hero h1 { font-size: clamp(2.8rem, 8vw, 8rem); line-height: 1.14; letter-spacing: -0.05em; }
.hero h1 em { font-style: italic; }
html[lang="ko"] .hero h1 em { font-style: normal; background: linear-gradient(transparent 64%, #ffd51f 64%); }
.hero h1 .ln { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .ln > span { display: inline-block; transition: transform 1.2s var(--ease); }
.js .hero h1 .ln > span { transform: translateY(110%); }
.js .ready .hero h1 .ln > span { transform: none; }
.hero h1 .ln:nth-child(2) > span { transition-delay: 0.1s; }
.hero .under { position: absolute; z-index: 5; bottom: 6vh; left: 4vw; right: 4vw; display: flex; justify-content: space-between; align-items: end; gap: 24px; font-size: 0.95rem; }
.hero .under p { max-width: 26em; line-height: 1.55; }
.scrollcue { display: flex; align-items: center; gap: 10px; }
.scrollcue i { width: 1px; height: 46px; background: var(--ink); transform-origin: top; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Sticky story: one app per screen, background tints to the app color */
.story { position: relative; height: calc(var(--n, 8) * 90vh + 100vh); background: var(--tint); transition: background 0.8s var(--ease); }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr); align-items: center; padding: 0 4vw; overflow: hidden; }

/* Giant app name behind everything */
.ghost { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ghost span { position: absolute; left: 50%; bottom: 7vh; font-family: var(--serif); font-size: var(--fs, 20vw); line-height: 0.8; letter-spacing: -0.045em; white-space: nowrap; color: rgba(20, 20, 20, 0.07); opacity: 0; filter: blur(14px); transform: translate(-50%, 8%) scale(1.04); transform-origin: 50% 100%; transition: opacity 0.7s var(--ease), transform 1.1s var(--ease), filter 0.9s var(--ease); }
.ghost span.on { opacity: 1; filter: none; transform: translate(-50%, 0); }

/* Left copy: text swaps with blur (transitions.dev "texts reveal" pattern) */
.copy { position: relative; z-index: 2; max-width: 540px; }
.swap { position: relative; min-height: 420px; }
.swap .item { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; opacity: 0; transform: translateY(14px); filter: blur(6px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease); pointer-events: none; }
.swap .item.on { opacity: 1; transform: none; filter: none; pointer-events: auto; transition-delay: 0.08s; }
.swap .ico { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.swap h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(3.4rem, 7.4vw, 7.6rem); line-height: 0.95; letter-spacing: -0.02em; margin-top: 22px; }
html[lang="ko"] .swap h2 { font-size: clamp(2.8rem, 5.6vw, 5.8rem); line-height: 1.1; letter-spacing: -0.04em; }
.swap .sub { font-family: var(--serif); font-style: italic; font-size: 1.6rem; margin-top: 10px; color: var(--mute); }
html[lang="ko"] .swap .sub { font-style: normal; font-size: 1.35rem; }
.swap p { margin-top: 18px; line-height: 1.6; font-size: 1.05rem; max-width: 27em; }
.swap .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 0.95rem; transition: transform 0.3s var(--ease); }
.tag { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.85rem; }
.policy { font-size: 0.85rem; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }

/* Right stage: three screenshots fanned out in 3D */
.stage { position: relative; height: 100vh; height: 100svh; perspective: 1800px; z-index: 1; }
.stage-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.9s var(--ease); }
.fan { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d; pointer-events: none; }
.card { grid-area: 1 / 1; width: min(300px, 21vw); aspect-ratio: 600 / 1298; border-radius: 30px; overflow: hidden; opacity: 0; box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06); transition: transform 1s var(--ease), opacity 0.8s var(--ease), filter 0.8s var(--ease); will-change: transform; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.fan.next .card { transform: translate3d(0, 70vh, -200px) rotateX(-28deg); }
.fan.past .card { transform: translate3d(0, -80vh, -100px) rotateX(28deg); }
.fan.on .card { opacity: 1; }
.fan.on .c1 { transform: translate3d(0, -1%, 0) rotateY(-5deg); transition-delay: 0.05s; z-index: 3; }
.fan.on .c2 { transform: translate3d(-70%, 7%, -180px) rotateY(24deg) rotateZ(-5deg); transition-delay: 0.13s; filter: brightness(0.96); }
.fan.on .c3 { transform: translate3d(70%, 7%, -180px) rotateY(-24deg) rotateZ(5deg); transition-delay: 0.2s; filter: brightness(0.96); }

/* Feature chips pop in (transitions.dev "number pop-in" easing) and float */
.chip { position: absolute; padding: 11px 16px 11px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05); font-size: 0.95rem; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 9px; opacity: 0; transform: translateZ(120px) scale(0.6); transition: opacity 0.35s var(--ease), transform 0.6s var(--pop); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.chip.k0 { left: 4%; top: 24%; --i: 0; }
.chip.k1 { right: 3%; top: 15%; --i: 1; }
.chip.k2 { right: 7%; top: 74%; --i: 2; }
.fan.on .chip { opacity: 1; transform: translateZ(120px) scale(1); transition-delay: calc(0.45s + var(--i) * 0.1s); animation: bob 5s ease-in-out calc(var(--i) * -1.6s) infinite; }
@keyframes bob { 50% { translate: 0 -8px; } }

/* Bottom index: progress per app, click to jump */
.index { position: absolute; left: 4vw; right: 4vw; bottom: 3.4vh; display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; z-index: 3; }
.index button { all: unset; cursor: pointer; display: grid; gap: 9px; font-size: 0.82rem; color: var(--mute); transition: color 0.4s; }
.index button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.index button b { font-weight: 500; }
.index .ln { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.index .ln::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--lp, 0)); }
.index button.done .ln::after { transform: scaleX(1); opacity: 0.35; }
.index button.on { color: var(--ink); }

/* Numbers: spinning reels (transitions.dev "spinning counter" pattern) */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.numbers > div { padding: 56px 4vw; border-left: 1px solid var(--line); }
.numbers > div:first-child { border-left: 0; }
.reel { display: inline-flex; font-family: var(--serif); font-size: clamp(3.4rem, 6.6vw, 6.4rem); line-height: 1; height: 1em; overflow: hidden; }
.reel .col { display: flex; flex-direction: column; transition: transform 1.6s var(--ease); transition-delay: calc(var(--i) * 0.12s); }
.reel .col span { height: 1em; }
.numbers p { margin-top: 14px; color: var(--mute); }

/* Mission */
.mission { padding: 22vh 4vw; }
.kicker { font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.mission blockquote { font-family: var(--serif); font-size: clamp(2.4rem, 5.4vw, 5.4rem); line-height: 1.04; letter-spacing: -0.02em; margin-top: 28px; max-width: 16em; }
html[lang="ko"] .mission blockquote { font-size: clamp(2rem, 4.4vw, 4.4rem); line-height: 1.3; letter-spacing: -0.04em; max-width: 18em; }
html[lang="ko"] .mission blockquote em { font-style: normal; }
.mission mark { background: linear-gradient(transparent 62%, #ffd51f 62%); background-size: 0% 100%; background-repeat: no-repeat; color: inherit; transition: background-size 1.2s var(--ease); }
.mission mark.on { background-size: 100% 100%; }
.list { margin-top: 12vh; border-top: 1px solid var(--line); }
.list .li { display: grid; grid-template-columns: 90px 1fr 1.2fr; gap: 20px; padding: 34px 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: padding 0.5s var(--ease); }
.list .li span { color: var(--mute); }
.list .li h3 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; }
html[lang="ko"] .list .li h3 { font-size: 1.8rem; letter-spacing: -0.03em; }
.list .li p { line-height: 1.6; color: var(--mute); }

/* Contact */
.contact { padding: 20vh 4vw 10vh; background: var(--ink); color: var(--paper); }
.contact .kicker { color: inherit; opacity: 0.6; }
.contact a.mail { display: inline-block; margin-top: 30px; font-family: "Instrument Serif", "Times New Roman", serif; font-size: clamp(2.2rem, 8vw, 8.4rem); line-height: 1; letter-spacing: -0.03em; position: relative; overflow-wrap: anywhere; }
.contact a.mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 2px; background: currentColor; transform: scaleX(0.15); transform-origin: left; transition: transform 0.8s var(--ease); }
.contact .foot { margin-top: 18vh; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 0.9rem; opacity: 0.6; }

/* Hover effects only for mouse pointers (touch keeps :hover stuck on the last tapped element) */
@media (hover: hover) and (pointer: fine) {
  .pill:hover { transform: translateY(-2px); }
  .list .li:hover { padding-left: 18px; }
  .contact a.mail:hover::after { transform: scaleX(1); }
}

/* Scroll reveal */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  header.top nav { display: none; }
  .poster { width: 120px; }
  .hero .under { flex-direction: column; align-items: start; }
  .hero .under p { margin-left: -12px; padding: 10px 12px; border-radius: 14px; background: rgba(243, 241, 236, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .sticky { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding-top: 84px; align-items: start; }
  .swap { min-height: 300px; }
  .swap .item { justify-content: flex-start; }
  .swap .ico { width: 48px; height: 48px; border-radius: 12px; }
  .swap h2 { margin-top: 14px; }
  .swap p { display: none; }
  .stage { height: 100%; }
  .card { width: min(220px, 38vw); border-radius: 20px; }
  .chip { display: none; }
  .index { gap: 6px; }
  .index button { padding: 14px 0 6px; }
  .index .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .numbers > div:nth-child(3) { border-left: 0; }
  .numbers > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .list .li { grid-template-columns: 50px 1fr; }
  .list .li p { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv, .js .hero h1 .ln > span { opacity: 1 !important; transform: none !important; }
}
