/* 메인 페이지 — 한 화면에 한 가지 이야기 */

/* 휴대폰 메뉴 */
.menu-btn { display: none; background: none; border: 0; padding: 8px 0 8px 12px; font: inherit; font-size: 14px; color: var(--soft); cursor: pointer; }
.menu-panel { border-top: 1px solid var(--hair); background: var(--paper); }
.menu-panel .wrap { display: grid; padding-block: 6px 14px; }
.menu-panel a { padding: 12px 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--hair); }
.menu-panel a:last-child { border-bottom: 0; }

/* 화면 한 장 */
.screen { padding-block: 88px; }
.screen .wrap { display: grid; gap: 28px; justify-items: start; }
.screen-title { font-size: var(--t-title); }
.screen .list { width: 100%; }

/* 1. 첫 화면 */
/* 1. 첫 화면 — 유튜브 채널아트(근쌤의 서재)를 화면 가득, 가운데 남색 벽 위에 글 */
.hero { position: relative; isolation: isolate; min-height: min(calc(100svh - 60px), 660px); display: grid; place-items: center; padding-block: 56px 72px; overflow: hidden; background: #0B1838; color: var(--white); }
.hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }

.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 52% at 46% 42%, rgba(9, 20, 52, .55), transparent 72%), linear-gradient(180deg, rgba(9, 20, 52, .15), rgba(9, 20, 52, .35)); }
.hero-inner.wrap { display: grid; gap: 14px; justify-items: center; text-align: center; }
.portrait { width: clamp(96px, 11vw, 128px); aspect-ratio: 1; border-radius: 50%; background: var(--paper-deep); overflow: hidden; position: relative; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
.portrait img { position: absolute; left: 50%; bottom: -46%; width: 92%; height: auto; transform: translateX(-50%); }
.who { font-size: 15px; color: rgba(255, 255, 255, .78); }
.who b { color: var(--white); }
.hero-title { font-size: clamp(44px, 8vw, 92px); line-height: 1.08; color: var(--white); text-shadow: 0 2px 24px rgba(5, 12, 36, .35); }
.hero-sub { font-size: clamp(17px, 2.2vw, 22px); color: #A9D8FF; font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.btn-sun { background: var(--sun-btn); color: var(--ink); }
.btn-sun:hover { background: #FFC58A; }
.btn-ghost { background: rgba(255, 255, 255, .10); color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.btn-ghost:hover { background: rgba(255, 255, 255, .2); }

/* 2. 숫자로 보기 — 한 묶음은 같은 글씨로 한 줄 (숫자만 색) */
.stats { background: var(--white); border-bottom: 1px solid var(--hair); }
.stat-list { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-list li + li { border-left: 1px solid var(--hair); }
.stat-list a { display: block; padding: 20px 8px; text-align: center; text-decoration: none; font-size: 17px; font-weight: 700; white-space: nowrap; }
.stat-list b { color: var(--sky); }
.stat-list a:hover { color: var(--sky); }

/* 3. 한 판 — 칸마다 파스텔 카드, 노트북에서는 두 줄로 나란히 */
.board { display: grid; gap: 16px; padding-block: 28px 40px; }
.panel { border-radius: 18px; padding: 22px 24px; display: grid; gap: 12px; align-content: start; min-width: 0; scroll-margin-top: 76px; }
.panel--made { background: var(--pastel-sky); }
.panel--writing { background: var(--pastel-peach); }
.panel--youtube { background: #FFF0F0; }
.panel--lectures { background: var(--pastel-mint); }
#contact { background: var(--pastel-lavender); }
.panel-title { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(14, 30, 70, .08); font-family: var(--f-body); font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.panel .list, .panel .list > li, .tabs { border-color: var(--hair-tint); }
.panel .row { padding: 10px 0; font-size: 15px; }
.panel .row img { width: 30px; height: 30px; border-radius: 8px; }
.panel .tab-panels, .panel .tab-panel { gap: 12px; }
.panel .list { width: 100%; }
.panel .row-name { word-break: keep-all; }

/* 만든 앱 — 작은 타일 */
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--white); border: 1px solid var(--hair-tint); border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 15px; min-width: 0; transition: transform .15s ease, box-shadow .15s ease; }
.tile img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.tile span { min-width: 0; word-break: keep-all; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -12px rgba(14, 30, 70, .35); color: var(--sky); }
.tab-panel .tile-grid { width: 100%; }
.tile-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 유튜브 — 썸네일 카드 */
.video-grid { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.video { display: grid; gap: 8px; text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.45; }
.video img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: rgba(14, 30, 70, .08); transition: transform .15s ease, box-shadow .15s ease; }
.video span { word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video:hover img { transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgba(14, 30, 70, .45); }
.video:hover span { color: var(--sky); }
.tab .count { margin-left: 4px; height: 20px; min-width: 22px; font-size: 12px; }
.screen .list, .screen .list > li, .tabs { border-color: var(--hair-tint); }

/* 위쪽 메뉴의 협업 신청 버튼 */
.topnav .nav-cta, .topbar-mobile .nav-cta { background: var(--ink); color: var(--white); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; text-decoration: none; }
.topnav .nav-cta:hover { background: var(--m-dark); color: var(--white); }
.topnav { align-items: center; }
.topbar-mobile { display: none; align-items: center; gap: 4px; }

/* 3. 쓴 글 — 탭 (JS가 없으면 탭 줄은 숨기고 두 목록을 모두 보여 줌) */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--hair); width: 100%; }
.tab { background: none; border: 0; padding: 0 0 10px; margin-bottom: -1px; font: inherit; font-size: 15px; font-weight: 700; color: var(--soft); cursor: pointer; border-bottom: 2px solid transparent; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panels, .tab-panel { display: grid; gap: 28px; width: 100%; justify-items: start; }
.tabs-ready .tab-panel .list { border-top: 0; }

/* 4. 강의 — 강사 이력 (평소엔 접힘) */
.career { width: 100%; }
.career summary { list-style: none; cursor: pointer; color: var(--sky); font-weight: 700; font-size: 14px; width: fit-content; }
.career summary::-webkit-details-marker { display: none; }
.career summary::after { content: " ↓"; }
.career[open] summary::after { content: " ↑"; }
.career-body { display: grid; gap: 12px; margin-top: 22px; }
.career-h { font-family: var(--f-body); font-weight: 700; font-size: 13px; color: var(--soft); letter-spacing: 0; margin-top: 10px; }
.career .row { padding: 11px 0; }
.career .row-name { font-size: 15px; font-weight: 400; }

/* 2. 만든 것 — 접힌 목록 */
.app-list.is-collapsed .extra { display: none; }

/* 5. 함께 일하기 */
.contact { padding-bottom: 56px; }
.contact-inner.wrap { gap: 18px; }
.contact .btn { margin-top: 6px; }
.email-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.email { font-family: var(--f-mono); font-size: 15px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--hair); user-select: all; }
.email:hover { color: var(--sky); border-bottom-color: var(--sky); }
.copy-btn { background: none; border: 1px solid var(--hair); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; color: var(--soft); cursor: pointer; }
.copy-btn:hover { color: var(--ink); border-color: var(--soft); }
/* 유튜브·브런치 바로가기 — 로고가 들어간 큰 링크 버튼 */
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; width: 100%; max-width: 560px; margin-top: 14px; }
.channel { display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 14px; background: var(--white); border: 1px solid var(--hair-tint); border-radius: 16px; text-decoration: none; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; min-width: 0; }
.channel:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(14, 30, 70, .35); border-color: rgba(14, 30, 70, .2); }
.channel-logo { width: 44px; height: 44px; border-radius: 11px; flex: none; display: grid; place-items: center; position: relative; overflow: hidden; }
.channel-logo--yt { background: #FFF0F2; }
.channel-logo--brunch { background: #3A3A4A; }
.channel-logo--ig { background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FD5949 45%, #D6249F 60%, #285AEB 90%); }
.channel-logo--brunch img { position: absolute; inset: 0; width: 100%; height: 100%; }
.channel-logo-fallback { color: #fff; font-family: Georgia, serif; font-style: italic; font-size: 24px; }
.channel-text { display: grid; gap: 1px; min-width: 0; }
.channel-text b { font-size: 16px; }
.channel-text small { font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-arrow { margin-left: auto; color: var(--soft); font-size: 16px; }
.channel:hover .channel-arrow { color: var(--ink); }
@media (max-width: 600px) { .channels { grid-template-columns: minmax(0, 1fr); } }

/* 스크롤하면 살짝 떠오름 — 기본은 보이는 상태 */
.reveal.is-pending .wrap { transform: translateY(18px); opacity: .35; }
.reveal .wrap { transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .7s ease; }

/* 노트북 */
@media (min-width: 860px) {
  .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "made made" "youtube youtube" "lectures writing"; align-items: start; padding-block: 40px 56px; }
  .panel--made { grid-area: made; } .panel--youtube { grid-area: youtube; } .panel--writing { grid-area: writing; } .panel--lectures { grid-area: lectures; }
  .panel { padding: 26px 30px; }
  .screen { padding-block: 72px; }
  .screen .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: start; }
  .screen .wrap > .screen-title { grid-row: span 3; position: sticky; top: 100px; }
  .screen .wrap > :not(.screen-title) { grid-column: 2; }
  /* 첫 화면·연락 화면은 한 줄로 쌓기 */
  .screen .hero-inner.wrap, .screen .contact-inner.wrap { grid-template-columns: minmax(0, 1fr); }
  .screen .hero-inner.wrap > *, .screen .contact-inner.wrap > * { grid-column: 1; grid-row: auto; }
  .screen .contact-inner.wrap > .screen-title { position: static; }
  /* 연락 칸: 왼쪽 제목·버튼·메일, 오른쪽 채널 세 개 */
  .screen .contact-inner.wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); column-gap: 64px; align-items: center; }
  .screen .contact-inner.wrap > .channels { grid-column: 2; grid-row: 1 / span 3; grid-template-columns: minmax(0, 1fr); margin-top: 0; max-width: none; }
  .contact.screen { padding-block: 56px; }
}

/* 휴대폰 */
@media (max-width: 640px) {
  .topnav { display: none; }
  .menu-btn { display: block; }
  .topbar-mobile { display: flex; }
  .screen { padding-block: 48px; }
  .stat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-list li:nth-child(3) { border-left: 0; }
  .stat-list li:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .stat-list a { padding: 14px 4px; font-size: 15px; }
  .tile-grid, .tile-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { flex-direction: column; justify-content: center; gap: 6px; padding: 12px 8px; text-align: center; font-size: 14px; }
  .tile-grid.tile-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .video { font-size: 13px; }
  .tabs { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .tab { font-size: 14px; white-space: nowrap; flex: none; }
  .tile-grid--3 .tile { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; text-align: left; }
  .panel { padding: 20px 18px; }

}
@media (min-width: 641px) { .menu-panel { display: none !important; } }
.btn-lg { padding: 17px 30px; font-size: 17px; }

@media (min-width: 641px) and (max-width: 859px) { .tile-grid, .tile-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
