/* T3rry Art — Fullscreen Scroll-Snap Art Feed (Benchmark: guestbook v=20261201e) */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --dock-mist: rgba(9, 9, 11, 0.72);
  --ink: #fafafa;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --accent: #38bdf8;
  --halo: 0 1px 10px rgba(9, 9, 11, 0.94), 0 0 18px rgba(9, 9, 11, 0.88);
  --kr: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --dock-mist: rgba(250, 250, 250, 0.80);
  --ink: #18181b;
  --muted: #52525b;
  --line: rgba(24, 24, 27, 0.14);
  --line-strong: rgba(24, 24, 27, 0.30);
  --accent: #0369a1;
  --halo: 0 1px 10px rgba(250, 250, 250, 0.96), 0 0 18px rgba(250, 250, 250, 0.92);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--kr);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -8rem;
  padding: 0.55rem 0.95rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

/* ===== Fullscreen 100dvh Scroll-Snap Feed ===== */
.art-feed {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.art-feed::-webkit-scrollbar { display: none; }

.art-slide {
  position: relative;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: var(--bg);
}

.art-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.art-fallback-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 10px;
}
.art-fallback-card[hidden] { display: none; }
.fb-eyebrow {
  margin: 0;
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  color: var(--accent);
}
.art-fallback-card h1,
.art-fallback-card h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.art-fallback-card p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.art-fallback-card a {
  margin-top: 8px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  font-size: 0.875rem;
}

/* ===== Top Smart Auto-Hide Bar ===== */
.art-hover-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 29;
  pointer-events: none;
}
.art-hover-zone.is-armed { pointer-events: auto; }

.art-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 14px max(24px, env(safe-area-inset-left, 0px));
  opacity: 0.76;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.24s ease;
}

.art-topbar:hover,
.art-topbar:focus-within {
  opacity: 1;
}

.art-topbar.is-frosted {
  background: var(--dock-mist);
}
@supports (backdrop-filter: blur(12px)) {
  .art-topbar.is-frosted {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.art-topbar.is-hidden {
  transform: translate3d(0, -108%, 0);
  pointer-events: none;
}

.art-brand,
.art-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: var(--halo);
}

.art-wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  text-decoration: none;
  font: 500 0.9375rem/1.4 var(--mono);
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.art-wordmark span {
  margin-left: 0.3em;
  color: var(--muted);
  font-weight: 400;
}
.art-sep {
  color: var(--muted);
  font-family: var(--mono);
}
.art-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: color 0.15s;
}
.art-link:hover { color: var(--ink); }

.art-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 0.8125rem/1.4 var(--kr);
  cursor: pointer;
  white-space: nowrap;
  text-shadow: var(--halo);
  transition: color 0.15s, border-color 0.15s;
}
.art-btn[hidden] { display: none; }
.art-btn:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}
.art-btn[aria-pressed="true"] { color: var(--ink); }
.art-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

/* ===== Right 1px Monochrome Stack (Feed Index + Work Parameter) ===== */
.art-right-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transition: opacity 0.28s ease;
}

.art-feed-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.62;
  transition: opacity 0.22s ease;
}
.art-feed-rail:hover,
.art-feed-rail:focus-within { opacity: 1; }

.feed-dot-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.feed-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 0.2s ease, background-color 0.2s ease, height 0.2s ease;
}
.feed-dot-btn[aria-current="true"] .feed-dot {
  height: 18px;
  background: var(--ink);
}
.feed-count {
  font: 500 0.625rem/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
  text-shadow: var(--halo);
  user-select: none;
}

.art-param-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  opacity: 0.52;
  transition: opacity 0.22s ease;
}
.art-param-rail[hidden] { display: none; }
.art-param-rail:hover,
.art-param-rail:focus-within { opacity: 1; }

.rail-cap {
  font: 500 0.625rem/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
  text-shadow: var(--halo);
  user-select: none;
}

.rail-track-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 140px;
}

.rail-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 20px;
  height: 132px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.rail-slider::-webkit-slider-runnable-track {
  width: 1px;
  background: var(--line-strong);
  border-radius: 999px;
}
.rail-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 7px;
  height: 16px;
  margin-left: -3px;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--bg);
}
.rail-slider::-moz-range-track {
  width: 1px;
  background: var(--line-strong);
  border: 0;
}
.rail-slider::-moz-range-thumb {
  width: 7px;
  height: 16px;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--bg);
}

/* ===== Persistent Corner Watermark Footer ===== */
.art-corner-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(24px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  font-size: 0.75rem;
  color: var(--muted);
  transition: opacity 0.28s ease;
}

.corner-left,
.corner-right {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.70;
  text-shadow: var(--halo);
  transition: opacity 0.2s ease, color 0.15s ease;
}
.corner-left:hover,
.corner-right:hover,
.corner-right:focus-within { opacity: 1; }

.work-meta {
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink);
}
.corner-sign {
  font: 400 0.75rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  user-select: none;
}
.corner-right a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.corner-right a:hover,
.corner-right a:focus-visible { color: var(--ink); }

/* ===== Pure Immersion Mode (ui-hidden) ===== */
body.ui-hidden .art-topbar,
body.ui-hidden .art-right-stack,
body.ui-hidden .art-corner-footer {
  opacity: 0;
  pointer-events: none;
}

.art-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 8px);
  z-index: 40;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--dock-mist);
  color: var(--ink);
  font-size: 0.8125rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.art-toast[hidden] { display: none; }
.art-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .art-topbar {
    padding: max(12px, env(safe-area-inset-top, 0px)) 16px 10px;
  }
  .art-wordmark span,
  .art-theme-label {
    display: none;
  }
  .art-right-stack {
    right: 8px;
    gap: 12px;
  }
  .rail-track-wrap { height: 112px; }
  .rail-slider { height: 104px; }
  .art-corner-footer {
    padding: 0 16px max(12px, env(safe-area-inset-bottom, 0px));
    font-size: 0.6875rem;
  }
  .work-meta, .corner-sign { font-size: 0.6875rem; }
  .corner-sep, .corner-sign { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .art-feed { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; }
}
