:root {
  color-scheme: dark;
  --bg: #10131c;
  --panel: #171b27;
  --panel-raised: #1d2230;
  --line: #2b3242;
  --text: #f3f5fb;
  --muted: #a0a9bc;
  --muted-soft: #758099;
  --accent: #9a8cff;
  --accent-strong: #7160f4;
  --cyan: #65d7d1;
  --green: #79e2ae;
  --red: #ff828c;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 15% 0%, rgba(113, 96, 244, .12), transparent 35%), var(--bg); color: var(--text); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(43, 50, 66, .86); background: rgba(16, 19, 28, .9); backdrop-filter: blur(18px); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 74px; gap: 22px; }
.brand { display: inline-flex; gap: 10px; align-items: center; min-width: 0; }
.brand-mark { width: 35px; height: 35px; display: inline-grid; place-items: center; border-radius: 11px; color: #11131b; font-size: 19px; font-weight: 900; background: linear-gradient(135deg, var(--cyan), var(--accent)); box-shadow: 0 6px 24px rgba(113, 96, 244, .16); }
.brand-name { font-weight: 780; letter-spacing: -.035em; font-size: 17px; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 9px 13px; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 620; transition: color .15s, background .15s; }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.055); }
.main-content { padding-top: 48px; padding-bottom: 70px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; padding: 18px 0 46px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 850; color: var(--muted-soft); letter-spacing: .17em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(101, 215, 209, .55); }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { margin: 17px 0 12px; font-size: clamp(38px, 6vw, 64px); line-height: 1.02; letter-spacing: -.065em; font-weight: 800; }
.gradient-text { background: linear-gradient(90deg, #a9a0ff 0%, #78e5d8 100%); color: transparent; background-clip: text; -webkit-background-clip: text; }
.hero-description { margin: 0; max-width: 520px; color: var(--muted); font-size: 15px; }
.hero-stats { min-width: 142px; margin-bottom: 6px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(23, 27, 39, .7); display: flex; flex-direction: column; }
.stat-number { font-size: 31px; font-weight: 800; letter-spacing: -.05em; }
.stat-label { color: var(--muted); font-size: 11px; }
.library-section { margin-top: 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.section-heading h2, .admin-heading h1 { margin: 6px 0 0; font-size: clamp(25px, 3.4vw, 34px); letter-spacing: -.045em; }
.total-label { color: var(--muted); font-size: 12px; padding-bottom: 4px; white-space: nowrap; }
.search-form { min-height: 58px; display: flex; align-items: center; gap: 12px; border: 1px solid #343b4e; border-radius: 14px; padding: 7px 8px 7px 17px; background: #171b27; box-shadow: 0 12px 35px rgba(0,0,0,.12); }
.search-icon { font-size: 28px; line-height: 1; color: var(--muted-soft); transform: rotate(-20deg); }
.search-form input { min-width: 0; flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; }
.search-form input::placeholder, input::placeholder, textarea::placeholder { color: #778197; }
.search-button, .button { border: 1px solid transparent; border-radius: 11px; padding: 10px 15px; min-height: 39px; cursor: pointer; font-size: 12px; font-weight: 760; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, background .15s, border-color .15s; }
.search-button, .button-primary { color: #fff; background: var(--accent-strong); box-shadow: 0 5px 16px rgba(113,96,244,.16); }
.search-button:hover, .button-primary:hover { background: #8172fa; transform: translateY(-1px); }
.category-filters { display: flex; gap: 8px; overflow-x: auto; padding: 17px 0 19px; scrollbar-width: thin; }
.filter-pill { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 100px; padding: 8px 14px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 680; transition: all .15s; }
.filter-pill:hover { border-color: #555f78; color: var(--text); }
.filter-pill.active { color: #fff; border-color: rgba(154,140,255,.56); background: rgba(154,140,255,.13); }
.project-list { border: 1px solid var(--line); background: rgba(23,27,39,.75); border-radius: var(--radius); overflow: hidden; }
.project-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(148px, 175px); align-items: center; gap: 17px; padding: 19px 20px; min-height: 130px; border-bottom: 1px solid var(--line); transition: background .15s; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: rgba(255,255,255,.022); }
.project-thumb { width: 64px; height: 64px; border: 1px solid rgba(255,255,255,.07); border-radius: 15px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(145deg, rgba(113,96,244,.23), rgba(101,215,209,.08)); color: #d9d5ff; font-size: 25px; font-weight: 800; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { background: radial-gradient(circle at 20% 20%, rgba(101,215,209,.17), transparent 52%), linear-gradient(145deg, rgba(113,96,244,.21), rgba(23,27,39,.7)); }
.project-info { min-width: 0; }
.project-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.project-title { margin: 0; font-weight: 760; letter-spacing: -.025em; font-size: 15px; overflow-wrap: anywhere; }
.category-tag { color: #c2baff; border: 1px solid rgba(154,140,255,.23); background: rgba(154,140,255,.09); padding: 3px 7px; border-radius: 6px; font-size: 9px; line-height: 1.45; font-weight: 760; }
.project-description { margin: 7px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; color: var(--muted-soft); font-size: 10px; }
.project-meta span { white-space: nowrap; }
.project-actions { display: flex; align-items: stretch; flex-direction: column; gap: 8px; min-width: 0; }
.file-name { color: var(--muted-soft); font-size: 10px; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.button-download { width: 100%; min-height: 38px; color: #141624; background: linear-gradient(100deg, #a7a0ff, #82ded8); font-size: 12px; }
.button-download:hover { transform: translateY(-1px); filter: brightness(1.06); }
.button-download span { font-size: 17px; font-weight: 900; }
.loading-state, .empty-state, .error-state { min-height: 175px; padding: 32px 20px; display: flex; justify-content: center; align-items: center; text-align: center; color: var(--muted); font-size: 13px; }
.error-state { color: #ff9ca3; }
.spinner { display: inline-block; width: 15px; height: 15px; margin-right: 9px; border: 2px solid #454b60; border-top-color: var(--cyan); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-footer { display: flex; flex-direction: column; align-items: center; gap: 11px; padding: 23px 0 0; }
.small-muted, .muted { color: var(--muted-soft); font-size: 11px; margin-bottom: 0; }
.button-secondary { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.035); }
.button-secondary:hover { background: rgba(255,255,255,.075); border-color: #444d62; }
.button:disabled, button:disabled { opacity: .62; cursor: not-allowed; transform: none; }
.hidden { display: none !important; }
.notice-strip { margin-top: 45px; display: flex; gap: 15px; align-items: flex-start; padding: 19px 20px; border: 1px solid rgba(101,215,209,.18); border-radius: 15px; background: rgba(101,215,209,.045); }
.notice-icon { flex: 0 0 35px; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: var(--cyan); background: rgba(101,215,209,.10); font-size: 20px; }
.notice-strip strong { display: block; font-size: 12px; margin: 1px 0 4px; }
.notice-strip p { font-size: 11px; margin: 0; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); background: rgba(11,13,20,.55); }
.footer-inner { padding-top: 28px; padding-bottom: 25px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.footer-brand .brand-mark { width: 29px; height: 29px; border-radius: 9px; font-size: 15px; }
.footer-brand .brand-name { font-size: 13px; }
.footer-copy { margin: 0; flex: 1; color: var(--muted-soft); font-size: 11px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 13px; }
.footer-links a { color: var(--muted); font-size: 10px; }
.footer-links a:hover { color: var(--text); }
.footer-links .admin-link { color: #6c7488; }
.copyright { width: 100%; margin: 4px 0 0; color: #697287; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Content / legal pages */
.content-page { max-width: 850px; margin: 0 auto; padding: 50px 0 78px; }
.content-page .eyebrow { margin-bottom: 12px; }
.content-page h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; letter-spacing: -.055em; margin-bottom: 15px; }
.content-page .intro { font-size: 15px; color: var(--muted); max-width: 700px; margin-bottom: 32px; }
.content-card { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); background: rgba(23,27,39,.75); }
.content-card h2 { margin: 28px 0 9px; font-size: 18px; letter-spacing: -.025em; }
.content-card h2:first-child { margin-top: 0; }
.content-card h3 { font-size: 14px; margin: 20px 0 7px; }
.content-card p, .content-card li { font-size: 13px; line-height: 1.8; color: #b5bdce; }
.content-card ul { padding-left: 20px; }
.content-card a { color: #b2a8ff; text-decoration: underline; text-underline-offset: 3px; }
.content-callout { border-left: 3px solid var(--cyan); padding: 12px 15px; background: rgba(101,215,209,.06); border-radius: 0 10px 10px 0; margin: 18px 0; color: #b8c5d2; font-size: 12px; line-height: 1.7; }
.contact-email-box { margin: 22px 0; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 17px; color: var(--text); overflow-wrap: anywhere; }

/* Admin */
.admin-main { max-width: 850px; padding-top: 44px; padding-bottom: 70px; }
.admin-heading { margin-bottom: 25px; }
.admin-heading h1 { margin-bottom: 8px; }
.admin-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 28px); background: rgba(23,27,39,.83); margin-bottom: 19px; }
.panel h2 { margin: 0 0 5px; font-size: 19px; letter-spacing: -.035em; }
.panel > .muted { margin-bottom: 23px; font-size: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 9px; }
.stack-form label, .form-field label { font-size: 11px; font-weight: 750; color: #d8ddeb; }
.stack-form input:not([type="file"]), .stack-form textarea, .stack-form select, .admin-search input { width: 100%; border: 1px solid #343c50; border-radius: 10px; background: #111520; color: var(--text); padding: 12px 13px; outline: 0; font-size: 13px; }
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus, .admin-search input:focus { border-color: #8172fa; }
.stack-form textarea { resize: vertical; min-height: 105px; }
.login-panel { max-width: 470px; }
.login-panel .button { margin-top: 5px; }
.form-message { margin: 0; min-height: 16px; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.form-message.success { color: var(--green); }
.form-message.error { color: var(--red); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 16px; color: var(--muted); font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.limit-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.full-width { grid-column: 1 / -1; }
.label-hint { color: var(--muted-soft); font-weight: 500; margin-left: 6px; }
.field-help { font-size: 10px; color: var(--muted-soft); margin: -2px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.warning-text { color: var(--red); }
input[type="file"] { width: 100%; color: var(--muted); background: #111520; border: 1px solid #343c50; border-radius: 10px; padding: 9px; font-size: 11px; }
input[type="file"]::file-selector-button { border: 1px solid #444b60; padding: 7px 10px; margin-right: 10px; border-radius: 7px; background: #242a3a; color: var(--text); cursor: pointer; font-weight: 650; font-size: 10px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-top: 7px; }
.form-actions .button { min-width: 165px; }
.admin-search { display: flex; gap: 8px; margin: 18px 0 12px; }
.admin-search input { flex: 1; min-width: 0; }
.admin-project-list { border-top: 1px solid var(--line); }
.admin-project-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.admin-project-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.admin-project-info strong { font-size: 12px; overflow-wrap: anywhere; }
.admin-project-info span { font-size: 10px; color: var(--muted-soft); overflow-wrap: anywhere; }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 10px; flex-shrink: 0; }
.button-danger { border-color: rgba(255,130,140,.24); color: #ffabb2; background: rgba(255,130,140,.07); }
.button-danger:hover { background: rgba(255,130,140,.14); }
.admin-security-note { color: #7f889d; font-size: 10px; text-align: center; margin-top: 25px; }

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 65px; gap: 12px; }
  .brand-name { font-size: 15px; }
  .main-nav { gap: 1px; }
  .nav-link { padding: 8px; font-size: 11px; }
  .main-content { padding-top: 30px; }
  .hero { padding: 12px 0 34px; align-items: flex-start; }
  .hero-stats { min-width: 99px; padding: 12px; }
  .stat-number { font-size: 25px; }
  .stat-label { font-size: 9px; }
  .hero-description { max-width: 390px; font-size: 13px; }
  .project-row { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 15px 13px; }
  .project-thumb { width: 52px; height: 52px; border-radius: 12px; }
  .project-actions { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; }
  .file-name { text-align: left; flex: 1; }
  .button-download { width: auto; min-width: 112px; }
  .project-description { margin-top: 5px; }
  .footer-inner { gap: 13px; }
  .footer-copy { flex-basis: calc(100% - 100px); }
  .footer-links { gap: 11px; }
}
@media (max-width: 480px) {
  .main-nav .nav-link { font-size: 10px; padding: 7px 6px; }
  .hero { flex-direction: column; gap: 17px; }
  .hero-stats { min-width: 120px; flex-direction: row; align-items: baseline; gap: 8px; padding: 9px 12px; }
  .hero-stats .stat-number { font-size: 23px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .search-form { min-height: 52px; gap: 8px; padding-left: 11px; }
  .search-form input { font-size: 12px; }
  .search-button { padding: 9px 10px; }
  .category-filters { margin-right: -14px; padding-right: 14px; }
  .project-row { grid-template-columns: 43px minmax(0, 1fr); gap: 10px; padding: 13px 10px; }
  .project-thumb { width: 43px; height: 43px; border-radius: 11px; font-size: 19px; }
  .project-title { font-size: 13px; }
  .project-description { font-size: 11px; }
  .project-meta { gap: 5px 9px; font-size: 9px; }
  .project-actions { gap: 7px; }
  .button-download { min-width: 104px; font-size: 10px; min-height: 34px; padding: 8px 9px; }
  .file-name { font-size: 9px; }
  .notice-strip { margin-top: 30px; padding: 14px; }
  .footer-links { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .full-width { grid-column: auto; }
  .admin-search { flex-direction: column; }
  .admin-search button { align-self: flex-end; }
  .admin-project-row { gap: 8px; }
  .admin-project-info span { font-size: 9px; }
  .content-page { padding-top: 33px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Project icon preview: always square-cropped */
.cover-preview-wrap { width: 104px; height: 104px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border, #303544); margin-top: 10px; }
.cover-preview-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1 / 1; }
.upload-content-link { margin-top: 14px; display: inline-flex; }
