:root {
  --bg: #0f0f12;
  --surface: #1a1a20;
  --fg: #f5f5f7;
  --muted: #9a9aa3;
  --border: #2a2a32;
  --primary: #d4a35a;
  --primary-hover: #e0b46f;
  --accent: #f5f5f7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

img { display: block; max-width: 100%; }

/* ---- Login ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background: linear-gradient(135deg, #0f0f12 0%, #1a1a20 100%);
}

.login-card {
  background: var(--surface);
  padding: 40px 32px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  max-width: 380px;
  width: 100%;
  border: 1px solid var(--border);
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: -apple-system, sans-serif;
}

.login-form input {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  min-height: 44px;
  color: var(--fg);
  font-family: -apple-system, sans-serif;
}

.login-form input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-color: var(--primary);
}

.login-form button {
  padding: 12px;
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  margin-top: 8px;
  font-family: -apple-system, sans-serif;
}

.login-form button:hover {
  background: var(--primary-hover);
}

.error {
  margin: 12px 0 0;
  color: #ff6b6b;
  font-size: 0.85rem;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 360px;
  max-height: 560px;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(to bottom, rgba(15,15,18,0.2) 30%, rgba(15,15,18,0.85) 100%);
}

.hero-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 40px;
  color: var(--fg);
}

.hero-eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--primary);
  text-transform: uppercase;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.08em;
  font-weight: 600;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-date {
  margin: 0 0 24px;
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-large {
  min-height: 52px;
  padding: 0 24px;
  font-size: 1rem;
}

/* ---- Toolbar ---- */
.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: -apple-system, sans-serif;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: -apple-system, sans-serif;
  transition: background 0.15s, transform 0.05s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: var(--bg);
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.btn-ghost:hover { background: var(--border); }

/* ---- Gallery ---- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  scroll-margin-top: 70px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.gallery button.thumb {
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: block;
  width: 100%;
}

.gallery button.thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212, 163, 90, 0.2);
  border-color: var(--primary);
}

.gallery button.thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.lightbox:not([hidden]) {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-figure {
  margin: 0;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lb-stage {
  position: relative;
  width: 95vw;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.lb-img--active {
  opacity: 1;
}

.lb-caption {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: -apple-system, sans-serif;
  text-align: center;
}

.lb-close, .lb-prev, .lb-next, .lb-play {
  position: absolute;
  z-index: 2;
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, sans-serif;
  transition: background 0.15s;
  backdrop-filter: blur(6px);
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover, .lb-play:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-play  { bottom: 16px; left: 50%; transform: translateX(-50%); width: auto; padding: 0 20px; border-radius: 24px; }

.lb-counter {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: -apple-system, sans-serif;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  border-radius: 14px;
  backdrop-filter: blur(6px);
}

/* ---- Dialog ---- */
.dialog {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.dialog:not([hidden]) {
  display: flex;
}

.dialog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px 20px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.dialog-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--primary);
  font-family: -apple-system, sans-serif;
}

.dialog-body {
  margin: 0 0 24px;
  color: var(--fg);
  font-size: 0.95rem;
  font-family: -apple-system, sans-serif;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .hero { height: 50vh; min-height: 280px; }
  .hero-content { padding: 20px 16px 28px; }
  .hero-title { letter-spacing: 0.04em; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .toolbar-inner { padding: 12px 16px; gap: 12px; }
  .toolbar-actions { width: 100%; justify-content: flex-end; }
  main { padding: 16px 12px 40px; }
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
  }
  .lb-stage { height: 70vh; }
  .lb-img { max-height: 70vh; }
  .lb-prev, .lb-next { width: 44px; height: 44px; font-size: 1.3rem; }
  .lb-close { width: 44px; height: 44px; top: 10px; right: 10px; }
  .lb-play { bottom: 12px; padding: 0 16px; font-size: 0.85rem; }
  .lb-counter { top: 12px; font-size: 0.8rem; padding: 4px 10px; }
  .dialog-card { padding: 24px 20px 16px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
}

@media (max-width: 400px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  .hero-title { font-size: 1.6rem; }
  .hero-date { font-size: 0.95rem; }
}
