@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=IBM+Plex+Mono:wght@300;400&display=swap');

:root {
  --bg: #fafaf8;
  --ink: #1a1a19;
  --ink-soft: #8a887f;
  --ink-faint: #b6b3a7;
  --line: #e4e1d8;
  --line-strong: #cfcbbc;
  --accent: #5c6b52;
  --error: #a44a3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

.display {
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.28em;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
}

a { color: inherit; }
hr.hairline { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.mark {
  width: 34px;
  height: 34px;
  margin: 0 auto 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.login-title {
  font-size: 1.5rem;
  color: var(--ink);
  margin: 0 0 10px;
}

.login-sub {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 300;
  margin: 0 0 32px;
  line-height: 1.6;
}

.login-panel form { text-align: left; }

.field-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-bottom: 8px;
  font-weight: 400;
}

.field-input {
  width: 100%;
  font-size: 1rem;
  font-weight: 300;
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}
.field-input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.btn-line {
  margin-top: 28px;
  width: 100%;
  padding: 13px 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-line:hover { background: var(--ink); color: var(--bg); }
.btn-line:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.error-note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--error);
  font-size: 0.82rem;
  font-weight: 400;
}

/* ---------- App (upload) page ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
  border-bottom: 1px solid var(--line);
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-header .brand-title { font-size: 0.95rem; margin: 0; }
.app-header .logout-link {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 400;
  border-bottom: 1px solid transparent;
}
.app-header .logout-link:hover { border-bottom-color: var(--ink-soft); }

.app-main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 0;
  background: transparent;
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.is-dragover {
  border-color: var(--ink);
  background: rgba(0, 0, 0, 0.015);
}
.dropzone .drop-title {
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0.02em;
}
.dropzone .drop-sub {
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 300;
  margin: 0;
}
.dropzone input[type=file] { display: none; }

.queue {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}
.queue-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.queue-item .queue-name {
  font-size: 0.78rem;
  font-weight: 300;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.queue-bar {
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.queue-fill {
  height: 100%;
  width: 0%;
  background: var(--ink);
  transition: width 0.15s ease;
}
.queue-item.is-done .queue-fill { background: var(--accent); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 56px 0 24px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 12px;
}
.section-heading h2 {
  font-size: 0.8rem;
  margin: 0;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.section-heading .count {
  color: var(--ink-faint);
  font-size: 0.76rem;
  font-weight: 300;
}

.gallery-empty {
  color: var(--ink-faint);
  font-weight: 300;
  font-size: 0.86rem;
  padding: 20px 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.photo-card {
  background: var(--bg);
  text-decoration: none;
  display: block;
}
.photo-card .thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #efeee8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0);
  transition: opacity 0.15s ease;
}
.photo-card:hover img { opacity: 0.85; }
.photo-card .thumb-fallback {
  font-size: 0.66rem;
  font-weight: 300;
  color: var(--ink-faint);
  text-align: center;
  padding: 8px;
}
.photo-card .caption {
  display: block;
  padding: 8px 2px;
  font-size: 0.62rem;
  font-weight: 300;
  color: var(--ink-faint);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .app-header { padding: 16px 20px; }
  .app-main { padding: 36px 18px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-line, .dropzone, .queue-fill, .photo-card img { transition: none; }
}
