/* 첫 화면: 어두운 방 × 살아 있는 견본 격자 */
body { background: var(--dark); color: var(--d-text); }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline-color: #fff; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(7, 9, 13, .92); border-bottom: 1px solid var(--d-line);
}
@supports (backdrop-filter: blur(8px)) { .top { background: rgba(7, 9, 13, .78); backdrop-filter: blur(12px); } }
.brand { font-size: 19px; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.top-r { display: flex; align-items: center; gap: 28px; min-width: 0; }
.gnb { display: flex; gap: 24px; font-size: 16px; white-space: nowrap; }
.gnb a { color: var(--d-mute); padding: 8px 0; }
.gnb a:hover { color: var(--d-text); }
.gnb a[aria-current="page"] { color: var(--d-text); font-weight: 700; }
.top-r .search { margin-left: auto; flex: 0 1 360px; }

/* 쓰는 곳 거르기 — 격자 바로 위 도구줄. 고른 쪽은 밑줄(상태 표시) */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px;
  margin-top: 8px; border-bottom: 1px solid var(--d-line);
}
.gtitle { padding-bottom: 12px; font-size: 22px; font-weight: 700; }
.gtitle .en { margin-left: 6px; font-size: 18px; color: var(--d-mute); }
.gtitle span { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--d-meta); font-variant-numeric: tabular-nums; }
.media { display: flex; gap: 24px; font-size: 15px; }
.media button, .groups button {
  appearance: none; background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--d-mute);
  min-height: 32px;
}
.media button { position: relative; padding: 10px 0 12px; min-height: 44px; }
.media button[aria-pressed="true"] { color: var(--d-text); font-weight: 700; }
.media button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--d-text); }
.media button:hover, .groups button:hover { color: var(--d-text); }

.search input {
  width: min(100%, 440px); height: 42px; padding: 0 16px;
  font: inherit; font-size: 15px; color: var(--d-text);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--d-line); border-radius: 8px;
}
.search input::placeholder { color: var(--d-meta); }
.search input:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* 다른 탭의 검색 결과 판(assets/topsearch.js) */
.search { position: relative; }
.qs-pop {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); width: min(440px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto;
  display: grid; gap: 2px; padding: 6px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(17, 21, 28, .96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
@supports (backdrop-filter: blur(8px)) { .qs-pop { background: rgba(17, 21, 28, .82); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); } }
.qs-pop[hidden] { display: none; }
.qs-pop [role="option"] { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; color: var(--d-text); text-decoration: none; }
.qs-pop [role="option"] b { font-size: 15px; font-weight: 700; }
.qs-pop [role="option"] .en { font-size: 13px; color: var(--d-mute); }
.qs-pop [role="option"] small { grid-column: 1 / -1; font-size: 12px; color: var(--d-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-pop [role="option"]:hover, .qs-pop [role="option"][aria-selected="true"] { background: rgba(255, 255, 255, .07); text-decoration: none; }
.qs-pop [role="option"][aria-selected="true"] { box-shadow: inset 0 0 0 1px rgba(143, 188, 255, .5); }
.qs-none { padding: 12px; font-size: 13px; color: var(--d-mute); }
.qs-all { margin-top: 4px; padding: 10px 12px; border-top: 1px solid var(--d-line); font-size: 13px; color: #a9cbff; text-decoration: none; }
.qs-all:hover { color: #fff; }

.shell {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px;
  padding: 0 clamp(16px, 3vw, 40px);
}
.groups { position: sticky; top: 71px; font-size: 16px; align-self: start; padding: 40px 0; }
.groups ul { display: grid; gap: 2px; }
.groups button { display: flex; justify-content: space-between; width: 100%; font-size: 16px; text-align: left; }
.groups button span { font-size: 12px; color: var(--d-meta); font-variant-numeric: tabular-nums; }
.groups button[aria-pressed="true"] { color: var(--d-text); font-weight: 700; }
.groups button[aria-pressed="true"] span { color: var(--d-mute); }
.groups button:disabled { color: #4a4a4a; cursor: default; }
.groups button:disabled span { color: #4a4a4a; }

main { padding: 40px 0 72px; min-width: 0; }
.shell { scroll-margin-top: 72px; }

.tiles {
  --k: .45;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
  margin-top: 24px;
}
.tile { position: relative; display: flex; flex-direction: column; border: 1px solid var(--d-line); border-radius: 8px; overflow: hidden; transition: border-color .24s var(--ease), box-shadow .3s var(--ease); }
.tile:hover, .tile:focus-within { border-color: rgba(176, 206, 255, .5); box-shadow: 0 0 0 1px rgba(143, 188, 255, .1), 0 12px 40px rgba(49, 130, 246, .14); }
/* 올렸을 때 테두리를 따라 흰색→하늘색 빛이 한 번 스치고 지나간다(아주 약하게) */
.tile::after {
  content: ""; position: absolute; inset: -1px; z-index: 4; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, .95) 47%, rgba(143, 188, 255, .9) 53%, transparent 64%) 150% 0 / 260% 100% no-repeat;
  -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, linear-gradient(#000 0 0); mask-composite: exclude;
}
.tile:hover::after, .tile:focus-within::after { opacity: 1; animation: tile-glint 1.5s var(--ease) both; }
@keyframes tile-glint { from { background-position: 150% 0; } to { background-position: -70% 0; } }
@media (prefers-reduced-motion: reduce) { .tile:hover::after, .tile:focus-within::after { animation: none; opacity: 0; } }
.tile[hidden] { display: none; }

.tile-stage { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; }
.tile-hit {
  position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
}
.tile-hit:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.tile-stage .scaler { width: 640px; height: 480px; transform: scale(var(--k)); transform-origin: 0 0; pointer-events: none; }
.tile-stage .stage { width: 640px; height: 480px; }
.tile-stage .note {
  position: absolute; z-index: 2; pointer-events: none; right: 8px; bottom: 8px; padding: 2px 8px;
  font-size: 11px; color: var(--sub); background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 4px;
}
.tile-state {
  position: absolute; z-index: 2; pointer-events: none; left: 8px; bottom: 8px; padding: 2px 8px; font-size: 11px; font-weight: 600;
  color: var(--sub); background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 4px;
}
.tile-step { margin-left: 6px; font-weight: 400; color: var(--sub); font-variant-numeric: tabular-nums; }
.tile.on .tile-state { color: var(--blue-d); background: var(--blue-l); border-color: transparent; }
.tile-stage:hover .tile-state { border-color: var(--blue); }

.tile-info { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; }
.tile-act { margin-top: auto !important; padding-top: 6px; }
.tile-info h2 { font-size: 18px; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.tile-info h2 .ko { display: block; text-wrap: balance; }
.tile-info h2 .en { display: block; margin-top: 2px; font-size: 15px; color: var(--d-mute); }
.tile-meta { font-size: 12px; color: var(--d-meta); }
.tile-def { font-size: 14px; color: var(--d-mute); line-height: 1.5; }
.tile-act { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; }
.tile-act .copy {
  appearance: none; background: none; border: 0; padding: 8px 0; min-height: 36px; cursor: pointer;
  color: var(--orange); font-weight: 700;
}
.tile-act .copy:hover { text-decoration: underline; text-underline-offset: 3px; }
/* 자세히: 주 행동(AI 문장 복사)보다 한 단계 낮게. 작은 회색 글자 + 화살표, 올리면 화살표가 살짝 밀린다 */
.tile-act .more, .says-act .more { display: inline-flex; align-items: center; gap: 4px; padding: 8px 0; font-size: 12px; font-weight: 500; color: var(--d-meta); text-decoration: none; }
.tile-act .more i, .says-act .more i { font-style: normal; transition: transform .2s var(--ease); }
.tile-act .more:hover, .says-act .more:hover { color: var(--d-text); }
.tile-act .more:hover i, .says-act .more:hover i { transform: translateX(2px); }

.empty { margin-top: 40px; color: var(--d-mute); }

/* 말로 찾은 용어: 격자 위 세 장. 이유("이럴 때 하는 말")를 먼저 보여 준다 */
.says { margin-top: 24px; }
.says[hidden] { display: none; }
.says-h { font-size: 15px; color: var(--d-mute); }
.says-k { margin-right: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(143, 188, 255, .14); color: #a9cbff; font-size: 12px; font-weight: 700; }
.says-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.says-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 14px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12); background: linear-gradient(150deg, rgba(59, 91, 219, .14), rgba(255, 255, 255, .03) 60%);
}
.says-no { position: absolute; right: 16px; top: 14px; font-size: 13px; color: var(--d-meta); font-variant-numeric: tabular-nums; }
.says-name { display: grid; gap: 2px; color: var(--d-text); text-decoration: none; }
.says-name b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.says-name .en { font-size: 15px; color: var(--d-mute); }
.says-name:hover b { text-decoration: underline; text-underline-offset: 4px; }
.says-why { font-size: 13px; line-height: 1.5; color: #a9cbff; }
.says-def { font-size: 14px; line-height: 1.6; color: var(--d-mute); }
.says-act { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; font-size: 13px; }
.says-act .copy { padding: 6px 0; border: 0; background: none; color: var(--orange); font: inherit; font-weight: 700; cursor: pointer; }
.says-act a { color: var(--d-mute); }

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  padding: 20px clamp(16px, 3vw, 40px) 28px; border-top: 1px solid var(--d-line);
  font-size: 12px; color: var(--d-meta);
}
.foot a { color: var(--d-mute); text-decoration: underline; text-underline-offset: 3px; }
/* 만든 사람 — 모든 페이지 아래에 작게, 첫 화면 히어로 아래 줄에도 */
.credit { letter-spacing: .01em; }
.credit b { margin-left: 2px; color: var(--d-text); font-weight: 600; }

@media (max-width: 1023px) {
  .top { grid-template-columns: 160px 1fr; }
  .shell { grid-template-columns: 160px 1fr; }
}

@media (max-width: 767px) {
  /* 휴대폰: 맨 위 사이트 이름 줄(12 + 28 + 10px)만 밀려 올라가고 탭·검색은 위에 붙어 있다 */
  .top { top: -50px; grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; }
  .brand { line-height: 28px; }
  .media { gap: 18px; }
  .toolbar { margin-top: 8px; }
  .gtitle { width: 100%; padding-bottom: 0; }
  .search input { width: 100%; }
  .top-r { flex-wrap: wrap; gap: 4px 20px; }
  .gnb { gap: 18px; font-size: 15px; }
  .top-r .search { flex: 1 1 100%; }
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .groups { position: static; padding: 16px 0 0; margin: 0 -16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; }
  .groups ul { display: flex; gap: 20px; padding: 0 16px; width: max-content; }
  .groups button { gap: 6px; min-height: 44px; scroll-snap-align: start; white-space: nowrap; }
  main { padding-top: 28px; }
  .tiles { grid-template-columns: 1fr; margin-top: 28px; }
}
