/* ══════════════════════════════════════
   Brabura Document Hub — Stylesheet
   ══════════════════════════════════════ */

/* ── Reset & Variables ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --dark: #2d2d2d;
  --accent: #e88712;
  --accent-light: #fdf6ef;
  --accent-bg: #fcebd8;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --bg: #f5f5f5;
  --white: #fff;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav bar ── */
.nav {
  background: var(--dark);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.nav.scrolled {
  background: rgba(30, 30, 30, 0.88);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

/* Spacer to compensate fixed nav */
.nav-spacer { height: 56px; }

/* Nav logo */
.nav-logo {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-logo img {
  height: 36px;
  display: block;
}

.nav-links a {
  color: #ccc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 20px 10px;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.35s ease, left 0.35s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; left: 0; }
.nav-links a.active { color: var(--white); pointer-events: none; }

/* ── Nav right (lang + search) ── */
.nav-right {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrap {
  position: relative;
}

/* ── Language dropdown ── */
.lang-dropdown { position: relative; }

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.lang-current:hover { border-color: rgba(255, 255, 255, 0.35); color: var(--white); }

.lang-flag { width: 16px; height: 12px; object-fit: cover; border-radius: 2px; }

.lang-menu {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  min-width: 150px;
  z-index: 2001;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-dropdown.open .lang-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-dropdown:not(.open) .lang-menu {
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.4, 0, 1, 1);
}

.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.lang-menu-item:hover { background: var(--accent-light); }
.lang-menu-item.active { color: var(--accent); font-weight: 600; }
.lang-menu-item + .lang-menu-item { border-top: 1px solid var(--border-light); }

.lang-dropdown.open .lang-menu-item {
  animation: langIn 0.2s ease both;
}
.lang-dropdown.open .lang-menu-item:nth-child(2) { animation-delay: 0.03s; }
.lang-dropdown.open .lang-menu-item:nth-child(3) { animation-delay: 0.06s; }
.lang-dropdown.open .lang-menu-item:nth-child(4) { animation-delay: 0.09s; }
.lang-dropdown.open .lang-menu-item:nth-child(5) { animation-delay: 0.12s; }
.lang-dropdown.open .lang-menu-item:nth-child(6) { animation-delay: 0.15s; }
.lang-dropdown.open .lang-menu-item:nth-child(7) { animation-delay: 0.18s; }
.lang-dropdown.open .lang-menu-item:nth-child(8) { animation-delay: 0.21s; }
.lang-dropdown.open .lang-menu-item:nth-child(9) { animation-delay: 0.24s; }
.lang-dropdown.open .lang-menu-item:nth-child(10) { animation-delay: 0.27s; }
.lang-dropdown.open .lang-menu-item:nth-child(11) { animation-delay: 0.3s; }

@keyframes langIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Drawer lang */
.drawer-lang {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-lang-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
}

.drawer-lang-item:hover { color: var(--accent); border-color: var(--accent); }
.drawer-lang-item.active {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
}

/* Mobile lang */
.mobile-lang-btn {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  transition: border-color 0.2s, color 0.2s;
}

.mobile-lang-btn:hover { border-color: rgba(255, 255, 255, 0.35); color: var(--white); }

.mobile-lang-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px;
  max-height: 0;
  overflow: hidden;
  background: var(--white);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, opacity 0.25s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-lang-panel.open {
  max-height: 300px;
  padding: 10px;
  opacity: 1;
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.mobile-lang-item {
  flex: 0 0 calc(50% - 3px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
}

.mobile-lang-item:hover { background: var(--accent-light); border-color: var(--accent); }

.mobile-lang-panel.open .mobile-lang-item { animation: langItemIn 0.25s ease both; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(2) { animation-delay: 0.03s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(3) { animation-delay: 0.06s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(4) { animation-delay: 0.09s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(5) { animation-delay: 0.12s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(6) { animation-delay: 0.15s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(7) { animation-delay: 0.18s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(8) { animation-delay: 0.21s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(9) { animation-delay: 0.24s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(10) { animation-delay: 0.27s; }
.mobile-lang-panel.open .mobile-lang-item:nth-child(11) { animation-delay: 0.3s; }

@keyframes langItemIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-lang-item.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ── Header ── */
.header {
  background: var(--white);
  text-align: center;
  padding: 30px 20px;
  border-bottom: 1px solid var(--border);
}

.header-logo { max-width: 200px; }

.header-subtitle {
  font-size: 13px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-light);
  margin-top: 30px;
}

/* ── Sub-nav buttons (3D) ── */
.subnav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 0;
  width: 90%;
  max-width: 620px;
}

.subnav a {
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.subnav a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.subnav a.active {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(232, 135, 18, 0.25);
}

/* Subnav with icons */
.subnav-icons { gap: 20px; }

.subnav-icons a {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 28px 12px;
  border-radius: 8px;
}

.subnav-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.5;
  transition: opacity 0.25s, filter 0.25s;
}

.subnav-icons a:hover .subnav-icon {
  opacity: 0.8;
  filter: brightness(0) saturate(100%) invert(56%) sepia(89%) saturate(797%) hue-rotate(349deg) brightness(93%) contrast(90%);
}

.subnav-icons a.active .subnav-icon {
  opacity: 1;
  /* Tint to white */
  filter: brightness(0) invert(1);
}

.subnav-icons a { display: flex; }

/* ── Card / File list ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 90%;
  max-width: 620px;
  margin: 30px auto 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-3d {
  margin-top: 20px;
  animation: cardEnter 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-title {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #eee;
  margin: 0;
  background: #fafafa;
}

.file-list { list-style: none; padding: 4px 0; }

.file-list li {
  display: flex;
  align-items: stretch;
  margin: 0;
  font-size: 14px;
}

.file-list li > a:first-child { flex: 1; min-width: 0; }
.file-list li + li { border-top: 1px solid var(--border-light); }

.file-list a {
  color: #444;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 15px 24px;
  gap: 14px;
  letter-spacing: 0.3px;
  transition: background 0.2s, color 0.2s;
}

.file-list a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
  padding-left: 12px;
}

.file-list a:hover .file-size { color: var(--accent); }

/* File size badges */
.file-size.size-light {
  color: #2e7d32;
  background: #e8f5e9;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
}

.file-size.size-heavy {
  color: #c8a415;
  background: #fdf9e6;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
}

.file-list a:hover .file-size.size-light { background: #c8e6c9; color: #1b5e20; }
.file-list a:hover .file-size.size-heavy { background: #f5efbf; color: #9e8a0e; }

/* Download button */
.file-list .download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  padding: 0;
  color: #999;
  background: none;
  border-left: 1px solid var(--border-light);
  transition: color 0.2s, background 0.2s;
}

.file-list .download-btn svg { width: 16px; height: 16px; min-width: 16px; flex-shrink: 0; }
.file-list .download-btn:hover { color: var(--accent); background: var(--accent-light); }

/* ── File icons ── */
.file-icon {
  display: inline-block;
  width: 34px;
  height: 34px;
  background: var(--border-light);
  border-radius: 4px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: background-color 0.2s;
}

.file-list a:hover .file-icon {
  background-color: var(--accent-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e8913a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E");
}

.file-icon.pdf-icon {
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23e53935' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Ctext x='6' y='18' font-size='7.5' font-weight='bold' fill='%23e53935' stroke='none' font-family='Arial'>PDF%3C/text%3E%3C/svg%3E");
}
.file-list a:hover .file-icon.pdf-icon {
  background-color: #fce4ec;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23c62828' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Ctext x='6' y='18' font-size='7.5' font-weight='bold' fill='%23c62828' stroke='none' font-family='Arial'>PDF%3C/text%3E%3C/svg%3E");
}

.file-icon.obj-icon {
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%234a90d9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Ctext x='5' y='18' font-size='7' font-weight='bold' fill='%234a90d9' stroke='none' font-family='Arial'>OBJ%3C/text%3E%3C/svg%3E");
}
.file-list a:hover .file-icon.obj-icon {
  background-color: #e3f2fd;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%231565c0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Ctext x='5' y='18' font-size='7' font-weight='bold' fill='%231565c0' stroke='none' font-family='Arial'>OBJ%3C/text%3E%3C/svg%3E");
}

.file-icon.stp-icon {
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Ctext x='5.5' y='18' font-size='7' font-weight='bold' fill='%232e7d32' stroke='none' font-family='Arial'>STP%3C/text%3E%3C/svg%3E");
}
.file-list a:hover .file-icon.stp-icon {
  background-color: #e8f5e9;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%231b5e20' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Ctext x='5.5' y='18' font-size='7' font-weight='bold' fill='%231b5e20' stroke='none' font-family='Arial'>STP%3C/text%3E%3C/svg%3E");
}

.file-icon.folder-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%23e8c97a' stroke='%23bfa54a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}
.file-list a:hover .file-icon.folder-icon {
  background-color: var(--accent-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%23f5c96a' stroke='%23e8913a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  margin-right: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--white);
  background: var(--accent);
  text-decoration: none;
  border-radius: 4px;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.2s;
}

.back-link:hover { background: #d17e2f; transform: translateX(-2px); }

.empty-msg {
  padding: 30px 24px;
  text-align: center;
  color: #bbb;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ── Catalogue covers ── */
.catalogue-covers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 90%;
  max-width: 240px;
  margin: 28px auto 0;
}

.catalogue-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  cursor: pointer;
}

.catalogue-cover img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.catalogue-cover-label {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.25s;
}

.catalogue-cover:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(232, 145, 58, 0.15);
  transform: translateY(-3px);
}

.catalogue-cover:hover .catalogue-cover-label { color: var(--accent); }

.catalogue-cover.active {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(232, 145, 58, 0.2);
}

.catalogue-cover.active .catalogue-cover-label {
  color: var(--white);
  background: var(--accent);
  width: 100%;
  text-align: center;
}

.catalogue-section {
  display: none;
}

.catalogue-section.active {
  display: block;
}

/* ── Home grid ── */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 90%;
  max-width: 620px;
  margin: 30px auto 0;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.home-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(232, 145, 58, 0.15);
  transform: translateY(-3px);
}

.home-card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 14px;
  transition: background 0.25s, color 0.25s;
}

.home-card:hover .home-card-icon { background: var(--accent); color: var(--white); }

.home-card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.home-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ── Search: nav input ── */

.search-wrap .search-input {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  padding: 10px 30px 10px 38px;
  width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  outline: none;
  transition: border-color 0.25s, width 0.3s, background 0.25s;
}

.search-wrap .search-input::placeholder { color: rgba(255, 255, 255, 0.55); }

.search-wrap .search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.22);
  width: 280px;
}

.search-wrap-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: color 0.25s;
}

.search-wrap .search-input:focus ~ .search-wrap-icon { color: var(--accent); }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  display: none;
  transition: color 0.2s;
}

.search-clear:hover { color: var(--white); }
.search-wrap .search-input:not(:placeholder-shown) ~ .search-clear { display: block; }

/* ── Search: dropdown ── */
.search-dropdown {
  position: fixed;
  left: 0;
  right: 0;
  top: 56px;
  max-height: min(55vh, 460px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  z-index: 2000;
  padding: 16px;
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  pointer-events: none;
  transition: clip-path 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.search-dropdown.open {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  pointer-events: auto;
}

.search-dropdown:not(.open) {
  transition: clip-path 0.25s cubic-bezier(0.4, 0, 1, 1), opacity 0.2s ease 0.05s;
}

.search-inner { max-width: 960px; margin: 0 auto; }

.search-dropdown-close {
  float: right;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}

.search-dropdown-close:hover { color: var(--accent); border-color: var(--accent); }

/* Cards stagger animation */
.search-dropdown.open .search-card { animation: cardIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both; }
.search-dropdown.open .search-card:nth-child(1) { animation-delay: 0.04s; }
.search-dropdown.open .search-card:nth-child(2) { animation-delay: 0.08s; }
.search-dropdown.open .search-card:nth-child(3) { animation-delay: 0.12s; }
.search-dropdown.open .search-card:nth-child(4) { animation-delay: 0.16s; }
.search-dropdown.open .search-card:nth-child(5) { animation-delay: 0.2s; }
.search-dropdown.open .search-card:nth-child(6) { animation-delay: 0.24s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Search: result cards (shared by dropdown + results page) ── */
.search-group { margin-bottom: 8px; }

.search-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.search-group-count { font-weight: 400; color: #bbb; font-size: 10px; }

.search-group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.search-card {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 8px;
  min-width: 0;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.search-card:hover {
  background: var(--accent-light);
  box-shadow: 0 2px 8px rgba(232, 135, 18, 0.12);
  transform: translateY(-1px);
}

.search-card-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
}

.search-card-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  color: #999;
  text-decoration: none;
  border-left: 1px solid var(--border-light);
  align-self: stretch;
  transition: color 0.2s;
}

.search-card:hover .search-card-dl { color: var(--accent); }

.search-card-ext {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #f0f0f0;
  color: #999;
}

.search-card-ext--pdf  { background: #fce4ec; color: #e53935; }
.search-card-ext--obj  { background: #e3f2fd; color: #1565c0; }
.search-card-ext--stp,
.search-card-ext--step { background: #e8f5e9; color: #2e7d32; }

.search-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-card-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-card:hover .search-card-name { color: var(--accent); }
.search-card:hover .search-card-link { color: var(--accent); }
.search-card-size { font-size: 11px; color: var(--text-muted); }

.search-group-more {
  text-align: center;
  padding: 8px 0 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.search-view-all {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 12px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: var(--accent);
  border-radius: 4px;
  transition: background 0.2s;
}

.search-view-all:hover { background: #d17e2f; }

.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Results page ── */
.results-page { width: 90%; max-width: 800px; margin: 30px auto 0; }

.results-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.results-query {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
}

.results-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-page .search-group {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.results-page .search-group-title {
  border-bottom: none;
  padding: 0 0 12px;
}

.results-page .search-group-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

/* ── Footer ── */
.footer {
  margin-top: 50px;
  background: var(--dark);
  padding: 30px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  line-height: 2;
  letter-spacing: 0.5px;
}

.footer a { color: #bbb; text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--accent); }
.footer .divider { display: inline-block; margin: 0 10px; color: #555; }

/* ── Hamburger ── */
.hamburger {
  display: none;
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 10;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ccc;
  margin: 5px 0;
  border-radius: 1px;
}

/* ── Mobile drawer ── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open { display: block; opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--dark);
}

.drawer-header img { height: 48px; }

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.drawer-close svg { width: 18px; height: 18px; stroke: var(--text-muted); transition: stroke 0.2s; }
.drawer-close:hover svg { stroke: var(--white); }

.drawer-search {
  position: relative;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-search .search-dropdown-close { display: none; }

.drawer-search-input-wrap { position: relative; }

.drawer-search .search-input {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 10px 32px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}

.drawer-search .search-input::placeholder { color: var(--text-muted); }
.drawer-search .search-input:focus { border-color: var(--accent); }

.drawer-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  display: none;
}

.drawer-search-clear:hover { color: var(--text); }
.drawer-search-input-wrap .search-input:not(:placeholder-shown) ~ .drawer-search-clear { display: block; }

.drawer-search .search-dropdown {
  position: static;
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0;
  border-top: 1px solid var(--border-light);
  margin: 10px 0 0;
  padding: 12px 0 0;
  clip-path: none;
  opacity: 1;
  pointer-events: auto;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  display: none;
}

.drawer-search .search-dropdown.open { display: block; }
.drawer-search .search-dropdown .search-group-grid { grid-template-columns: 1fr; }

.drawer-menu { list-style: none; padding: 8px 0; }

.drawer-menu li a {
  display: block;
  color: #555;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.3px;
  padding: 16px 28px;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid var(--border-light);
}

.drawer-menu li:last-child a { border-bottom: none; }
.drawer-menu li a:hover { background: var(--accent-light); color: var(--accent); }
.drawer-menu li a.active { color: var(--accent); font-weight: 600; background: var(--accent-light); }

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */
@media (max-width: 480px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-card { padding: 24px 16px; }
}

@media (max-width: 640px) {
  .nav { padding: 16px 16px; }
  .nav-spacer { height: 76px; }
  .nav-links { display: none; }
  .nav-right { display: none; }
  .hamburger { display: block; }
  .nav-logo { position: static; transform: none; }
  .nav-logo img { height: 44px; }
  .mobile-lang-btn { display: flex; }
  .drawer-lang { display: none; }

  .header { padding: 25px 16px 20px; }
  .header-logo { max-width: 150px; }
  .header-subtitle { margin-top: 16px; font-size: 11px; letter-spacing: 2px; }

  .subnav { width: 95%; margin-top: 20px; gap: 8px; }
  .subnav a { font-size: 10px; padding: 9px 24px; letter-spacing: 1.5px; }

  .card { width: 95%; margin-top: 20px; }
  .card-title { font-size: 10px; padding: 14px 18px 12px; }
  .file-list a { padding: 12px 16px; font-size: 13px; gap: 10px; }
  .file-icon { width: 28px; height: 28px; }
  .file-size { font-size: 11px; padding-left: 8px; }
  .download-btn { margin-right: 10px; }

  .search-group-grid { grid-template-columns: 1fr; }
  .results-page .search-group-grid { grid-template-columns: 1fr; }
  .results-page .search-group { padding: 16px; }
  .results-header { padding: 20px; }
  .results-query { font-size: 18px; }

  .footer {
    padding: 28px 16px 22px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    line-height: 1.6;
  }
  .footer .divider { display: none; }
}

@media (min-width: 641px) {
  .drawer, .drawer-overlay { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .search-dropdown { transition: opacity 0.15s ease; clip-path: none; }
  .search-dropdown.open .search-card { animation: none; }
  .card-3d { animation: none; }
}

/* ── Focus states (keyboard accessibility) ── */
.nav-links a:focus-visible,
.subnav a:focus-visible,
.home-card:focus-visible,
.file-list a:focus-visible,
.search-card:focus-visible,
.search-card-link:focus-visible,
.lang-menu-item:focus-visible,
.drawer-menu li a:focus-visible,
.drawer-lang-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.search-wrap .search-input:focus-visible,
.drawer-search .search-input:focus-visible,
.login-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.back-link:focus-visible,
.download-btn:focus-visible,
.search-card-dl:focus-visible,
.search-view-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── RTL support ── */
[dir="rtl"] .nav-right { right: auto; left: 20px; }
[dir="rtl"] .hamburger { left: auto; right: 18px; }
[dir="rtl"] .nav-links a::after { left: auto; right: 50%; }
[dir="rtl"] .nav-links a:hover::after,
[dir="rtl"] .nav-links a.active::after { right: 0; left: auto; }
[dir="rtl"] .search-wrap-icon { left: auto; right: 13px; }
[dir="rtl"] .search-wrap .search-input { padding: 10px 38px 10px 30px; }
[dir="rtl"] .search-clear { right: auto; left: 10px; }
[dir="rtl"] .back-link { margin-right: 0; margin-left: 12px; }
[dir="rtl"] .back-link:hover { transform: translateX(2px); }
[dir="rtl"] .file-size { padding-left: 0; padding-right: 12px; }
[dir="rtl"] .file-list .download-btn { border-left: none; border-right: 1px solid var(--border-light); }
[dir="rtl"] .search-card-dl { border-left: none; border-right: 1px solid var(--border-light); }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .drawer-search-clear { right: auto; left: 8px; }
[dir="rtl"] .drawer-search .search-input { padding: 10px 14px 10px 32px; }
