@font-face {
  font-family: "Puzzlog Hand";
  src: url("/puzzlog-brand.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1d1c17;
  --ink-muted: #4a473b;
  --surface: #fef9f1;
  --surface-raised: #ffffff;
  --surface-card: #f8f3eb;
  --line: #e7e2da;
  --accent: #fff3b0;
  --accent-ink: #675f2b;
  --support: #dcebe2;
  --support-ink: #285541;
  --focus: #1667c5;
  --max-width: 1080px;
  --doc-width: 700px;
  font-family:
    "Plus Jakarta Sans", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: var(--surface-raised);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  width: 24px;
  height: 26px;
  color: var(--accent-ink);
}

.site-menu {
  margin-left: auto;
}

.site-menu__toggle {
  display: none;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.site-nav a {
  min-height: 44px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-card);
}

.site-nav a[aria-current="page"] {
  color: var(--support-ink);
  background: var(--support);
}

.document-shell {
  width: min(calc(100% - 40px), var(--doc-width));
  margin: 0 auto;
  padding: 56px 0 104px;
}

.document {
  min-width: 0;
}

.document__eyebrow {
  margin: 0 0 14px;
  color: var(--support-ink);
  font-size: 12px;
  font-weight: 800;
}

.document h1 {
  max-width: 15ch;
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
}

.document__summary {
  max-width: 32em;
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: 20px;
  line-height: 1.65;
}

.document__meta {
  margin: 28px 0 0;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

.draft-note {
  margin: 32px 0 0;
  padding: 18px 20px;
  border-left: 4px solid var(--support-ink);
  background: var(--support);
  color: var(--support-ink);
  font-size: 14px;
}

.document__content {
  margin-top: 48px;
}

.document-section {
  padding: 0 0 40px;
}

.document-section + .document-section {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.document-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.4;
}

.document-section p {
  margin: 0;
  color: var(--ink-muted);
}

.document-section p + p {
  margin-top: 12px;
}

.document-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-section li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-muted);
}

.document-section li + li {
  margin-top: 10px;
}

.document-section li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 7px;
  height: 7px;
  border: 2px solid var(--accent-ink);
  background: var(--accent);
  transform: translateY(-50%);
}

.contact-action {
  margin: 0 0 48px;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-action p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.contact-action a {
  min-height: 44px;
  padding: 10px 16px;
  flex: 0 0 auto;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 20%, transparent);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.contact-action--unavailable {
  align-items: flex-start;
}

.contact-action--unavailable strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.document-directory {
  width: min(calc(100% - 40px), 820px);
  margin: 0 auto;
  padding: 72px 0 112px;
}

.directory-intro {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.directory-intro h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.25;
}

.directory-intro p {
  max-width: 34em;
  margin: 16px 0 0;
  color: var(--ink-muted);
  font-size: 18px;
}

.directory-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.directory-list li {
  border-bottom: 1px solid var(--line);
}

.directory-list a {
  min-height: 88px;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 20px;
  text-decoration: none;
}

.directory-list__index {
  color: var(--support-ink);
  font-size: 12px;
  font-weight: 800;
}

.directory-list strong {
  display: block;
  font-size: 18px;
}

.directory-list small {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 13px;
}

.directory-list__arrow {
  color: var(--accent-ink);
  font-size: 22px;
}

.invite-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.invite-page {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--surface);
}

.invite-screen {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Puzzlog Hand", "Apple SD Gothic Neo", sans-serif;
  font-synthesis: none;
}

.invite-safe-area {
  width: 100%;
  height: max(62px, env(safe-area-inset-top));
  flex-shrink: 0;
}

.invite-hero {
  width: 100%;
  min-height: 0;
  padding: 0 24px;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.invite-mark {
  width: 104px;
  height: 104px;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  background: var(--accent);
}

.invite-mark img {
  width: 52px;
  height: 52px;
}

.invite-copy {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.invite-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 400;
  line-height: 40px;
  letter-spacing: -0.01em;
}

.invite-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 22px;
}

.invite-code-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.invite-code {
  max-width: 100%;
  height: 52px;
  padding: 0 16px 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 10%, transparent);
  border-radius: 999px;
  background: var(--surface-card);
}

.invite-code[hidden] {
  display: none;
}

.invite-code code {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 20px;
  line-height: 26px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-code button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  color: var(--accent-ink);
  background: transparent;
  cursor: pointer;
}

.invite-code button:hover,
.invite-code button[data-copied="true"] {
  background: var(--accent);
}

.invite-code button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invite-status {
  min-height: 22px;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
  text-align: center;
}

.invite-store-buttons {
  width: 100%;
  padding: 0 24px max(48px, env(safe-area-inset-bottom));
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 12px;
}

.invite-store-button {
  width: 100%;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #111;
  font: inherit;
  font-size: 16px;
  line-height: 21px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.invite-store-button:hover {
  background: #282828;
}

.invite-store-button:active {
  transform: translateY(1px);
}

.invite-store-button svg {
  flex-shrink: 0;
  fill: currentColor;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-card);
}

.site-footer__inner {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 104px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-muted);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

@media (max-width: 760px) {
  .site-header__inner {
    min-height: 64px;
  }

  .brand {
    font-size: 22px;
  }

  .site-menu {
    position: relative;
  }

  .site-menu__toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
  }

  .site-menu__toggle:hover,
  .site-menu[data-open="true"] .site-menu__toggle {
    background: var(--surface-card);
  }

  .site-menu__icon {
    width: 22px;
    display: grid;
    gap: 5px;
  }

  .site-menu__icon i {
    width: 22px;
    height: 2px;
    display: block;
    border-radius: 1px;
    background: currentColor;
    transition:
      transform 160ms ease,
      opacity 160ms ease;
  }

  .site-menu[data-open="true"] .site-menu__icon i:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .site-menu[data-open="true"] .site-menu__icon i:nth-child(2) {
    opacity: 0;
  }

  .site-menu[data-open="true"] .site-menu__icon i:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-menu[data-open="false"] > .site-nav {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
    box-shadow: 0 18px 40px rgb(41 38 28 / 14%);
  }

  .site-nav ul {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav a {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 5px;
    font-size: 14px;
  }

  .site-nav a[aria-current="page"] {
    border-left: 3px solid var(--support-ink);
  }

  .document-shell {
    padding-top: 40px;
  }

  .document h1,
  .directory-intro h1 {
    font-size: 32px;
  }

  .document__summary {
    font-size: 18px;
  }

  .contact-action {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-action a {
    width: 100%;
    text-align: center;
  }

  .document-directory {
    padding-top: 48px;
  }

  .directory-list a {
    grid-template-columns: 32px 1fr auto;
    gap: 12px;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-height: 700px) {
  .invite-safe-area {
    height: max(20px, env(safe-area-inset-top));
  }

  .invite-hero {
    gap: 18px;
  }

  .invite-mark {
    width: 84px;
    height: 84px;
    border-radius: 26px;
  }

  .invite-mark img {
    width: 42px;
    height: 42px;
  }

  .invite-store-buttons {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
