/*
 * 코딩바이브 — 디자인 컨셉 2 "한 색": 흰 바탕, 검은 글자, 파랑 한 색, IBM Plex Sans KR.
 * 삽화는 같은 화풍(검은 선 + 파랑 한두 곳)이라 흰 바탕에 그대로 얹는다. 색은 아래 변수에만 둔다.
 * 모바일(760px 아래)은 한 줄로 쌓고, 첫 화면 삽화는 제목과 칩 사이로 온다.
 */
:root {
  --bg: #FFFFFF;
  --ink: #111111;
  --ink-soft: #333336;
  --muted: #5A5A5F;
  --line: #E3E3E3;
  --soft: #F5F5F4;
  --accent: #2C3BFF;
  --accent-dark: #1E2BD1;
  --alert: #B42318;
  --font: "IBM Plex Sans KR", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

/* hidden 은 display 를 준 요소에서도 숨긴다 (stone-groupwear 에서 전화 버튼이 다 보인 일) */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a { color: var(--ink); font-weight: 500; text-underline-offset: 4px; }
a:hover { color: var(--accent); }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

/* 머리글 */
.topbar { border-bottom: 1px solid var(--line); }
.topbar__inner {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.wordmark { font-size: 17px; font-weight: 700; text-decoration: none; }
.topbar__link { font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; }
.topbar__nav { display: flex; gap: 20px; }

.flash {
  margin-block: 16px 0;
  padding-block: 12px;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}
.flash--alert { color: var(--alert); }

/* 버튼 */
.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  background: #FFFFFF;
  color: #1F1F1F;
  border: 1px solid #747775;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.google-button:hover { background: #F8F9FA; color: #1F1F1F; }
.google-button:focus-visible { outline: 3px solid rgba(66, 133, 244, 0.4); outline-offset: 2px; }
.google-button--small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.google-button--off { color: var(--muted); border-style: dashed; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.button:hover { background: var(--accent-dark); color: #FFFFFF; }

.text-button {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.text-button:hover { color: var(--accent); }

/* 첫 화면 — 넓으면 왼쪽 글·오른쪽 삽화, 좁으면 한 줄로 (삽화는 제목 아래) */
.hero {
  padding-block: clamp(40px, 7vw, 104px) 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas:
    "eyebrow art"
    "title   art"
    "chips   art"
    "lead    art"
    "actions art";
  column-gap: 48px;
  row-gap: 28px;
  align-items: start;
}

.hero__eyebrow { grid-area: eyebrow; margin: 0; font-size: 15px; font-weight: 500; color: var(--muted); }

.hero__title {
  grid-area: title;
  margin: 0;
  font-size: clamp(40px, 6.4vw, 88px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.hero__blank {
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.12em;
}
.hero__blank:focus-visible { outline: 3px solid rgba(44, 59, 255, 0.35); outline-offset: 4px; border-radius: 4px; }

.hero__art {
  grid-area: art;
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 460px;
  margin: 0;
}
.hero__art img { width: 100%; aspect-ratio: 1; }

.chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 0 20px; }

.chip {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.hero__lead {
  grid-area: lead;
  margin: 0;
  max-width: 620px;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.75;
  color: var(--ink-soft);
}

.hero__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  font-size: 16px;
}

/* 모임에서 하는 일 */
.about { padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.about__label { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.about__item {
  border-top: 1px solid var(--ink);
  padding-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
}
.about__art { width: 200px; aspect-ratio: 1; margin-bottom: 4px; }
.about__num { font-size: 14px; font-weight: 600; color: var(--accent); }
.about__item h3 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.about__item p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink-soft); }

/* 발표자료 — 넓으면 왼쪽 표지·오른쪽 글, 좁으면 표지 아래 글 */
.talk { padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.talk__card {
  border-top: 1px solid var(--ink);
  padding-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.talk__cover { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.talk__cover:hover { border-color: var(--accent); }
.talk__cover img { width: 100%; }
.talk__text { display: flex; flex-direction: column; gap: 12px; }
.talk__meta { margin: 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.talk__text h3 { margin: 0; font-size: clamp(28px, 3vw, 36px); font-weight: 700; letter-spacing: -0.03em; }
.talk__text p:not(.talk__meta) { margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink-soft); }
.talk__actions { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; font-size: 16px; }

/* 참여 방법 */
.join { background: var(--soft); border-top: 1px solid var(--line); }
.join__inner {
  padding-block: 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-end;
  justify-content: space-between;
}
.join__text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 16px; }
.join__text h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; }
.join__text ol {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 17px;
  line-height: 1.6;
}

.footer {
  padding-block: 24px max(32px, env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: inherit; font-weight: 400; }

/* 회원 공간·안내 문서 */
.page { padding-block: clamp(40px, 7vw, 96px) 80px; display: flex; flex-direction: column; gap: 20px; max-width: 760px; margin-inline: 0; }
.page__title { margin: 0; font-size: clamp(36px, 5vw, 56px); font-weight: 700; line-height: 1.2; letter-spacing: -0.04em; }
.page .hero__lead { max-width: none; }

.doc { font-size: 16px; line-height: 1.75; gap: 16px; }
.doc h2 { margin: 20px 0 0; font-size: 20px; font-weight: 700; }
.doc p, .doc ul { margin: 0; }
.doc ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* 태블릿 — 하는 일 세 칸을 한 줄씩, 삽화는 왼쪽 */
@media (max-width: 1024px) {
  .about__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .about__item {
    grid-template-columns: 160px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 28px;
    padding-block: 24px;
  }
  .about__art { width: 160px; grid-row: 1 / span 3; margin: 0; }
}

/* 모바일 — 한 줄로 쌓는다 */
@media (max-width: 760px) {
  .topbar__inner { min-height: 60px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "eyebrow" "title" "art" "chips" "lead" "actions";
    row-gap: 20px;
    padding-block: 32px 56px;
  }
  .hero__eyebrow { font-size: 14px; }
  .hero__art { justify-self: center; max-width: 240px; }
  .chips { gap: 0 16px; }
  .chip { font-size: 16px; }
  .hero__actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero__actions > a:not(.google-button):not(.button) { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; }

  .about { padding-bottom: 56px; }
  .about__item { grid-template-columns: 96px minmax(0, 1fr); column-gap: 16px; padding-block: 20px; }
  .about__art { width: 96px; }
  .about__item h3 { font-size: 20px; }
  .about__item p { font-size: 15px; }

  .talk { padding-bottom: 56px; }
  .talk__card { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .talk__text p:not(.talk__meta) { font-size: 15px; }
  .talk__actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .talk__actions > a:not(.button) { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; }

  .join__inner { padding-block: 48px; flex-direction: column; align-items: stretch; }
  .join__text { flex-basis: auto; }
  .join .google-button, .join .button { width: 100%; }
}

/* 안내 띠·폼 (닉네임) */
.notice {
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border-left: 3px solid var(--accent);
  font-size: 16px;
  line-height: 1.65;
}
.form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.form__label { font-size: 15px; font-weight: 600; }
.form__input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #8A8A90;
  border-radius: 6px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: #FFFFFF;
}
.form__input:focus-visible { outline: 3px solid rgba(44, 59, 255, 0.35); outline-offset: 1px; border-color: var(--accent); }
.form__input[aria-invalid="true"] { border-color: var(--alert); }
.form__help { margin: 0; font-size: 14px; color: var(--muted); }
.form__error { margin: 0; font-size: 14px; color: var(--alert); }
.form__actions { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* 회원 목록 */
.members { padding-block: clamp(32px, 6vw, 72px) 80px; display: flex; flex-direction: column; gap: 24px; }
.members__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.members__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.member__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.member__name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.member__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.member__badge--me { border-color: var(--line); color: var(--muted); }
.member__actions { display: flex; gap: 8px; }
.member__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 76px;
  padding: 0 16px;
  background: #FFFFFF;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.member__action:hover { border-color: var(--accent); color: var(--accent); }
.member__action[disabled] { border-color: var(--line); color: #9A9AA0; cursor: not-allowed; }
.members__empty { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .member__actions { width: 100%; }
  .member__action { flex: 1 1 0; }
}

.members__count { margin: 0; font-size: 15px; color: var(--muted); }

/* 스톤콜 가입 안내 */
.invite {
  padding: 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.invite__title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.invite__body { margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink-soft); }
.invite__actions { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.invite__actions form { display: contents; }
.invite__existing { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.invite__row { display: flex; flex-wrap: wrap; gap: 8px; }
.invite__row .form__input { flex: 1 1 200px; min-width: 0; }

/* 1:1 대화 */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 69px); }
.chat__head {
  padding-block: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.chat__back { font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; }
.chat__who { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat__name { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.chat__hint { margin: 12px auto 0; font-size: 14px; color: var(--muted); }
.chat__list {
  flex: 1 1 auto;
  padding-block: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat__empty { margin: auto 0; text-align: center; color: var(--muted); }

.bubble { max-width: min(560px, 82%); display: flex; flex-direction: column; gap: 4px; }
.bubble--mine { align-self: flex-end; align-items: flex-end; }
.bubble--theirs { align-self: flex-start; align-items: flex-start; }
.bubble__text {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.55;
  white-space: normal;
}
.bubble--mine .bubble__text { background: var(--accent); color: #FFFFFF; border-bottom-right-radius: 4px; }
.bubble--theirs .bubble__text { background: var(--soft); color: var(--ink); border-bottom-left-radius: 4px; }
a.bubble__text { text-decoration: underline; }
.bubble--mine a.bubble__text:hover { color: #FFFFFF; }
.bubble__time { font-size: 12px; color: var(--muted); }

.chat__composer {
  position: sticky;
  bottom: 0;
  padding-block: 12px max(12px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat__input {
  flex: 1 1 auto;
  min-height: 48px;
  max-height: 160px;
  padding: 12px 14px;
  border: 1px solid #8A8A90;
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
}
.chat__input:focus-visible { outline: 3px solid rgba(44, 59, 255, 0.35); outline-offset: 1px; border-color: var(--accent); }
.chat__send { flex: 0 0 auto; }
.chat__status { margin: 0; min-height: 0; font-size: 14px; color: var(--alert); }
.chat__status:empty { display: none; }

/* 웹 전화 패널 */
.webphone__panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(360px, calc(100vw - 32px));
  padding: 20px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.16);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.webphone__who { display: flex; align-items: center; gap: 12px; }
.webphone__names { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.webphone__names strong { font-size: 20px; letter-spacing: -0.02em; }
.webphone__names span { font-size: 14px; color: var(--muted); }
.webphone__timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.webphone__actions { display: flex; gap: 10px; }
.webphone__actions > * { flex: 1 1 0; }
.webphone__danger {
  min-height: 48px;
  padding: 0 20px;
  background: var(--alert);
  color: #FFFFFF;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 760px) {
  .topbar__nav { gap: 14px; }
  .chat { min-height: calc(100dvh - 61px); }
  .chat__name { font-size: 21px; }
  .chat__head .member__action { flex: 0 0 auto; }
  .bubble { max-width: 88%; }
  .webphone__panel { left: 16px; right: 16px; width: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* 내 정보 */
.facts { margin: 8px 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 15px; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-size: 16px; line-height: 1.6; }
@media (max-width: 760px) { .facts > div { grid-template-columns: minmax(0, 1fr); } }
