/* 펑펑 core — @layer 로 계층 정리, @property 로 애니메이터블 토큰 등록, 네이티브 중첩 */
@layer reset, tokens, base, layout, components, util;

/* 애니메이션 가능한 타입 지정 커스텀 프로퍼티 */
@property --pop-lift {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --glow {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
@property --sheen {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@font-face { font-family: "Jua"; src: url("../fonts/Jua-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("../fonts/Pretendard-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("../fonts/Pretendard-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("../fonts/Pretendard-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("../fonts/Pretendard-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("../fonts/Pretendard-Black.woff2") format("woff2"); font-weight: 800; font-display: swap; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body, h1, h2, h3, h4, p, figure, ul, ol, dl, blockquote { margin: 0; }
  ul[class], ol[class] { list-style: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  img, svg { display: block; max-width: 100%; height: auto; }
  button, input, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; cursor: pointer; }
  :focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; border-radius: 8px; }
  html.no-scroll { overflow: hidden; }
  [hidden] { display: none !important; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  }
}

@layer tokens {
  :root {
    --pink: #ff86c8;
    --mint: #55e6c0;
    --lemon: #ffd84d;
    --grape: #9b6bff;
    --sky: #63c7ff;
    --cream: #fff6fb;
    --ink: #3a2b4d;
    --ink-soft: #6b5a80;
    --white: #ffffff;
    --card: #ffffff;
    --line: #f0dcec;
    --shadow: 0 18px 40px -20px rgba(126, 61, 120, .45);
    --shadow-sm: 0 8px 20px -12px rgba(126, 61, 120, .4);
    --radius: 22px;
    --radius-lg: 30px;
    --wrap: 1180px;
    --font: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
    --display: "Jua", "Pretendard", system-ui, sans-serif;
    --grad-candy: linear-gradient(120deg, var(--pink), var(--grape) 45%, var(--sky));
    --grad-soft: linear-gradient(180deg, #fff, var(--cream));
  }
}

@layer base {
  body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.18; letter-spacing: -.01em; }
  strong { font-weight: 700; }
  .skip {
    position: fixed; left: 12px; top: -60px; z-index: 200;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
    transition: top .2s;
    &:focus { top: 12px; }
  }
}

@layer layout {
  .wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
  .section { padding: clamp(56px, 8vw, 104px) 0; }
  .eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--display); font-size: .82rem; letter-spacing: .04em;
    color: var(--grape); background: color-mix(in srgb, var(--grape) 12%, #fff);
    padding: 6px 14px; border-radius: 999px;
  }
  .sec-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 44px); }
  .sec-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin: 14px 0 10px; }
  .sec-head p { color: var(--ink-soft); font-size: 1.05rem; }
  .sec-head.center { margin-inline: auto; text-align: center; }
}

@layer components {
  .ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; flex: none; }
  .ic[data-fill] { fill: currentColor; stroke: none; }

  .btn {
    --pop-lift: 0px;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--display); font-size: 1rem;
    padding: 12px 22px; border-radius: 999px;
    transform: translateY(var(--pop-lift));
    transition: --pop-lift .18s ease, box-shadow .18s ease, background .18s;
    & .ic { width: 1.15em; height: 1.15em; }
  }
  .btn-pop {
    background: var(--grad-candy); color: #fff;
    box-shadow: var(--shadow-sm);
    &:hover { --pop-lift: -3px; box-shadow: 0 16px 30px -14px rgba(155, 107, 255, .7); }
  }
  .btn-ghost {
    background: #fff; color: var(--ink); border: 2px solid var(--line);
    &:hover { --pop-lift: -3px; border-color: var(--pink); }
  }
  .btn-lemon { background: var(--lemon); color: var(--ink); box-shadow: var(--shadow-sm);
    &:hover { --pop-lift: -3px; } }
  .btn-lg { padding: 16px 30px; font-size: 1.12rem; }

  /* 헤더 */
  .site-head {
    position: sticky; top: 0; z-index: 90;
    background: color-mix(in srgb, var(--cream) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s, background .2s;
    &.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(126,61,120,.6); background: color-mix(in srgb, var(--cream) 94%, transparent); }
  }
  .head-in { display: flex; align-items: center; gap: 20px; height: 68px; }
  .brand { display: inline-flex; align-items: center; gap: 9px; }
  .brand-name { font-family: var(--display); font-size: 1.4rem; color: var(--ink); }
  .brand-mark { filter: drop-shadow(0 4px 8px rgba(155,107,255,.35)); }
  .nav-main {
    display: flex; gap: 6px; margin-left: 8px;
    & a { padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--ink-soft);
      &:hover { color: var(--ink); background: #fff; }
      &[aria-current="page"] { color: var(--grape); background: color-mix(in srgb, var(--grape) 10%, #fff); } }
  }
  .head-cta { margin-left: auto; display: flex; gap: 10px; }
  .menu-btn { display: none; padding: 8px; border-radius: 12px; color: var(--ink);
    & .ic { width: 26px; height: 26px; } }

  .mobnav { position: fixed; inset: 0; z-index: 120; background: rgba(58,43,77,.42); }
  .mobnav-panel {
    position: absolute; inset: 0 0 0 auto; width: min(84vw, 340px);
    background: var(--cream); padding: 20px; box-shadow: -20px 0 60px -30px rgba(0,0,0,.5);
    display: flex; flex-direction: column;
    animation: slideIn .25s ease;
  }
  @keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
  .mob-close { display: inline-flex; align-self: flex-end; }
  .mobnav-links { display: flex; flex-direction: column; gap: 4px; margin-top: 16px;
    & a { padding: 14px 12px; border-radius: 14px; font-family: var(--display); font-size: 1.15rem;
      &:hover { background: #fff; } }
    & .mob-dl { justify-content: center; margin-top: 14px; color: #fff; } }

  /* 푸터 */
  .site-foot { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; }
  .foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 34px; padding: 56px 0 34px; }
  .foot-tag { color: var(--ink-soft); margin-top: 14px; font-size: .96rem; }
  .foot-social { display: flex; gap: 10px; margin-top: 18px;
    & a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--cream); color: var(--grape);
      &:hover { background: var(--grape); color: #fff; }
      & .ic { width: 20px; height: 20px; } } }
  .foot-col h3 { font-family: var(--display); font-size: 1.05rem; margin-bottom: 14px; }
  .foot-col a { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--ink-soft);
    &:hover { color: var(--grape); }
    & .ic { width: 18px; height: 18px; color: var(--pink); } }
  .foot-addr { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: .92rem; margin-top: 5px;
    & .ic { width: 18px; height: 18px; color: var(--pink); margin-top: 3px; } }
  .foot-legal { border-top: 1px solid var(--line); margin-top: 8px; padding: 22px 0 34px; }
  .foot-biz { color: var(--ink-soft); font-size: .82rem; }
  .foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--ink-soft); font-size: .85rem; }
  .foot-links { display: flex; gap: 18px; }
  .linklike { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px;
    &:hover { color: var(--grape); } }

  /* 법적 모달 */
  .legal-modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
  .legal-backdrop { position: absolute; inset: 0; background: rgba(58,43,77,.5); backdrop-filter: blur(3px); }
  .legal-panel {
    position: relative; width: min(760px, 100%); max-height: 86vh; display: flex; flex-direction: column;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
    animation: popIn .22s ease;
  }
  @keyframes popIn { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
  .legal-bar { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line);
    & h2 { font-size: 1.4rem; } }
  .legal-body { padding: 24px 28px 32px; overflow-y: auto;
    & h3 { font-family: var(--display); font-size: 1.08rem; margin: 22px 0 8px; color: var(--grape); }
    & p { color: var(--ink-soft); margin-bottom: 8px; }
    & ul { margin: 4px 0 10px; padding-left: 18px; color: var(--ink-soft); }
    & li { margin: 5px 0; list-style: disc; }
    & strong { color: var(--ink); } }
  .legal-upd { font-size: .9rem; color: var(--ink-soft); background: var(--cream); padding: 12px 14px; border-radius: 12px; }

  /* 스토어 배지 / QR */
  .store-badges { display: flex; gap: 12px; flex-wrap: wrap; }
  .store-badges a { display: block; transition: transform .18s;
    &:hover { transform: translateY(-3px); } }
  .store-badges img { height: 54px; width: auto; }
}

@layer util {
  .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; }
  .stack { display: grid; gap: 16px; }
}

@media (max-width: 900px) {
  .nav-main, .head-cta { display: none; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .foot-in { grid-template-columns: 1fr; }
}
