/* Daily Lab 홈. 색·글꼴은 tokens.css에서 온다(그 값은 home.js의 THEMES와 같아야 평면 <h1>이 첫 프레임과 겹친다). */
@view-transition { navigation: auto; }

:root {
  --bg: var(--dl-bg);
  --ink: var(--dl-ink);
  --muted: var(--dl-muted);
  --accent: var(--dl-accent);
  --gutter: clamp(20px, 3.2vw, 48px);
  --ease: var(--dl-ease);
  --sans: var(--dl-sans);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--sans); letter-spacing: -0.01em; word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }

/* 캔버스가 화면 전체를 덮고, 글자·링크는 그 위에 얹힌다. 링크가 아닌 곳은 전부 캔버스가 포인터를 받는다. */
.frame {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
}
.stage {
  position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%;
  opacity: 0; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent;
}
.gl .stage { opacity: 1; }
.is-grabbing, .is-grabbing * { cursor: grabbing !important; }
.top, .center, .bottom { position: relative; z-index: 1; pointer-events: none; }
.top a, .bottom a { pointer-events: auto; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px var(--gutter) 0; font-size: 14px; }
.hint { margin: 0; color: var(--muted); opacity: 0; transform: translateY(6px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.hint.show { opacity: 1; transform: none; }
.hint.gone { opacity: 0; transform: translateY(-4px); transition-duration: .6s; }
.contact { color: var(--muted); transition: color .3s; }
.contact:hover { color: var(--ink); }

/* 워드마크. WebGL이 준비되면 같은 자리에 같은 모양으로 그려지고, <h1>은 보이지 않게 남는다(스크린리더·검색용). */
.center { display: grid; place-items: center; padding: 0 var(--gutter); }
.mark {
  margin: 0; font-family: var(--dl-mark); font-weight: 900;
  font-size: min(19vw, 38vh); line-height: .92; letter-spacing: -0.03em; white-space: nowrap;
  color: var(--ink); user-select: none; -webkit-user-select: none;
}
.mark .bl { display: inline-block; width: 0; height: 0; }
.gl .mark { opacity: 0; }
@media (max-aspect-ratio: 4/5) {
  .center { place-items: center start; }
  .mark { font-size: min(36vw, 24vh); line-height: .86; }
  .mark .line { display: block; }
}

.bottom {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px;
  padding: 0 var(--gutter) max(24px, env(safe-area-inset-bottom));
}
.exits { display: flex; gap: clamp(32px, 5vw, 88px); }
.exit { display: grid; gap: 4px; padding: 6px 0; }
.exit-name {
  position: relative; justify-self: start; display: inline-flex; align-items: baseline; gap: .3em;
  font-size: clamp(26px, 2.4vw, 34px); font-weight: 650; line-height: 1.15; letter-spacing: -0.035em;
}
.exit-name::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .7s var(--ease);
}
.exit:hover .exit-name::after, .exit:focus-visible .exit-name::after { transform: scaleX(1); transform-origin: left; }
.arrow { display: inline-block; font-weight: 400; transition: transform .7s var(--ease); }
.exit:hover .arrow, .exit:focus-visible .arrow { transform: translateX(.2em); }
.exit-desc { font-size: 14px; color: var(--muted); }
.legal { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.legal a { transition: color .3s; }
.legal a:hover { color: var(--ink); }

/* 등장은 글자가 부푸는 동안 한 박자 늦게, 떠날 때는 링크들이 먼저 가라앉는다 */
.reveal { animation: rise 1.1s var(--ease) both; animation-delay: calc(.6s + var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.top, .bottom { transition: opacity .35s ease, transform .5s var(--ease); }
.is-leaving .top, .is-leaving .bottom { opacity: 0; transform: translateY(10px); }

@media (max-width: 640px) {
  .top { padding-top: 18px; font-size: 13px; }
  .bottom { display: grid; gap: 28px; }
  .exits { display: grid; gap: 18px; }
  .exit-name { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .hint, .arrow, .exit-name::after, .top, .bottom { transition: none; }
}
