/* ============================================================
   WCSH HIH PROJECT CATALOG — shared styles
   Palette: paper (#F7F1E8), ink (#241C17), orange (#D2551D),
            amber (#E8A23A), pine (#2F5F55), line (#E9DECB)
   Type: Space Grotesk (display) / Inter (body) / IBM Plex Mono (data)
   ============================================================ */

:root {
  --paper: #F7F1E8;
  --panel: #FFFFFF;
  --ink: #241C17;
  --ink-soft: #6B5C4F;
  --orange: #D2551D;
  --orange-dark: #A8410F;
  --orange-soft: #FBEADD;
  --amber: #E8A23A;
  --pine: #2F5F55;
  --line: #E9DECB;
  --shelf: #A8410F;
  --radius: 10px;
  --shadow: 0 2px 4px rgba(36,28,23,0.07), 0 12px 30px rgba(36,28,23,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(210,85,29,0.12) 1px, transparent 0);
  background-size: 26px 26px;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Home page ---------- */

.home-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.home-card {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 40px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--orange), var(--amber));
}

.logo-badge {
  width: 108px;
  height: 108px;
  margin: 0 auto 28px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-badge > img,
.logo-badge > .logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  padding: 12px;
}

.logo-fallback {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--orange);
  letter-spacing: 0.03em;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.home-title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.home-sub {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.btn-primary {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- Dashboard page ---------- */

.dash-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.dash-header .id {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-header .badge-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dash-header .badge-sm img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.dash-header h1 { font-size: 20px; font-weight: 600; }
.dash-header p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }

.back-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.back-link:hover { color: var(--orange); border-color: var(--orange); }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 620px) {
  .action-grid { grid-template-columns: 1fr; }
}

.action-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.action-card:hover { border-color: var(--orange); transform: translateY(-2px); }
.action-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.action-card .tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.action-card h3 {
  margin-top: 8px;
  font-size: 18px;
}

.action-card p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- Panels (Enter / Open project) ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  display: none;
}

.panel.is-open { display: block; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-head h2 { font-size: 17px; font-weight: 600; }

.close-x {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}
.close-x:hover { color: var(--ink); }

/* form */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus {
  outline: none;
  border-color: var(--orange);
  background: #fff;
}

.form-msg {
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}
.form-msg.ok { color: var(--orange); }
.form-msg.err { color: #B3402A; }

.submit-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 14.5px;
  font-weight: 600;
}
.submit-btn:hover { background: var(--orange-dark); }
.submit-btn:disabled { opacity: 0.6; cursor: wait; }

/* shelf list */

.shelf-status {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.shelf-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 6px solid var(--shelf);
  border-radius: 0 0 3px 3px;
  position: relative;
}

.shelf-row::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 6px;
  background: linear-gradient(180deg, rgba(0,0,0,0.15), transparent);
}

.book {
  background: var(--orange);
  border-radius: 6px 6px 3px 3px;
  padding: 14px 12px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.book:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(168,65,15,0.35); }
.book:nth-child(4n+2) { background: var(--amber); }
.book:nth-child(4n+3) { background: var(--pine); }
.book:nth-child(4n) { background: var(--ink); }

.book .name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.book .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  opacity: 0.8;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 14px;
}