/* ==========================================================================
   EtherXync — design system
   Everything is connected.
   Ether(민트·이성) 와 Xync(코랄·공감) 두 줄기가 X 에서 만난다.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* space */
  --bg: #070A0F;
  --bg-2: #0A0E14;
  --panel: #0D131C;
  --card: #101722;
  --card-2: #141C29;
  --glass: rgba(16, 23, 34, 0.62);
  --veil: rgba(7, 10, 15, 0.78);

  /* lines */
  --line: rgba(148, 170, 197, 0.12);
  --line-2: rgba(148, 170, 197, 0.22);
  --line-input: rgba(148, 170, 197, 0.34);

  /* text */
  --text: #EAF0F7;
  --text-2: #A7B3C3;
  --text-3: #74839A;

  /* two currents */
  --ether: #63F2D2;          /* 이성·연결 — primary */
  --ether-2: #8AF6DF;
  --ether-ink: #042019;
  --ether-dim: rgba(99, 242, 210, 0.12);
  --ether-glow: rgba(99, 242, 210, 0.35);

  --xync: #FF8A66;           /* 공감·교감 — secondary */
  --xync-2: #FFA98C;
  --xync-ink: #2A0D04;
  --xync-dim: rgba(255, 138, 102, 0.12);
  --xync-glow: rgba(255, 138, 102, 0.35);

  --spark: #FFFFFF;          /* 두 줄기가 만나는 점 */

  /* semantic */
  --ok: #4ADE80;
  --warn: #FBBF24;
  --err: #F87171;
  --info: #60A5FA;

  /* type */
  --f-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --f-serif: "Instrument Serif", "Noto Serif KR", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* 제목용: 라틴은 Instrument Serif, 한글은 Hahmlet(가변). 본문은 언제나 --f-sans */
  --f-display: "Hahmlet", "Noto Serif KR", Georgia, serif;   /* 한국어 제목(숫자·라틴도 Hahmlet 로 고르게) */
  --f-display-latin: "Instrument Serif", "Hahmlet", Georgia, serif;   /* 영어로만 된 큰 글자(lang="en") */
  --w-display: 420;          /* Hahmlet 제목 기본 굵기 */
  --w-display-strong: 560;
  /* (RB 추가) 숫자·문장부호가 섞이는 한국어 제목(조항 번호, '댓글 3개', 회원이 쓴 글 제목)은 라틴 글자도 Hahmlet 으로.
     Instrument Serif 숫자는 가늘고 좁아 한글 제목 사이에서 튄다 */
  --f-display-ko: "Hahmlet", "Noto Serif KR", Georgia, serif;

  --t-hero: clamp(3.1rem, 9vw, 8.2rem);
  --t-h1: clamp(2.3rem, 5.4vw, 4.4rem);
  --t-h2: clamp(1.8rem, 3.4vw, 2.9rem);
  --t-h3: 1.3rem;
  --t-body: 1.0625rem;
  --t-small: 0.9rem;
  --t-mono: 0.78rem;

  /* shape */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* space */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 144px;

  --wrap: 1200px;
  --wrap-wide: 1360px;
  --nav-h: 68px;             /* 머리(메뉴 줄) 높이 */
  --banner-h: 0px;           /* 공지 띠 높이. 띠가 뜨면 xync.js 가 실제 높이를 넣는다 */
  --header-h: calc(var(--nav-h) + var(--banner-h));   /* 화면 위에 붙어 있는 전체 높이 */

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --d-1: 120ms; --d-2: 220ms; --d-3: 420ms; --d-4: 720ms;
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);       /* 지수형 감속. 넘침·바운스 없음 */
  --d-5: 1100ms;             /* 페이지 하나에 한 번 쓰는 큰 연출 */

  /* 떠 있는 면: 대화상자, 메뉴, 알림, 가림막 카드 (밝은 화면에서는 이 값만 바꾸면 된다) */
  --surface-raised: #0F1621;
  --surface-toast: #121A26;
  --surface-gate: rgba(15, 22, 33, 0.92);

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 32px -18px rgba(0,0,0,0.8);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.05) inset, 0 30px 80px -30px rgba(0,0,0,0.9);

  /* 초점 링: 사이트 전체에서 하나. 민트 2px, 3px 띄움 */
  --focus: var(--ether);
  --focus-w: 2px;
  --focus-off: 3px;

  /* 스크롤바: 선 색, 손을 올리면(웹킷) 민트 */
  --scroll-thumb: rgba(148, 170, 197, 0.30);
  --scroll-thumb-hover: rgba(99, 242, 210, 0.55);

  accent-color: var(--ether);
  caret-color: var(--acc, var(--ether));
  scrollbar-color: var(--scroll-thumb) transparent;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.7;
  font-feature-settings: "ss01", "ss02";
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100svh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.025em; font-weight: 750; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a, button, [role="button"], label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
ul, ol { margin: 0; padding: 0; }

/* ---------- 브라우저 표면: 그리지 않은 곳도 이 사이트의 것으로 ---------- */
::selection { background: rgba(99, 242, 210, 0.82); color: var(--ether-ink); }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-off); border-radius: 6px; }
* { scrollbar-width: thin; }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); background-clip: padding-box; border: 3px solid transparent; border-radius: 10px; }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--scroll-thumb-hover); }
}
:where(a, u, .link-btn) { text-underline-offset: 0.24em; text-decoration-thickness: 1px; }
/* 숫자를 세로로 맞춰 읽는 칸(표, 순위, 점수)은 고른 폭 숫자. 문장 속 날짜·수는 그대로 */
:where(table, kbd, .tabular) { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ether); color: var(--ether-ink); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- ambient background ---------- */
.xy-ambient {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 12% -8%, rgba(99, 242, 210, 0.10), transparent 60%),
    radial-gradient(55vw 55vh at 100% 110%, rgba(255, 138, 102, 0.09), transparent 60%),
    var(--bg);
}
.xy-ambient::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- layout ---------- */
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 32px, var(--wrap-wide)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 32px, 760px); margin-inline: auto; }
main { display: block; padding-top: var(--header-h); }
.section { padding-block: clamp(72px, 11vw, 150px); position: relative; }
.section-tight { padding-block: clamp(48px, 7vw, 88px); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-4); align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- type helpers ---------- */
/* 작은 표시: 정보를 담을 때만. 제목 위에 얹는 머리표(eyebrow)로는 쓰지 않는다(리디자인 브리프 §2). 앞의 X 는 로고의 두 줄기 */
.label {
  font-size: .9rem; font-weight: 650; letter-spacing: -0.005em; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 10px;
}
.label::before {
  content: ""; flex: none; width: 14px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M11 11C25 21 39 43 53 53' stroke='%2363F2D2' stroke-width='8' fill='none' stroke-linecap='round'/><path d='M11 53C21 39 43 25 53 11' stroke='%23FF8A66' stroke-width='8' fill='none' stroke-linecap='round'/></svg>") center / contain no-repeat;
}
.label.is-ether { color: var(--ether); }
.label.is-xync { color: var(--xync); }
.label.no-mark::before { display: none; }
.serif { font-family: var(--f-serif); font-weight: 400; letter-spacing: -0.01em; }
.serif-i { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.015em; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.ether { color: var(--ether); }
.xync { color: var(--xync); }
/* 제목 목소리: 페이지 제목(h1)과 섹션 제목(h2)은 --f-display(라틴 Instrument Serif, 한글 Hahmlet).
   h3 이하·본문·버튼·메뉴는 Pretendard 그대로. 게임 화면 안과 읽기 화면 본문에는 쓰지 않는다 */
.h-hero, .h1, .h2, .section-head h2 {
  font-family: var(--f-display); font-weight: var(--w-display);
  font-feature-settings: normal; font-synthesis-weight: none; font-kerning: normal;
}
.h-hero { font-size: var(--t-hero); line-height: 1.02; letter-spacing: -0.03em; }
.h1 { font-size: var(--t-h1); line-height: 1.14; letter-spacing: -0.02em; }
.h2 { font-size: var(--t-h2); line-height: 1.2; letter-spacing: -0.02em; }
.h3 { font-size: var(--t-h3); line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); line-height: 1.75; color: var(--text-2); max-width: 44em; }
.small { font-size: var(--t-small); }
.tabular { font-variant-numeric: tabular-nums; }

.section-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 60px); }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }

/* 두 줄기 그라데이션 글자 — 한 페이지에 한 번만 */
.cross-text {
  background: linear-gradient(100deg, var(--ether) 0%, #D6FFF5 42%, #FFE3D8 58%, var(--xync) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--line-input);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 650; font-size: .98rem; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform var(--d-2) var(--ease-expo), background-color var(--d-2), border-color var(--d-2), box-shadow var(--d-2), color var(--d-2), opacity var(--d-1);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--line-2); }
/* 누르면 98% 로 살짝 눌린다 */
.btn:active { transform: scale(.98); transition-duration: 60ms; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-primary { --btn-bg: var(--ether); --btn-fg: var(--ether-ink); --btn-bd: var(--ether); box-shadow: 0 10px 28px -14px var(--ether-glow); }
.btn-primary:hover { --btn-bg: var(--ether-2); --btn-bd: var(--ether-2); box-shadow: 0 14px 34px -16px var(--ether-glow); }
/* 기본 버튼: 손을 올리면 표면 위로 옅은 빛이 한 번 지나간다 */
:where(.btn-primary) { position: relative; isolation: isolate; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, 0.72) 50%, transparent 66%);
  transform: translateX(-105%);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn-primary:hover::after { transform: translateX(105%); transition: transform 820ms var(--ease-in-out); }
}
.btn-xync { --btn-bg: var(--xync); --btn-fg: var(--xync-ink); --btn-bd: var(--xync); box-shadow: 0 10px 30px -12px var(--xync-glow); }
.btn-xync:hover { --btn-bg: var(--xync-2); --btn-bd: var(--xync-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); }
.btn-quiet { --btn-bd: transparent; color: var(--text-2); }
.btn-quiet:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform var(--d-2) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- chips, badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--text-2);
  font-size: .85rem; font-weight: 550; background: rgba(255,255,255,0.02);
  transition: color var(--d-2), border-color var(--d-2), background var(--d-2);
}
a.chip:hover, button.chip:hover { color: var(--text); border-color: var(--line-input); }
.chip.is-on { color: var(--ether-ink); background: var(--ether); border-color: var(--ether); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: .78rem; font-weight: 650; letter-spacing: 0;
  border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.is-live { color: var(--ether); border-color: rgba(99,242,210,.35); background: var(--ether-dim); }
.badge.is-dev { color: var(--warn); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.badge.is-soon { color: var(--xync); border-color: rgba(255,138,102,.35); background: var(--xync-dim); }
.badge.is-free { color: var(--ok); border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.08); }

/* ---------- cards ---------- */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)), var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-1);
  transition: transform var(--d-3) var(--ease-out), border-color var(--d-3), box-shadow var(--d-3);
}
a.card:hover, .card.is-hover:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
/* 포인터를 따라 테두리가 은은히 밝아지는 카드(마우스일 때만). [data-glow] 를 달면 켜지고,
   xync.js 가 포인터 자리(--gx, --gy)를 넣는다. 테두리 안쪽 1px 에 그린다(overflow: hidden 카드도 보이게) */
@media (hover: hover) and (pointer: fine) {
  [data-glow]::after, .card-glow::after {
    content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 1px; pointer-events: none;
    background: radial-gradient(300px circle at var(--gx, 50%) var(--gy, -40%), rgba(99, 242, 210, 0.75), rgba(255, 138, 102, 0.36) 42%, transparent 72%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0; transition: opacity var(--d-3) var(--ease-out);
  }
  [data-glow]:hover::after, .card-glow:hover::after { opacity: 1; }
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.divider { height: 1px; background: var(--line); border: 0; margin: var(--s-6) 0; }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; }
.field > label, .field-label { font-size: .9rem; font-weight: 600; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-input); color: var(--text);
  transition: border-color var(--d-2), box-shadow var(--d-2), background var(--d-2);
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover, .select:hover { border-color: rgba(148,170,197,.5); }
/* 입력 칸도 같은 초점 링(전역 :focus-visible)을 쓴다. 여기서는 테두리와 바탕만 */
.input:focus, .textarea:focus, .select:focus { border-color: var(--ether); background: rgba(255,255,255,0.045); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline-offset: 2px; }
.field-hint { font-size: .82rem; color: var(--text-3); }
.field-error { font-size: .85rem; color: var(--err); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--ether); }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: .92rem; }
.tab:hover { color: var(--text); }
.tab.is-on, .tab[aria-selected="true"] { background: var(--text); color: var(--bg); }

/* ---------- avatar ---------- */
.avatar {
  --h: 168; flex: none; width: var(--size, 36px); height: var(--size, 36px); border-radius: 50%;
  display: inline-grid; place-items: center; font-weight: 750; font-size: calc(var(--size, 36px) * .42); color: #fff;
  background: radial-gradient(circle at 30% 25%, hsl(var(--h) 85% 72%), hsl(calc(var(--h) + 40) 70% 45%) 70%);
  box-shadow: 0 0 0 2px rgba(255,255,255,.08) inset; text-transform: uppercase; user-select: none;
}

/* ---------- header ---------- */
/* 바탕은 스크롤을 따라 서서히 짙어진다(투명도·흐림). 스크롤 타임라인을 모르는 브라우저는
   xync.js 가 붙이는 .is-scrolled 로 부드럽게 전환한다 */
.xy-header {
  position: fixed; inset: var(--banner-h) 0 auto 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  background-color: rgba(7, 10, 15, 0);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(0px) saturate(1); backdrop-filter: blur(0px) saturate(1);
  transition: background-color var(--d-3) var(--ease-out), border-color var(--d-3) var(--ease-out),
    -webkit-backdrop-filter var(--d-3) var(--ease-out), backdrop-filter var(--d-3) var(--ease-out);
}
.xy-header.is-scrolled, .xy-header.is-solid {
  background-color: var(--veil); border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
@keyframes xy-veil {
  from { background-color: rgba(7, 10, 15, 0); border-bottom-color: rgba(148, 170, 197, 0); -webkit-backdrop-filter: blur(0px) saturate(1); backdrop-filter: blur(0px) saturate(1); }
  to { background-color: var(--veil); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
}
@supports (animation-timeline: scroll()) {
  .xy-header:not(.is-solid) { animation: xy-veil linear both; animation-timeline: scroll(root block); animation-range: 0px 112px; transition: none; }
}
.xy-header .wrap-wide { display: flex; align-items: center; gap: 24px; }
.xy-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.03em; }
.xy-logo img, .xy-logo svg { width: 28px; height: 28px; }
.xy-logo .word { display: inline-flex; align-items: baseline; }
.xy-logo .x { color: transparent; background: linear-gradient(135deg, var(--ether) 45%, var(--xync) 55%); -webkit-background-clip: text; background-clip: text; }
.xy-nav { display: flex; gap: 4px; margin-left: 12px; }
.xy-nav a { position: relative; height: 38px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-pill); color: var(--text-2); font-weight: 600; font-size: .95rem; transition: color var(--d-2), background-color var(--d-2); }
.xy-nav a:hover { color: var(--text); background-color: rgba(255,255,255,0.05); }
.xy-nav a[aria-current="page"] { color: var(--text); }
.xy-nav a[aria-current="page"]:hover { background-color: transparent; }
/* 지금 있는 곳: 민트와 코랄 두 줄기가 가운데 흰 점에서 엇갈리는 짧은 실 */
.xy-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: max(calc(100% - 14px), 38px); height: 6px; transform: translateX(-50%); pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 1.4px, rgba(255, 255, 255, 0) 2.4px) center / 7px 7px no-repeat,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8' preserveAspectRatio='none'><defs><linearGradient id='e' x1='0' x2='1'><stop offset='0' stop-color='%2363F2D2' stop-opacity='0'/><stop offset='.38' stop-color='%2363F2D2'/><stop offset='.62' stop-color='%2363F2D2' stop-opacity='.45'/><stop offset='1' stop-color='%2363F2D2' stop-opacity='0'/></linearGradient><linearGradient id='x' x1='0' x2='1'><stop offset='0' stop-color='%23FF8A66' stop-opacity='0'/><stop offset='.38' stop-color='%23FF8A66' stop-opacity='.45'/><stop offset='.62' stop-color='%23FF8A66'/><stop offset='1' stop-color='%23FF8A66' stop-opacity='0'/></linearGradient></defs><path d='M1 7C18 7 22 4 30 4S42 1 59 1' fill='none' stroke='url(%23e)' stroke-width='1.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/><path d='M1 1C18 1 22 4 30 4S42 7 59 7' fill='none' stroke='url(%23x)' stroke-width='1.6' stroke-linecap='round' vector-effect='non-scaling-stroke'/></svg>") center / 100% 100% no-repeat;
}
.xy-nav a .soon { font-size: .7rem; font-weight: 650; color: var(--xync); margin-left: 6px; letter-spacing: 0; }
.xy-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.xy-user { position: relative; }
.xy-user-btn { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 6px 0 6px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); }
.xy-user-btn .name { font-weight: 650; font-size: .92rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.xy-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 8px;
  background: var(--surface-raised); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity var(--d-2), transform var(--d-2) var(--ease-out);
}
.xy-menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.xy-menu a, .xy-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); border: 0; background: none; color: var(--text-2); font-size: .94rem; font-weight: 550; text-align: left; }
.xy-menu a:hover, .xy-menu button:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.xy-menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 4px; }
.xy-burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; align-items: center; justify-content: center; }
.xy-burger span { display: block; width: 18px; height: 1.5px; background: var(--text); position: relative; }
.xy-burger span::before, .xy-burger span::after { content: ""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--text); transition: transform var(--d-2); }
.xy-burger span::before { top: -6px; } .xy-burger span::after { top: 6px; }
.xy-burger[aria-expanded="true"] span { background: transparent; }
.xy-burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.xy-burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
/* 휴대폰 메뉴: 열릴 때 살짝 내려오며 나타나고(@starting-style), 메뉴 줄이 차례로 따라온다.
   지원하지 않는 브라우저는 지금처럼 바로 열린다 */
.xy-drawer {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99; background: rgba(7,10,15,.97); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  padding: 24px 20px 40px; display: none; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateY(-8px);
  transition: opacity var(--d-2) var(--ease-out), transform var(--d-3) var(--ease-expo);
  transition: opacity var(--d-2) var(--ease-out), transform var(--d-3) var(--ease-expo), display var(--d-2) allow-discrete;
}
.xy-drawer.is-open { display: block; opacity: 1; transform: none; }
.xy-drawer nav a { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 4px; border-bottom: 1px solid var(--line); font-size: 1.5rem; font-weight: 750; letter-spacing: -0.02em; color: var(--text-2); transition: opacity var(--d-3) var(--ease-out), transform var(--d-3) var(--ease-expo), color var(--d-2); }
.xy-drawer nav a:hover, .xy-drawer nav a[aria-current="page"] { color: var(--text); }
.xy-drawer nav a[aria-current="page"] { position: relative; }
.xy-drawer nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--spark); box-shadow: -3px 0 0 -1px var(--ether), 3px 0 0 -1px var(--xync);
}
.xy-drawer nav a small { font-family: var(--f-serif); font-style: italic; font-size: 1.15rem; color: var(--text-3); letter-spacing: 0; font-weight: 400; }
.xy-drawer nav a:nth-child(2) { transition-delay: 30ms; }
.xy-drawer nav a:nth-child(3) { transition-delay: 60ms; }
.xy-drawer nav a:nth-child(4) { transition-delay: 90ms; }
.xy-drawer nav a:nth-child(5) { transition-delay: 120ms; }
.xy-drawer nav a:nth-child(6) { transition-delay: 150ms; }
@starting-style {
  .xy-drawer.is-open { opacity: 0; transform: translateY(-8px); }
  .xy-drawer.is-open nav a { opacity: 0; transform: translateY(10px); }
}
@media (max-width: 960px) {
  .xy-nav { display: none; }
  .xy-burger { display: inline-flex; }
  .xy-actions .hide-sm { display: none; }
}

/* ---------- 공지 띠: 관리 화면(사이트 설정)에서 켜고 끈다. 머리 위에 붙는다 ---------- */
.xy-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 101;
  background: linear-gradient(90deg, rgba(99,242,210,.09), rgba(99,242,210,.03) 45%, rgba(99,242,210,.09)), #0A1017;
  border-bottom: 1px solid var(--line);
  font-size: .9rem; line-height: 1.45;
}
.xy-banner.is-xync { background: linear-gradient(90deg, rgba(255,138,102,.10), rgba(255,138,102,.035) 45%, rgba(255,138,102,.10)), #110D0D; }
.xy-banner::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 8%, var(--ether) 35%, var(--spark) 50%, var(--xync) 65%, transparent 92%);
  opacity: .5;
}
.xy-banner .wrap-wide { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; padding: 7px 48px; }
.xy-banner-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ether); }
.xy-banner.is-xync .xy-banner-dot { background: var(--xync); }
.xy-banner-text { min-width: 0; color: var(--text); font-weight: 560; letter-spacing: -0.005em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
a.xy-banner-text { text-decoration: underline; text-decoration-color: rgba(234,240,247,.28); text-underline-offset: 4px; transition: text-decoration-color var(--d-2); }
a.xy-banner-text:hover { text-decoration-color: currentColor; }
.xy-banner-close {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--text-3);
  display: grid; place-items: center; transition: color var(--d-2), background var(--d-2);
}
.xy-banner-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
@media (max-width: 640px) {
  .xy-banner { font-size: .86rem; }
  .xy-banner .wrap-wide { justify-content: flex-start; min-height: 44px; padding: 8px 44px 8px 0; }
  .xy-banner-close { width: 44px; height: 44px; right: -6px; }
}

/* ---------- footer ---------- */
.xy-footer { border-top: 1px solid var(--line); padding: 72px 0 40px; margin-top: 40px; position: relative; overflow: hidden; }
.xy-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.xy-footer h4 { font-size: .86rem; letter-spacing: 0; color: var(--text-3); font-weight: 650; margin-bottom: 14px; }
.xy-footer ul { list-style: none; display: grid; gap: 10px; }
.xy-footer a { color: var(--text-2); font-size: .95rem; }
.xy-footer a:hover { color: var(--text); }
.xy-footer .motto { font-family: var(--f-serif); font-style: italic; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; margin: 18px 0 12px; }
.xy-footer .bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: .85rem; }
@media (max-width: 860px) { .xy-footer .cols { grid-template-columns: 1fr 1fr; } .xy-footer .brand { grid-column: 1 / -1; } }

/* ---------- toast ---------- */
.xy-toasts { position: fixed; z-index: 400; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; width: min(92vw, 420px); }
.xy-toast { padding: 14px 18px; border-radius: var(--r-md); background: var(--surface-toast); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); font-size: .95rem; display: flex; gap: 12px; align-items: flex-start; animation: xy-in var(--d-3) var(--ease-out); }
.xy-toast::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--ether); }
.xy-toast.is-err::before { background: var(--err); }
.xy-toast.is-xync::before { background: var(--xync); }
@keyframes xy-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.xy-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(3,5,8,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: xy-fade var(--d-2); }
.xy-modal .box { width: min(100%, 460px); background: var(--surface-raised); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 32px; box-shadow: var(--shadow-2); animation: xy-in var(--d-3) var(--ease-out); }
@keyframes xy-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- member gate ---------- */
.xy-gate { position: relative; }
.xy-gate.is-pending > .gate-body { visibility: hidden; }
.xy-gate.is-locked > .gate-body { filter: blur(7px); opacity: .45; pointer-events: none; user-select: none; min-height: 42vh; max-height: 70vh; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 20%, transparent 95%); mask-image: linear-gradient(#000 20%, transparent 95%); }
.gate-card {
  position: relative; z-index: 2; margin: -38vh auto 0; width: min(100% - 32px, 520px); text-align: center;
  background: var(--surface-gate); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 36px 28px;
  box-shadow: var(--shadow-2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.gate-card .lock { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ether-dim); color: var(--ether); }
.gate-card h3 { font-size: 1.4rem; margin-bottom: 10px; }
.gate-card p { color: var(--text-2); margin-bottom: 22px; }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--text-2); }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.08), rgba(255,255,255,.04)); background-size: 200% 100%; animation: xy-shimmer 1.4s infinite linear; border-radius: var(--r-sm); }
@keyframes xy-shimmer { to { background-position: -200% 0; } }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out); transition-delay: var(--delay, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 페이지 사이 이동(cross-document View Transitions) ----------
   같은 사이트 안에서 옮겨 갈 때 본문은 짧게 겹쳐 사라지고 나타난다(약 260ms, 지수형 감속).
   머리(메뉴 줄)는 제자리에서 바뀐 곳만 스민다. 책 표지(view-transition-name: cover-<slug>)는
   페이지끼리 이어져 자리를 옮긴다(이름은 홈·라이브러리가 단다. 시간·감속은 아래 group(*) 기본값).
   이 규칙은 사이트에서 여기 한 곳에만 둔다. 지원하지 않는 브라우저와 움직임 줄이기는 바로 이동 */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.xy-header { view-transition-name: xy-header; }
::view-transition-group(*) { animation-duration: var(--d-3); animation-timing-function: var(--ease-expo); }
::view-transition-group(root), ::view-transition-group(xy-header) { animation-duration: 260ms; }
::view-transition-group(xy-header) { z-index: 2; }   /* 표지가 머리 위로 그려지지 않게 */
::view-transition-old(root) { animation: xy-vt-out 170ms var(--ease-out) both; }
::view-transition-new(root) { animation: xy-vt-in 260ms var(--ease-expo) both; }
@keyframes xy-vt-out { to { opacity: 0; } }
@keyframes xy-vt-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: xy-marquee 40s linear infinite; }
@keyframes xy-marquee { to { transform: translateX(-50%); } }

/* ---------- utilities ---------- */
.center { text-align: center; }
.mt-1 { margin-top: var(--s-2); } .mt-2 { margin-top: var(--s-4); } .mt-3 { margin-top: var(--s-5); } .mt-4 { margin-top: var(--s-6); } .mt-5 { margin-top: var(--s-7); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  /* 사용자 행동에 대한 응답도 이동 없이 투명도만 */
  .btn:active { transform: none; opacity: .82; }
  .xy-drawer, .xy-drawer nav a { transform: none !important; }
}
