
:root {
  --bg: #f5f8fc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --brand: #0ea5a4;
  --brand-2: #2563eb;
  --danger: #ef4444;
  --shadow: 0 14px 36px rgba(15, 23, 42, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14,165,164,.08), transparent 28%),
    radial-gradient(circle at top right, rgba(37,99,235,.06), transparent 25%),
    linear-gradient(180deg, #f8fbff, #eef4fb 55%, #f5f8fc);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand img { width: 42px; height: 42px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-top: 2px; }
.nav-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 750;
  transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(14,165,164,.45); background: rgba(14,165,164,.05); }
.btn-primary { color: #fff; background: linear-gradient(135deg, #0ea5a4, #0284c7); border-color: transparent; box-shadow: 0 10px 24px rgba(14,165,164,.16); }
.btn-primary:hover { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.btn-danger { color: #b91c1c; border-color: rgba(239,68,68,.24); background: rgba(239,68,68,.05); }
.icon-btn { width: 42px; padding: 0; }

.hero { padding: 42px 0 18px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; }
.eyebrow { color: #0f766e; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.02; letter-spacing: -.05em; margin: 10px 0 0; max-width: 850px; }
.hero-note { padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); min-width: 130px; text-align: center; }
.hero-note strong { display: block; font-size: 28px; margin-bottom: 3px; }
.hero-note span { color: var(--muted); font-size: 14px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 22px;
}
.section-title h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.section-title p { display:none; }
.search-wrap { position: relative; width: min(320px, 100%); }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .55; }
.search {
  width: 100%; height: 44px; padding: 0 16px 0 42px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; outline: none;
}
.search:focus { border-color: rgba(14,165,164,.55); box-shadow: 0 0 0 4px rgba(14,165,164,.08); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; padding-bottom: 52px; }
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, rgba(148,163,184,.28)); box-shadow: 0 18px 36px rgba(15,23,42,.12); }
.cover-link { display: block; position: relative; aspect-ratio: 16/8.5; overflow: hidden; background: #e2e8f0; }
.cover-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,23,42,.10), transparent 50%); pointer-events: none; }
.cover-link img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.project-card:hover .cover-link img { transform: scale(1.03); }
.project-content { padding: 16px; }
.project-head { display: flex; gap: 12px; align-items: center; }
.project-logo {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, #f8fafc); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent); font-weight: 900; letter-spacing: -.04em; box-shadow: inset 0 0 18px color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 14px;
}
.project-title { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.project-title a:hover { color: var(--accent); }
.category { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.category::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.project-description { color: var(--muted); line-height: 1.55; min-height: 42px; margin: 14px 0; font-size: 14px; }
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid #edf2f7; }
.domain { color: #64748b; font-size: 12px; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch { color: var(--accent); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.launch:hover { gap: 9px; }

.empty { grid-column: 1/-1; padding: 40px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); background: rgba(255,255,255,.72); }
.footer { border-top: 1px solid rgba(148,163,184,.18); padding: 20px 0 28px; color: var(--muted); }
.footer-row { display: flex; justify-content: center; gap: 20px; align-items: center; }

/* Admin */
.admin-shell { padding: 34px 0 72px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.admin-header h1 { font-size: clamp(28px, 5vw, 42px); margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-list { display: grid; gap: 14px; margin-top: 24px; }
.admin-item { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.admin-thumb { width: 96px; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; background: #e2e8f0; }
.admin-item h3 { margin: 0 0 6px; }
.admin-item p { margin: 0; color: var(--muted); font-size: 14px; }
.admin-item-actions { display: flex; gap: 8px; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 18px; background: rgba(15,23,42,.34); backdrop-filter: blur(8px); }
.modal.open { display: grid; }
.modal-card { width: min(720px, 100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 24px 50px rgba(15,23,42,.18); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #edf2f7; background: rgba(255,255,255,.96); }
.modal-head h2 { margin: 0; }
.form { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 750; font-size: 13px; color: #334155; }
.field input, .field textarea, .field select {
  width: 100%; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none;
}
.field input { height: 44px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(14,165,164,.55); box-shadow: 0 0 0 4px rgba(14,165,164,.07); }
.form-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.login-card { width: min(420px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 8px; }
.login-card .field { margin: 18px 0 14px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview-box { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; background: #f8fafc; }
.preview-box img { width: 140px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: #e2e8f0; }
.preview-box small { color: var(--muted); display: block; margin-top: 6px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; padding: 13px 16px; border-radius: 13px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(24px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { transform: none; opacity: 1; }

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { width: 100%; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-item { grid-template-columns: 82px 1fr; }
  .admin-thumb { width: 82px; }
  .admin-item-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 22px, 1180px); }
  .nav { min-height: 64px; }
  .brand small { display: none; }
  .nav-actions .btn span { display: none; }
  h1 { font-size: 34px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-content { padding: 15px; }
  .project-logo { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
  .project-title { font-size: 18px; }
  .card-actions { align-items: flex-start; flex-direction: column-reverse; }
  .domain { max-width: 100%; }
  .form { grid-template-columns: 1fr; padding: 17px; }
  .field.full, .form-actions { grid-column: auto; }
  .form-actions { position: sticky; bottom: 0; padding: 13px 0 0; background: #fff; }
  .form-actions .btn { flex: 1; }
  .preview-box { flex-direction: column; align-items: flex-start; }
  .preview-box img { width: 100%; }
}
