/* MateYou partner guide — Notion-like docs layout. Dark only (DESIGN.md), neutral surfaces, pink for links and the one primary action. */
:root {
  color-scheme: dark;
  --bg: #111113;
  --side: #17171a;
  --elev: #1c1c20;
  --hover: rgba(255, 255, 255, 0.06);
  --press: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.09);
  --text: #ececef;
  --sub: #a8a8b0;
  --faint: #76767e;
  --pink: #fe3a8f;
  --link: #ff6aa9;
  --side-w: 272px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--elev);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text);
}
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--pink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

/* Sidebar */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 4px 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; object-fit: contain; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 8px 16px; overscroll-behavior: contain; }
.nav-group + .nav-group { margin-top: 10px; }
.nav-label { margin: 0; padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: 0.01em; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--sub);
  font-size: 14.5px;
  line-height: 1.35;
}
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--press); color: var(--text); font-weight: 600; }
.nav-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.nav-icon img { width: 22px; height: 22px; object-fit: contain; }
.nav-icon.emoji { font-size: 16px; line-height: 1; }
.side-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.side-foot a { color: var(--sub); }

/* Main column */
.main { margin-left: var(--side-w); min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: env(safe-area-inset-top) 16px 0 20px;
  background: rgba(17, 17, 19, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  transition: transform 0.22s ease;
}
.topbar.hidden { transform: translateY(-100%); }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--sub); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--sub); overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: var(--faint); }
.crumb-cur { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { background: var(--press); }
.menu-btn, .side-head .side-close { display: none; }
.nw { white-space: nowrap; }

.page { max-width: 760px; margin: 0 auto; padding: 28px 40px 64px; }
.page-head { margin-bottom: 8px; }
.page-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 8px; }
.page-icon img { width: 72px; height: 72px; object-fit: contain; }
.page-icon.emoji { font-size: 56px; line-height: 1; }
h1 { margin: 4px 0 8px; font-size: 36px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
.lede { margin: 0 0 24px; font-size: 17.5px; line-height: 1.65; color: var(--sub); }

.content > :first-child { margin-top: 0; }
h2 { position: relative; margin: 44px 0 10px; font-size: 23px; line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; }
h3 { margin: 26px 0 4px; font-size: 17px; line-height: 1.45; font-weight: 600; }
.anchor { position: absolute; left: -22px; top: 0; color: var(--faint); opacity: 0; font-weight: 500; }
h2:hover .anchor { opacity: 1; text-decoration: none; }
p { margin: 6px 0 12px; }
ul, ol { margin: 6px 0 14px; padding-left: 1.4em; }
li { margin: 4px 0; }
li::marker { color: var(--faint); }
strong { font-weight: 700; color: var(--text); }

/* Properties (Notion page properties) */
.props { margin: 0 0 20px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.props > div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 6px 0; font-size: 15px; line-height: 1.6; }
.props dt { color: var(--faint); }
.props dd { margin: 0; color: var(--text); }

/* Callout */
.callout { display: flex; gap: 12px; margin: 16px 0; padding: 14px 18px; background: var(--elev); border-radius: 10px; line-height: 1.65; }
.callout-icon { flex: none; font-size: 19px; line-height: 1.5; }
.callout p { margin: 0; }

/* Steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0 16px; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 44px; margin: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--elev);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--line); }
.step-title { display: block; font-weight: 600; line-height: 1.75; }
.step-body { display: block; color: var(--sub); }

/* Chips (short ordered flow) */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 14px; counter-reset: chip; }
.chips li { counter-increment: chip; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--elev); font-size: 14.5px; }
.chips li::before { content: counter(chip) " "; color: var(--faint); font-weight: 600; }

/* Toggle */
.toggle { border-bottom: 1px solid var(--line); }
.toggle summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 12px 4px;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
.toggle summary::-webkit-details-marker { display: none; }
.toggle summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  margin-top: 8px;
  border-left: 7px solid var(--sub);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.18s ease;
}
.toggle[open] summary::before { transform: rotate(90deg); }
.toggle summary:hover { color: var(--text); background: var(--hover); border-radius: 8px; }
.toggle-body { padding: 0 4px 12px 21px; color: var(--sub); }
.toggle-body p { margin: 0 0 8px; }

/* Table */
.table-wrap { margin: 12px 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { color: var(--faint); font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, 0.025); white-space: nowrap; }
.table tbody th { font-weight: 600; color: var(--text); white-space: nowrap; }
.table td { color: var(--sub); }
.table tr:last-child th, .table tr:last-child td { border-bottom: 0; }
.table.num td { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.num thead th:last-child { text-align: right; }

/* Gallery (page cards) */
.gallery { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 12px 0 8px; }
.gallery li { margin: 0; }
.card { display: flex; align-items: center; gap: 14px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.card:hover { background: var(--hover); text-decoration: none; }
.card-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.card-icon img { width: 44px; height: 44px; object-fit: contain; }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-title { font-weight: 600; line-height: 1.5; }
.card-desc { font-size: 14px; line-height: 1.55; color: var(--sub); }

/* Figures (real objects: gifts, tier badges) */
.figures { display: grid; grid-template-columns: repeat(5, minmax(0, 88px)); gap: 16px 12px; margin: 14px 0 12px; }
.figures figure { margin: 0; text-align: center; }
.figures img { width: 72px; height: 72px; margin: 0 auto; object-fit: contain; }
.figures figcaption { margin-top: 4px; font-size: 13px; color: var(--sub); line-height: 1.4; }

/* Slides (fanhouse deck pages) */
.slides { list-style: none; display: flex; gap: 12px; margin: 12px 0 6px; padding: 0 0 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.slides li { flex: none; width: min(280px, 72vw); margin: 0; scroll-snap-align: start; }
.slides img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--elev); }

/* Buttons: flat two-step (one primary per view) */
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 12px; font-weight: 600; font-size: 15.5px; color: var(--text); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:active { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.12); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

/* In-page TOC */
.toc { margin: 0 0 8px; padding: 12px 16px; border-left: 2px solid var(--line); }
.toc-label { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: inline-block; padding: 3px 0; color: var(--sub); font-size: 14.5px; }
.toc a:hover { color: var(--text); }

/* Pager + footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 48px 0 0; }
.pager-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); min-height: 64px; }
.pager-link:hover { background: var(--hover); text-decoration: none; }
.pager-link.next { text-align: right; align-items: flex-end; }
.pager-dir { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--faint); }
.pager-title { font-weight: 600; }
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.7; color: var(--faint); }
.foot p { margin: 0 0 2px; }
.foot a { color: var(--sub); }

.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.55); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: #2a2a30;
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Phones and tablets: drawer sidebar, compact circular header (PAGE-HEADER-01) */
@media (max-width: 1023px) {
  .side {
    width: min(320px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0s linear 0.24s;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.4);
    padding-top: env(safe-area-inset-top);
  }
  .side.open { transform: none; visibility: visible; transition: transform 0.24s ease; }
  .side-head .side-close { display: grid; }
  .nav-item { min-height: 44px; font-size: 15px; }
  .main { margin-left: 0; }
  .topbar { padding: env(safe-area-inset-top) 8px 0; min-height: 56px; background: rgba(17, 17, 19, 0.9); }
  .menu-btn { display: grid; }
  .menu-btn, .share-btn { background: rgba(255, 255, 255, 0.07); width: 40px; height: 40px; margin: 2px; position: relative; }
  .menu-btn::after, .share-btn::after { content: ""; position: absolute; inset: -2px; }
  .crumbs { visibility: hidden; }
  .page { padding: 8px 20px 40px; }
  h1 { font-size: 30px; }
  .lede { font-size: 17px; }
  .anchor { display: none; }
}
@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr; }
  .props > div { grid-template-columns: 84px 1fr; gap: 10px; }
  .figures { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 6px; }
  .figures img { width: 56px; height: 56px; }
  .figures figcaption { font-size: 12.5px; }
  .page-icon, .page-icon img { width: 60px; height: 60px; }
  .page-icon.emoji { font-size: 46px; }
  h1 { font-size: 28px; }
  h2 { font-size: 21px; margin-top: 38px; }
  .table { font-size: 14.5px; }
  .table th, .table td { padding: 9px 12px; }
  .cta .btn { flex: 1 1 auto; }
  .cta .btn-primary { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .side, .side.open, .topbar, .toggle summary::before { transition: none; }
}
