/* ===========================================================================
   AndNextLab — 회사 소개 페이지
   화이트 + 네이비 포인트 / 벤토 라운드 · 오버사이즈 타이포 · 플레이풀
   =========================================================================== */

:root {
  /* 팔레트 */
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e6eaf0;
  --border-strong: #d5dbe6;

  --text: #0f172a;
  --text-soft: #475569;
  --text-mute: #6b7280;

  --accent: #1e40af; /* 네이비 (blue-800) */
  --accent-strong: #1e3a8a; /* 더 깊은 네이비 (blue-900) */
  --accent-mark: #1e3a8a;
  --on-accent: #ffffff;

  /* 플레이풀 소프트 틴트 (네이비 계열) */
  --tint-blue: #eef4ff;
  --tint-indigo: #eef0ff;
  --tint-sky: #ecf7ff;

  /* 둥근 정도 (크게) */
  --radius: 24px;
  --radius-lg: 34px;
  --radius-sm: 14px;
  --pill: 999px;

  /* 말랑한 그림자 (네이비 틴트) */
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04),
    0 8px 20px -8px rgba(30, 58, 138, 0.12);
  --shadow-md: 0 12px 28px -8px rgba(30, 58, 138, 0.2),
    0 4px 10px -4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 34px 64px -24px rgba(30, 58, 138, 0.3);

  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 40px);

  --font: "Pretendard Variable", Pretendard, -apple-system,
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

/* --- reset / base --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.accent {
  color: var(--accent);
}

a:focus-visible,
.btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
  border-radius: 8px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* --- buttons (pill) ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 26px;
  border-radius: var(--pill);
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  transition: transform 0.16s ease, background-color 0.16s ease,
    border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
  transform: translateY(-3px);
}
.btn-store {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  font-size: 0.94rem;
  padding: 12px 22px;
}
.btn-store:hover {
  background: var(--surface-2);
}

/* --- pill 태그 (칩) ------------------------------------------------------- */
.hero-chips,
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-chips li,
.card-tags li {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

/* --- header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* backdrop-filter(블러)는 스크롤 시 매 프레임 재계산돼 버벅거림의 주원인이라
     제거. 화이트 테마라 불투명 흰 배경으로도 시각차가 거의 없다. */
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
}
.brand-mark {
  /* 실제 로고 SVG (네이비 라운드 사각형 + 흰 ANL). 자체 도형이라 배경·라운딩
     불필요. 비율 유지 위해 높이 기준 + width auto. */
  height: 32px;
  width: auto;
  display: block;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
}
.site-nav a {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.96rem;
  transition: color 0.15s ease;
}
.site-nav a:hover {
  color: var(--text);
}
.nav-cta {
  color: var(--on-accent) !important;
  background: var(--accent);
  padding: 10px 18px;
  border-radius: var(--pill);
}
.nav-cta:hover {
  background: var(--accent-strong);
}

/* --- hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(
      64% 80% at 82% 4%,
      color-mix(in srgb, var(--accent) 12%, transparent),
      transparent 60%
    ),
    var(--bg);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding-block: clamp(84px, 15vw, 150px);
  max-width: 860px;
}
.eyebrow {
  display: inline-block;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--accent) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: var(--pill);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.7rem, 8.5vw, 5.4rem);
  font-weight: 800;
}
.hero-sub {
  margin-top: 26px;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  color: var(--text-soft);
  max-width: 640px;
}
.hero-actions {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-chips {
  margin-top: 30px;
}
.scroll-cue {
  margin-top: 50px;
  width: 26px;
  height: 42px;
  border: 2px solid var(--border-strong);
  border-radius: var(--pill);
}
.scroll-cue span {
  display: block;
  width: 4px;
  height: 8px;
  margin: 8px auto 0;
  background: var(--accent);
  border-radius: 2px;
}

/* 플레이풀 떠다니는 스티커 */
.hero-stickers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero-stickers .sticker {
  position: absolute;
  font-size: clamp(2rem, 3.4vw, 3rem);
  filter: drop-shadow(0 12px 18px rgba(30, 58, 138, 0.22));
}
.sticker.s1 {
  top: 20%;
  right: 10%;
}
.sticker.s2 {
  top: 58%;
  right: 20%;
}
.sticker.s3 {
  top: 30%;
  right: 32%;
}
.sticker.s4 {
  top: 70%;
  right: 6%;
}

/* --- sections ------------------------------------------------------------- */
.section {
  padding-block: clamp(56px, 9vw, 100px);
}
.section-alt {
  background: var(--bg-alt);
}
.section-head {
  max-width: 720px;
  margin: 0 auto clamp(36px, 5vw, 56px);
  text-align: center;
}
.section-eyebrow {
  display: inline-block;
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 800;
}
.section-lead {
  margin-top: 20px;
  font-size: clamp(1.04rem, 2.2vw, 1.2rem);
  color: var(--text-soft);
}
.section-lead strong {
  color: var(--accent-strong);
  font-weight: 700;
}

/* 큰 라운드 패널 (벤토 블록) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 60px);
  box-shadow: var(--shadow-sm);
}

/* --- bento grids ---------------------------------------------------------- */
.bento {
  display: grid;
  gap: 18px;
}
.bento-stats {
  grid-template-columns: repeat(3, 1fr);
}
.bento-services {
  grid-template-columns: 1.1fr 0.9fr;
  grid-auto-rows: 1fr;
}
.bento-services .card-feature {
  grid-row: span 2;
}

/* --- stat 타일 ------------------------------------------------------------ */
.stat {
  position: relative;
  border-radius: var(--radius);
  padding: 28px 26px;
  background: var(--tint-blue);
}
.stat.tint-indigo {
  background: var(--tint-indigo);
}
.stat.tint-sky {
  background: var(--tint-sky);
}
.stat-emoji {
  display: block;
  font-size: 1.9rem;
  margin-bottom: 14px;
}
.stat-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.02em;
}
.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.98rem;
}

/* --- service 카드 --------------------------------------------------------- */
.card {
  position: relative;
  border-radius: var(--radius);
  padding: clamp(26px, 3.4vw, 38px);
  background: var(--tint-blue);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card.tint-indigo {
  background: var(--tint-indigo);
}
.card.tint-sky {
  background: var(--tint-sky);
}
.card-feature {
  display: flex;
  flex-direction: column;
}
.card-emoji {
  font-size: 2.4rem;
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 14px rgba(30, 58, 138, 0.18));
}
.card-feature .card-emoji {
  font-size: 3rem;
}
.card-title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
}
.card-body {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 1rem;
}
.card-tags {
  margin-top: auto;
  padding-top: 22px;
}

/* --- work: flagship app --------------------------------------------------- */
.work-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.feature-list {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}
.feature-list li {
  position: relative;
  padding-left: 32px;
  color: var(--text-soft);
}
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50%;
}
.store-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 실제 앱 스크린샷 (투명 배경 폰 목업) */
.work-visual {
  position: relative;
  display: grid;
  place-items: center;
}
/* 폰 뒤 소프트 네이비 스포트라이트 — blur 필터 없이 radial 자체로 부드럽게(성능) */
.work-visual::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: 82%;
  aspect-ratio: 3 / 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--accent) 20%, transparent),
    transparent 72%
  );
}
.phone-shot {
  position: relative;
  z-index: 1;
  width: min(256px, 72vw);
  height: auto;
  /* 투명 배경 PNG 라 드롭섀도가 폰 실루엣을 따라간다 */
  filter: drop-shadow(0 30px 46px rgba(30, 58, 138, 0.32));
}

/* --- contact CTA 카드 (네이비 블록) -------------------------------------- */
.cta-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: var(--radius-lg);
  padding: clamp(44px, 8vw, 92px);
  background: linear-gradient(150deg, #1e3a8a, #172554 80%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-card::before,
.cta-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.5;
  pointer-events: none;
}
.cta-card::before {
  width: 320px;
  height: 320px;
  background: #3b82f6;
  top: -120px;
  right: -80px;
}
.cta-card::after {
  width: 260px;
  height: 260px;
  background: #6366f1;
  bottom: -120px;
  left: -60px;
}
.cta-card > * {
  position: relative;
  z-index: 1;
}
.cta-sticker {
  display: inline-block;
  font-size: 2.6rem;
  margin-bottom: 8px;
}
.cta-card .section-eyebrow {
  color: #bfdbfe;
}
.cta-card .section-title {
  color: #fff;
}
.cta-card .section-lead {
  color: rgba(255, 255, 255, 0.82);
  max-width: 560px;
  margin-inline: auto;
}
.cta-card .section-lead strong {
  color: #fff;
}
.cta-btn {
  margin-top: 34px;
  background: #fff;
  color: var(--accent-strong);
  padding: 17px 34px;
  font-size: 1.06rem;
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.4);
}
.cta-btn:hover {
  transform: translateY(-3px);
  background: #eef4ff;
}

/* --- footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 44px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.footer-meta {
  color: var(--text-soft);
  font-size: 0.94rem;
}
.footer-meta a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
}
.footer-copy {
  margin-left: auto;
  color: var(--text-mute);
  font-size: 0.9rem;
}

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .bento-services {
    grid-template-columns: 1fr;
  }
  .bento-services .card-feature {
    grid-row: auto;
  }
  .work-inner {
    grid-template-columns: 1fr;
  }
  .work-visual {
    order: -1;
  }
}
@media (max-width: 760px) {
  .hero-stickers {
    display: none;
  }
  .bento-stats {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .site-nav a:not(.nav-cta) {
    display: none;
  }
  .footer-copy {
    margin-left: 0;
    width: 100%;
  }
}

/* 모션 최소화 기본 배려 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

/* ===========================================================================
   MOTION & 3D — 점진적 향상 (JS 가 html.js 부여, 모션 최소화 존중)
   =========================================================================== */

/* --- 오로라 배경 블롭 --- */
.hero-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  /* 히어로 하단(소개 섹션 경계) 근처에서 블롭을 부드럽게 사라지게 해,
     overflow:hidden 의 딱 잘린 직선(하드 컷)을 소프트 디졸브로 바꾼다. */
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 80%,
    transparent 100%
  );
  mask-image: linear-gradient(to bottom, #000 0%, #000 80%, transparent 100%);
}
.hero-aurora .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px); /* 64→48: 블러 래스터 비용 절감 */
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform 0.4s ease;
}
.blob-1 {
  width: min(46vw, 440px);
  aspect-ratio: 1;
  background: #93c5fd;
  opacity: 0.5;
  top: -140px;
  right: -40px;
  animation: drift1 15s ease-in-out infinite;
}
.blob-2 {
  width: min(40vw, 380px);
  aspect-ratio: 1;
  background: #a5b4fc;
  opacity: 0.42;
  bottom: -160px;
  left: -70px;
  animation: drift2 19s ease-in-out infinite;
}
.blob-3 {
  width: min(34vw, 320px);
  aspect-ratio: 1;
  background: #c7d2fe;
  opacity: 0.4;
  top: 34%;
  left: 46%;
  animation: drift3 22s ease-in-out infinite;
}
@keyframes drift1 {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: -24px 30px;
  }
}
@keyframes drift2 {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 30px -20px;
  }
}
@keyframes drift3 {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: -20px -26px;
  }
}

/* --- 히어로 진입 스태거 --- */
.hero-inner > * {
  animation: heroRise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-inner > *:nth-child(1) {
  animation-delay: 0.05s;
}
.hero-inner > *:nth-child(2) {
  animation-delay: 0.13s;
}
.hero-inner > *:nth-child(3) {
  animation-delay: 0.21s;
}
.hero-inner > *:nth-child(4) {
  animation-delay: 0.29s;
}
.hero-inner > *:nth-child(5) {
  animation-delay: 0.37s;
}
.hero-inner > *:nth-child(6) {
  animation-delay: 0.45s;
}
@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- 스티커 부유 --- */
.sticker {
  animation: floatSticker 6s ease-in-out infinite;
}
.sticker.s2 {
  animation-duration: 7.5s;
  animation-delay: -1s;
}
.sticker.s3 {
  animation-duration: 8.5s;
  animation-delay: -2.5s;
}
.sticker.s4 {
  animation-duration: 6.8s;
  animation-delay: -1.8s;
}
@keyframes floatSticker {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateY(-18px) rotate(6deg);
  }
}

/* --- 타이틀 시머 --- */
.hero-title .accent {
  background: linear-gradient(100deg, #1e3a8a 0%, #3b82f6 45%, #1e3a8a 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: 220% 0;
  }
}

/* --- 스크롤 큐 --- */
.scroll-cue span {
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* --- 스크롤 리빌 (JS 가 .reveal 부여) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* --- 3D 틸트 (카드 / 스탯) --- */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tilt:hover {
  transform: perspective(860px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
    translateY(-4px);
  box-shadow: var(--shadow-md);
}
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.5),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  /* mix-blend-mode(soft-light) 제거 — 블렌드 합성은 리페인트 비용이 크다.
     평범한 흰 반경 하이라이트로도 충분한 sheen 효과. */
}
.tilt:hover::after {
  opacity: 0.55;
}

/* --- 3D 폰 --- */
.work-visual {
  perspective: 1000px;
}
.phone-3d {
  transform: rotateX(var(--tiltX, 0deg)) rotateY(var(--tiltY, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.25s ease;
}
.phone-shot {
  animation: phoneBob 5.5s ease-in-out infinite;
}
@keyframes phoneBob {
  0%,
  100% {
    transform: translateY(0) rotate(-1.2deg);
  }
  50% {
    transform: translateY(-16px) rotate(1.2deg);
  }
}

/* --- 오프스크린 애니메이션 일시정지 (JS 가 .paused 토글) — 스크롤 성능 --- */
.hero.paused .blob,
.hero.paused .sticker,
.hero.paused .hero-title .accent,
.work-visual.paused .phone-shot {
  animation-play-state: paused;
}

/* --- 모션 최소화: 새 애니메이션 전부 정지 --- */
@media (prefers-reduced-motion: reduce) {
  .blob-1,
  .blob-2,
  .blob-3,
  .hero-inner > *,
  .sticker,
  .hero-title .accent,
  .scroll-cue span,
  .phone-shot {
    animation: none !important;
  }
  .hero-inner > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-title .accent {
    background: none;
    color: var(--accent);
    -webkit-text-fill-color: currentColor;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
