/* Site shell over the world (V1 + V1b). Shared by / and /v1/. Scoped to the shell's own classes and to html[data-shell],
   so it never collides with the world's world.css. Plan: knowledge/ia/v1b-poster/PLAN.md. */

/* ---- ground: the poster's mean colour, so the half second before the poster never flashes black or white */
html[data-shell], html[data-shell] body { background: #1a2330; }
@media (max-aspect-ratio: 9999/10000) { html[data-shell], html[data-shell] body { background: #151c28; } }

/* ---- poster: a centred crop of a 4:3 (desktop camera, fixed horizontal FOV) or 3:4 (mobile camera, fixed vertical FOV)
   master, so it matches the live canonical frame exactly for every landscape >= 4:3 and every portrait <= 3:4.
   The world switches camera at aspect 1 (mobile below 1), so the media queries switch there too. */
.poster { position: fixed; inset: 0; z-index: 10; overflow: hidden; pointer-events: auto; touch-action: none;
  opacity: 1; transition: opacity 1.2s ease; }
.poster img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: block; max-width: none;
  width: max(100vw, 133.34vh); height: auto; }
@media (max-aspect-ratio: 9999/10000) { .poster img { width: max(100vw, 75vh); } }
html[data-poster="fading"] .poster { opacity: 0; pointer-events: none; }
/* (QR-UNIFY: the card's cover is the ground, not the canonical picture, so its first visible frame is K; shell.js waits for that pose) */
html[data-card] .poster { background: #1a2330; }
@media (max-aspect-ratio: 9999/10000) { html[data-card] .poster { background: #151c28; } }

/* ---- the shell line: brand (with the poster) and navigation (after world:composition) */
.shell { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 14px) 0 calc(env(safe-area-inset-left, 0px) + 14px);
  pointer-events: none; font: 500 13px/1 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: rgba(236, 232, 224, 0.8); text-shadow: 0 1px 12px rgba(5, 8, 14, 0.6); }
/* the brand appears with the poster at once, no fade: Chrome excludes the viewport-covering poster from LCP (it counts as
   background), so the brand is the LCP element and a fade would push LCP back by its duration (staging: 2.7-3.1 s) */
.shell .brand, .shell nav { opacity: 0; }
.shell nav { transition: opacity 1.2s ease; }
html[data-brand="on"] .shell .brand, html[data-shell="on"] .shell .brand, html[data-shell="fallback"] .shell .brand { opacity: 1; }
html[data-shell="on"] .shell nav, html[data-shell="fallback"] .shell nav { opacity: 1; }
.shell a { pointer-events: auto; color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  -webkit-tap-highlight-color: transparent; transition: color 0.2s ease; }
.shell a:hover { color: rgba(248, 245, 238, 0.98); }
.shell a:focus-visible { outline: 1px solid rgba(236, 232, 224, 0.7); outline-offset: -6px; border-radius: 4px; }
.shell .brand { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; }
.shell .brand .brand-fc { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; letter-spacing: 0.02em; opacity: 0.8; }   /* v1.9: the insurance card QR shows the FC line (owner mock) */
.shell a.brand:has(.brand-fc) { flex-direction: column; align-items: flex-start; justify-content: center; }
.shell nav a.nav-contact { border: 1px solid rgba(244, 238, 226, 0.55); border-radius: 6px; padding: 6px 10px; }
.shell nav { display: flex; }
.shell nav a { letter-spacing: 0.04em; }
@media (min-width: 720px) { .shell { padding-top: calc(env(safe-area-inset-top, 0px) + 16px); padding-left: 22px; padding-right: 22px; } }

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

/* ---- fallback (no WebGL, failure, timeout): the poster stays; the links sit over a soft bottom scrim */
.fallback { display: none; position: fixed; inset: auto 0 0 0; z-index: 25; justify-content: center;
  padding: 18vh 24px calc(env(safe-area-inset-bottom, 0px) + 9vh);
  background: linear-gradient(to bottom, rgba(8, 12, 20, 0) 0%, rgba(8, 12, 20, 0.72) 45%, rgba(8, 12, 20, 0.86) 100%);
  color: rgba(236, 232, 224, 0.9); font: 400 15px/1.7 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  text-shadow: 0 1px 10px rgba(5, 8, 14, 0.5); }
.fallback div { width: 100%; max-width: 26rem; }
.fallback ul { list-style: none; margin: 0; padding: 0; }
.fallback li a { display: flex; justify-content: space-between; min-height: 48px; align-items: center; color: inherit; text-decoration: none;
  border-top: 1px solid rgba(236, 232, 224, 0.18); }
.fallback li:last-child a { border-bottom: 1px solid rgba(236, 232, 224, 0.18); }
html[data-shell="fallback"] .fallback { display: flex; }
html[data-shell="fallback"] canvas#world { display: none; }

@media (prefers-reduced-motion: reduce) { .poster, .shell .brand, .shell nav, .shell a { transition: none; } }
/* v1.9 c3: the card landing's header in the owner's HTML v1.9 tokens (brand 10 / 700, its FC line 9; 소개 a dark box, 연락하기 amber with its border; 11 px; the
   visual boxes as drawn, each hit area 44 px) */
html[data-landing="K"] .shell .brand { font-size: 10px; font-weight: 700; } html[data-landing="K"] .shell .brand .brand-fc { font-size: 9px; color: #d9e1e7; opacity: 1; letter-spacing: 0; }
html[data-landing="K"] .shell nav { gap: 9px; align-items: center; }
html[data-landing="K"] .shell nav a { position: relative; min-height: 0; font-size: 11px; line-height: 16px; border-radius: 5px; }
html[data-landing="K"] .shell nav a::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
html[data-landing="K"] .shell nav a:not(.nav-contact) { padding: 9px 6px; background: rgba(4, 11, 19, .64); color: #e5e6e5; }
html[data-landing="K"] .shell nav a.nav-contact { padding: 8px 10px; background: rgba(17, 28, 40, .8); color: #f4e2bb; border: 1px solid rgba(237, 218, 174, .62); }
