@font-face {
  font-family: "Pretendard PF";
  src: url("fonts/pretendard-pf.woff2") format("woff2-variations"), url("fonts/pretendard-pf.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ground: #17181b;
  --ground-2: #1e1f23;
  --ground-3: #28292e;
  --line: #34353b;
  --ink: #f3f1ec;
  --ink-2: #c0c3ca;
  --ink-3: #9398a3;
  --led: #ffb547;
  --led-ink: #1c1406;
  --scrim: 23, 24, 27;
  --radius-tile: 14px;
  --radius-ui: 999px;
  --gutter: clamp(18px, 4.2vw, 64px);
  --tile-w: clamp(212px, 21vw, 300px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms;
  --t-mid: 420ms;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Pretendard PF", "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(255, 181, 71, 0.38); color: var(--ink); }
:focus-visible { outline: 2px solid var(--led); outline-offset: 3px; }
input, textarea { caret-color: var(--led); }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.22em; }
kbd {
  display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; padding: 0 0.45em; margin-right: 0.3em;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--ground-2);
  font: 600 0.72rem/1 inherit; color: var(--ink-2);
}
.icon { width: 1.15em; height: 1.15em; flex: none; }
.mono {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--ground); font-weight: 900; font-size: 0.86rem; letter-spacing: -0.02em;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--led); color: var(--led-ink); font-weight: 700; }
.skip:focus { top: 12px; }

html { scrollbar-color: var(--ground-3) var(--ground); scrollbar-width: thin; }

/* ---------- Gate: console user select ---------- */
.gate {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; overflow: hidden;
  background: var(--ground);
  /* Visible at once when returning (showGate focuses a user button immediately); hidden only after the fade-out. */
  transition: opacity var(--t-mid) var(--ease-out), visibility 0s;
}
.gate__ambient {
  position: absolute; inset: -8%; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; opacity: 0.2;
  filter: blur(2px) saturate(0.9); transform: rotate(-4deg) scale(1.05);
}
.gate__ambient img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }
.gate::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 62% at 50% 50%, rgba(var(--scrim), 0.55), rgba(var(--scrim), 0.97) 74%);
}
.gate__owner {
  position: absolute; left: var(--gutter); top: 22px; z-index: 2; margin: 0; display: flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-weight: 600; font-size: 0.95rem;
}
.gate__inner { position: relative; z-index: 2; text-align: center; padding: 24px; }
.gate__title { margin: 0 0 clamp(28px, 5vh, 48px); font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; }
.gate__users { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 3.2vw, 44px); }
.user {
  appearance: none; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  display: grid; justify-items: center; gap: 14px; width: clamp(120px, 15vw, 176px); padding: 0;
}
.user__art {
  width: 100%; aspect-ratio: 1; border-radius: 28px; outline: 3px solid transparent; outline-offset: 5px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  transition: transform var(--t-fast) var(--ease-out), outline-color var(--t-fast) var(--ease-out), filter var(--t-fast);
  filter: saturate(0.85) brightness(0.9);
}
.user__art svg { width: 100%; height: 100%; display: block; }
.user__name { font-weight: 700; font-size: 1.12rem; color: var(--ink-2); transition: color var(--t-fast); }
.user__note { margin-top: -8px; font-size: 0.86rem; color: var(--ink-3); max-width: 15ch; line-height: 1.4; }
.user:hover .user__art, .user:focus-visible .user__art { transform: translateY(-6px) scale(1.04); outline-color: var(--ink); filter: none; }
.user:hover .user__name, .user:focus-visible .user__name { color: var(--ink); }
.user:focus-visible { outline: none; }
.user.is-chosen .user__art { transform: scale(1.12); outline-color: var(--led); filter: none; }
.gate__hint { margin: clamp(30px, 6vh, 56px) 0 0; color: var(--ink-3); font-size: 0.85rem; }
body:not(.is-gated) .gate {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--t-mid) var(--ease-out), visibility 0s linear var(--t-mid);
}
body.is-leaving .gate__users .user:not(.is-chosen) { opacity: 0; transform: scale(0.94); transition: opacity 260ms, transform 260ms; }

/* ---------- Status bar ---------- */
.status {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: 64px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 var(--gutter);
  background: linear-gradient(rgba(var(--scrim), 0.92), rgba(var(--scrim), 0));
  transition: background var(--t-mid);
}
.status.is-solid { background: rgba(var(--scrim), 0.96); box-shadow: 0 1px 0 var(--line); }
.status__owner { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.status__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.status__who strong { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
.status__who span { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status__right { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 22px); }
.status__contact {
  text-decoration: none; font-weight: 700; font-size: 0.9rem; padding: 8px 14px; border-radius: var(--radius-ui);
  border: 1px solid rgba(243, 241, 236, 0.28); transition: border-color var(--t-fast), background var(--t-fast);
}
.status__contact:hover { border-color: var(--ink); background: rgba(243, 241, 236, 0.08); }
.status__clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); font-size: 0.95rem; }
.status__user {
  appearance: none; border: 0; background: rgba(243, 241, 236, 0.08); color: var(--ink); font: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--radius-ui); font-size: 0.86rem; font-weight: 600;
}
.status__user > svg:first-child { width: 30px; height: 30px; border-radius: 9px; }
.status__user:hover { background: rgba(243, 241, 236, 0.16); }

/* ---------- Hero: focused title owns the screen ---------- */
.hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: flex-end; padding: 112px var(--gutter) clamp(120px, 17vh, 170px); isolation: isolate; }
.hero__backdrop {
  position: absolute; inset: 0 0 0 28%; z-index: -1; overflow: hidden; background: var(--ground);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}
.hero__layer {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  opacity: 0; transform: scale(1.04); transition: opacity 520ms var(--ease-out), transform 1600ms var(--ease-out);
}
.hero__layer.is-on { opacity: 1; transform: scale(1); }
.hero__backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(var(--scrim), 0.55) 0%, rgba(var(--scrim), 0.12) 60%, rgba(var(--scrim), 0) 100%),
    linear-gradient(0deg, rgb(var(--scrim)) 0%, rgba(var(--scrim), 0) 46%),
    linear-gradient(180deg, rgba(var(--scrim), 0.7) 0%, rgba(var(--scrim), 0) 22%);
}
.hero__content { max-width: min(640px, 100%); }
.hero__title { margin: 0; font-size: clamp(2.5rem, 6.2vw, 5.4rem); font-weight: 900; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.hero__line { margin: 18px 0 0; font-size: clamp(1.08rem, 1.6vw, 1.4rem); font-weight: 600; color: var(--ink); max-width: 34ch; text-wrap: pretty; }
.hero__meta { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--ink-2); font-size: 0.92rem; }
.hero__meta .badge-new { color: var(--led-ink); background: var(--led); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; }
.hero__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.hero__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  appearance: none; border: 0; font: inherit; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 12px;
  font-weight: 800; font-size: 1.02rem; letter-spacing: -0.01em;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--led); color: var(--led-ink); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.85); }
.btn--primary:hover { background: #ffc46b; }
.btn--quiet { background: rgba(243, 241, 236, 0.14); color: var(--ink); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--quiet:hover { background: rgba(243, 241, 236, 0.24); }

/* ---------- Shelves ---------- */
.shelves { position: relative; z-index: 2; margin-top: clamp(-104px, -12vh, -72px); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(26px, 4vh, 40px); padding-bottom: 24px; }
.shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 var(--gutter); }
.shelf__title { margin: 0; font-size: clamp(1.12rem, 1.5vw, 1.36rem); font-weight: 800; letter-spacing: -0.02em; }
.shelf__count { color: var(--ink-3); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.shelf__rail { position: relative; }
.shelf__track {
  display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 14px var(--gutter) 22px; scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.shelf__track::-webkit-scrollbar { display: none; }
.shelf__nav {
  position: absolute; top: 14px; bottom: 22px; z-index: 3; width: max(44px, calc(var(--gutter) + 8px)); border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--ink); opacity: 0; transition: opacity var(--t-fast);
}
.shelf__nav .icon { width: 30px; height: 30px; }
.shelf__nav--prev { left: 0; background: linear-gradient(90deg, rgba(var(--scrim), 0.92), rgba(var(--scrim), 0)); }
.shelf__nav--next { right: 0; background: linear-gradient(270deg, rgba(var(--scrim), 0.92), rgba(var(--scrim), 0)); }
.shelf__rail:hover .shelf__nav:not([hidden]) { opacity: 1; }
.shelf__nav:focus-visible { opacity: 1; outline-offset: -4px; }
@media (hover: none) { .shelf__nav { display: none; } }

.tile {
  appearance: none; border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  flex: none; width: var(--tile-w); scroll-snap-align: start; position: relative; display: grid; gap: 10px;
}
.tile__art {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-tile); overflow: hidden; background: var(--ground-3);
  outline: 3px solid transparent; outline-offset: 3px;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.8);
  transition: transform var(--t-fast) var(--ease-out), outline-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.tile__art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.tile__name {
  font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--t-fast);
}
.tile__line { margin-top: -6px; font-size: 0.84rem; color: var(--ink-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.tile.is-focus .tile__art, .tile:focus-visible .tile__art {
  transform: translateY(-6px) scale(1.035); outline-color: var(--ink); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, 0.9);
}
.tile.is-focus .tile__name, .tile:focus-visible .tile__name { color: var(--ink); }
.tile:focus-visible { outline: none; }
.tile__new {
  position: absolute; left: 10px; top: 10px; z-index: 1; background: var(--led); color: var(--led-ink);
  font-weight: 800; font-size: 0.7rem; letter-spacing: 0.05em; padding: 3px 7px; border-radius: 6px;
}
.tile__resume {
  position: absolute; inset: auto 0 0 0; height: 4px; background: rgba(243, 241, 236, 0.25);
}
.tile__resume::after { content: ""; position: absolute; inset: 0 32% 0 0; background: var(--ink); }

/* TOP 10: numerals stand behind the art */
.shelf--top .tile { width: calc(var(--tile-w) * 1.18); padding-left: calc(var(--tile-w) * 0.42); }
.shelf--top .tile__rank {
  position: absolute; left: 0; bottom: 34px; z-index: 0; font-weight: 900; line-height: 0.8; letter-spacing: -0.08em;
  font-size: calc(var(--tile-w) * 0.62); color: var(--ground); -webkit-text-stroke: 3px rgba(243, 241, 236, 0.78);
  font-variant-numeric: tabular-nums; pointer-events: none; user-select: none;
}
.shelf--top .tile__art { z-index: 1; }

/* ---------- Profile ---------- */
.profile { padding: clamp(40px, 8vh, 80px) var(--gutter) clamp(40px, 6vh, 64px); scroll-margin-top: 64px; }
.profile__card {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 3vw, 40px); align-items: start;
  max-width: 1080px; padding: clamp(24px, 4vw, 48px); border-radius: 22px; background: var(--ground-2);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(243, 241, 236, 0.06);
}
.profile__mono { width: clamp(72px, 9vw, 112px); height: clamp(72px, 9vw, 112px); border-radius: 26px; font-size: clamp(1.6rem, 2.6vw, 2.4rem); }
.profile__title { margin: 0; font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.1; }
.profile__title span { color: var(--ink-3); font-weight: 700; font-size: 1.2rem; letter-spacing: 0; margin-left: 0.3em; }
.profile__headline { margin: 8px 0 0; font-size: 1.1rem; font-weight: 700; color: var(--ink-2); }
.profile__lead { margin: 22px 0 0; font-size: clamp(1.08rem, 1.5vw, 1.28rem); font-weight: 700; line-height: 1.5; max-width: 40ch; }
.profile__intro { margin: 12px 0 0; color: var(--ink-2); max-width: 62ch; }
.profile__skills { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.profile__skills li, .chips li {
  padding: 5px 11px; border-radius: 8px; background: var(--ground-3); color: var(--ink-2); font-size: 0.84rem; font-weight: 600;
}
.profile__links { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.profile__links .btn { min-height: 46px; font-size: 0.96rem; }

.foot { padding: 12px var(--gutter) 88px; color: var(--ink-3); font-size: 0.84rem; }
.foot p { margin: 4px 0; }
.hints {
  position: absolute; right: var(--gutter); bottom: clamp(128px, 18vh, 178px); z-index: 1; margin: 0; padding: 8px 12px; border-radius: 12px;
  background: rgba(var(--scrim), 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink-3); font-size: 0.8rem; display: none; align-items: center; gap: 4px;
}
@media (hover: hover) and (pointer: fine) { .hints { display: flex; } }

/* ---------- Detail sheet ---------- */
.sheet {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px;
  background: var(--ground-2); color: var(--ink); overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
}
.sheet::backdrop { background: rgba(8, 9, 12, 0.72); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in 360ms var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
.sheet__art { position: relative; aspect-ratio: 16 / 8.2; background: var(--ground-3); }
.sheet__art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.sheet__art::after { content: ""; position: absolute; inset: 40% 0 0 0; background: linear-gradient(rgba(29, 32, 39, 0), var(--ground-2)); }
.sheet__close {
  position: absolute; right: 14px; top: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(var(--scrim), 0.82); color: var(--ink);
}
.sheet__close:hover { background: var(--ground); }
.sheet__body { position: relative; margin-top: -72px; padding: 0 clamp(20px, 4vw, 44px) clamp(28px, 4vw, 44px); }
.sheet__title { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.08; }
.sheet__line { margin: 10px 0 0; font-size: 1.12rem; font-weight: 600; }
.sheet__actions { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sheet__url { color: var(--ink-3); font-size: 0.86rem; word-break: break-all; }
.sheet__grid { margin-top: 30px; display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(20px, 4vw, 48px); }
.sheet__grid h3 { margin: 0 0 8px; font-size: 0.95rem; font-weight: 800; color: var(--ink-2); }
.sheet__grid h3 + p { margin: 0 0 26px; color: var(--ink); max-width: 60ch; }
.sheet__grid ul#sheet-highlights { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.sheet__grid ul#sheet-highlights li::marker { color: var(--ink-3); }
.sheet__facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; align-content: start; font-size: 0.94rem; }
.sheet__facts dt { color: var(--ink-3); font-weight: 600; }
.sheet__facts dd { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .status { height: 58px; }
  .status__clock { display: none; }
  .status__contact { padding: 7px 12px; font-size: 0.84rem; }
  .status__who span { display: none; }
  .status__user span { display: none; }
  .status__user { padding: 4px; }
  .hero { min-height: 78svh; padding-top: 96px; padding-bottom: 116px; }
  .hero__backdrop {
    inset: 0 0 auto 0; height: 44%;
    -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%); mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  }
  .hero__backdrop::after { background: linear-gradient(180deg, rgba(var(--scrim), 0.72) 0%, rgba(var(--scrim), 0) 30%); }
  .hints { display: none !important; }
  .user { width: clamp(92px, 26vw, 120px); }
  .user__art { border-radius: 22px; }
  .user__note { display: none; }
  .gate__users { gap: 14px; flex-wrap: nowrap; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .shelves { margin-top: -76px; }
  :root { --tile-w: 62vw; }
  .shelf--top .tile { width: calc(var(--tile-w) * 1.12); padding-left: calc(var(--tile-w) * 0.34); }
  .profile__card { grid-template-columns: 1fr; }
  .sheet__grid { grid-template-columns: 1fr; }
  .sheet { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .gate__owner { left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .hero__layer { transform: none !important; }
}

#sheet-source[hidden] { display: none; }
