/* Shelf – bookmarks site. Styles follow the Bookmarks.html design file. */

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

body {
  margin: 0;
  min-height: 100vh;
  background: #FFFFFF;
  color: #111110;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a { color: #D9300B; }
a:hover { color: #A82506; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #D9300B;
  outline-offset: 2px;
}

.mono { font-family: 'JetBrains Mono', monospace; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* ---------- Header ---------- */

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #E7E5E0;
  position: sticky; top: 0; z-index: 5;
}
.site-header-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
}
.logo {
  display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none;
}
.logo span {
  font-size: 24px; font-weight: 600; letter-spacing: -0.03em; color: #D9300B;
}
.total { font-size: 14px; color: #5F5E5A; flex: 1 1 160px; }

.search { flex: 0 1 300px; min-width: 200px; position: relative; margin: 0; }
.search svg { position: absolute; left: 13px; top: 14px; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 38px;
  border: 1px solid #E2E0DA; border-radius: 8px; background: #FFFFFF;
  font: inherit; color: #111110; box-shadow: 0 1px 2px rgba(17,17,16,.05);
}

/* ---------- Buttons ---------- */

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px;
  border: 1px solid #E2E0DA; border-radius: 8px; background: #FFFFFF;
  color: #111110; text-decoration: none; white-space: nowrap; font: inherit;
  box-shadow: 0 1px 2px rgba(17,17,16,.05);
}
.btn-ghost:hover { border-color: #111110; color: #111110; }
button.btn-ghost { cursor: pointer; }
.logout-form { margin: 0; }
.btn-ghost.btn-lg { height: 56px; padding: 0 26px; font-size: 18px; box-shadow: 0 1px 3px rgba(17,17,16,.06); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 26px; border: 0; border-radius: 8px;
  background: #D9300B; color: #FFFFFF; font: inherit; font-size: 18px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px -8px rgba(217,48,11,.7);
}
.btn-primary:hover { background: #B9280A; color: #FFFFFF; }

/* ---------- Layout ---------- */

main {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 96px;
  display: flex; flex-direction: column; gap: 32px;
}

/* ---------- Hero ---------- */

.hero {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 24px 48px; padding: 72px 0 24px;
}
.hero-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 {
  margin: 0; font-size: clamp(44px, 6.4vw, 88px); line-height: 1;
  font-weight: 500; letter-spacing: -0.045em;
}
.hero p { margin: 0; max-width: 520px; font-size: 20px; line-height: 1.45; color: #5F5E5A; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }
.hero-art { flex: 0 1 400px; min-width: 260px; display: flex; justify-content: center; }

/* ---------- Notices ---------- */

.notice {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: #5F5E5A;
  padding: 12px 16px; background: #EEF3FD; border: 1px solid #B9CBF3;
  border-radius: 8px; color: #1B3F9E; align-self: flex-start;
}
.alert {
  margin: 0 0 24px; padding: 14px 18px; background: #FFF3EF;
  border: 1px solid #F3B9A8; border-radius: 8px; color: #8A2207;
}
.alert code { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

.empty {
  padding: 48px 20px; text-align: center; color: #5F5E5A; background: #FFFFFF;
  border: 1px dashed #D6D3CB; border-radius: 10px;
}
.empty-home { margin-top: 32px; }

/* ---------- Folder view ---------- */

.browse {
  display: flex; flex-direction: column; gap: 28px;
  padding-top: 32px; scroll-margin-top: 90px;
}
.folder-head { display: flex; flex-direction: column; gap: 10px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; font-size: 14px; }
.crumb-wrap { display: inline-flex; align-items: center; }
.crumb {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  color: #5F5E5A; text-decoration: none;
}
a.crumb:hover { color: #D9300B; }
.crumb.current { color: #111110; }

.folder-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.btn-back {
  width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid #E2E0DA; border-radius: 8px; background: #FFFFFF;
}
.btn-back:hover { border-color: #111110; }
.folder-title { min-width: 0; }
.folder-title h2 {
  margin: 0; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.02;
  font-weight: 500; letter-spacing: -0.04em; overflow-wrap: anywhere;
}
.folder-stats { font-size: 15px; color: #5F5E5A; padding-top: 6px; }

.group { display: flex; flex-direction: column; gap: 14px; }
.group-label {
  margin: 0; display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: #5F5E5A;
}
.dot { width: 8px; height: 8px; flex: none; display: inline-block; }

.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px;
}
.bm-card {
  display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 18px;
  border: 1px solid #E7E5E0; border-radius: 10px; background: #FFFFFF;
  color: #111110; text-decoration: none;
  box-shadow: 0 1px 2px rgba(17,17,16,.04);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bm-card:hover {
  color: #111110; border-color: #D9300B; transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(17,17,16,.25);
}
.tile {
  flex: none; width: 46px; height: 46px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.card-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-name {
  font-weight: 500; font-size: 17px; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-stats { font-size: 13px; color: #5F5E5A; }
.card-arrow { flex: none; color: #D9300B; font-size: 18px; }

/* ---------- Bookmark rows ---------- */

.list {
  background: #FFFFFF; border: 1px solid #E7E5E0; border-radius: 10px;
  overflow: hidden; box-shadow: 0 1px 2px rgba(17,17,16,.04);
}
.bm-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  text-decoration: none; color: #111110; background: #FFFFFF;
}
.bm-row + .bm-row { border-top: 1px solid #F1EFEB; }
.bm-row:hover { background: #FBF7F5; color: #111110; }
.bm-row:hover .bm-title { color: #D9300B; }

.bm-mono {
  flex: none; width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid #E7E5E0; background: #FAF9F7; color: #111110;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.bm-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bm-title {
  font-weight: 500; font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bm-sub {
  font-size: 13px; color: #5F5E5A;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bm-sub.mono { font-size: 12px; }
.bm-right {
  flex: none; font-size: 13px; color: #5F5E5A; white-space: nowrap;
  max-width: 34%; overflow: hidden; text-overflow: ellipsis;
}
.bm-right.mono { font-size: 12px; }

/* ---------- Search results ---------- */

.search-results { padding-top: 48px; gap: 16px; }
.search-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 12px;
}
.search-head h2 {
  margin: 0; font-size: 40px; line-height: 1.05; font-weight: 500;
  letter-spacing: -0.035em; overflow-wrap: anywhere;
}
.no-results { padding: 40px 20px; text-align: center; color: #5F5E5A; }

/* ---------- Upload page ---------- */

.upload { max-width: 620px; padding-top: 64px; }
.upload h1 {
  margin: 0 0 12px; font-size: clamp(36px, 5vw, 56px); line-height: 1.02;
  font-weight: 500; letter-spacing: -0.04em;
}
.upload .lead { margin: 0 0 28px; font-size: 18px; color: #5F5E5A; }
.upload .lead strong { color: #111110; font-weight: 500; }
.upload-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 500; }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid #E2E0DA; border-radius: 8px; background: #FFFFFF;
  font: inherit; color: #111110; box-shadow: 0 1px 2px rgba(17,17,16,.05);
}
.hint { font-size: 13px; color: #5F5E5A; }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .hero { padding-top: 40px; }
  .bm-right { display: none; }
  .search-head h2 { font-size: 30px; }
}
