:root {
  --bg: #050505;
  --bg-soft: #09152a;
  --brand-blue: #081b3b;
  --accent: #089bdb;
  --accent-soft: #38bdf8;
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.68);
  --line: rgba(245, 245, 245, 0.1);
  --line-soft: rgba(245, 245, 245, 0.07);
  --card-bg: #0b1526;
  --card-bg-hover: #0e1c33;
  --field-bg: rgba(245, 245, 245, 0.04);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: linear-gradient(180deg, var(--brand-blue) 0%, var(--bg) 320px);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
}

h1, h2, h3 {
  font-family: 'Hammersmith One', sans-serif;
  font-weight: 400;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: 'Hammersmith One', sans-serif;
}

.brand-text strong {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.brand-text span {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--accent-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.topbar-cta:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(8, 155, 219, 0.08);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--accent-soft);
  padding: 8px 14px;
  border: 1px solid rgba(8, 155, 219, 0.3);
  border-radius: 8px;
  background: rgba(8, 155, 219, 0.08);
  white-space: nowrap;
}

/* Main / hero */
main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px 90px;
}

.hero {
  text-align: center;
  padding: 64px 0 48px;
}

.hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: 0.01em;
}

.hero-subtitle {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* Category sections */
.category {
  margin-top: 44px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.category-icon {
  font-size: 1.4rem;
  color: var(--accent);
  background: rgba(8, 155, 219, 0.1);
  border: 1px solid rgba(8, 155, 219, 0.22);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-header h2 {
  font-size: 1.2rem;
}

.category-header p {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 2px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 320px));
  gap: 18px;
}

.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(8, 155, 219, 0.45);
  background: var(--card-bg-hover);
  box-shadow: var(--shadow);
}

.card.is-deleting {
  opacity: 0.45;
  pointer-events: none;
}

.card-open {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 245, 245, 0.18);
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.55);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.card-delete:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.card-thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: #081222;
  border-bottom: 1px solid var(--line-soft);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-thumb--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #0b2b52 55%, var(--accent) 160%);
  color: var(--text);
}

.card-thumb--placeholder i {
  font-size: 1.6rem;
  opacity: 0.9;
}

.card-thumb--placeholder span {
  font-family: 'Hammersmith One', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-body h3 {
  font-size: 1.05rem;
}

.card-body p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.card-link {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--accent-soft);
}

.card-link i {
  transition: transform 0.18s ease;
}

.card:hover .card-link i {
  transform: translateX(4px);
}

/* Add project */
.add-project {
  margin-top: 60px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 245, 245, 0.02);
}

.add-project-header h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-project-header h2 i {
  color: var(--accent);
}

.add-project-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.add-project-header strong {
  color: var(--accent-soft);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.locked-panel {
  margin-top: 22px;
  padding: 32px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.locked-panel i {
  font-size: 1.8rem;
  color: var(--accent);
}

.locked-panel p {
  color: var(--muted);
  font-size: 0.9rem;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem;
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 6px;
}

.link-btn:hover {
  text-decoration: underline;
}

.field input[type='file'] {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.field input[type='file']::file-selector-button {
  background: var(--accent);
  color: #04101f;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  margin-right: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.project-form {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.8rem;
  color: var(--muted);
}

.field .optional {
  opacity: 0.7;
  font-size: 0.76rem;
}

.field input,
.field select,
.field textarea {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 44px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: rgba(8, 155, 219, 0.06);
}

.field select option {
  background: var(--bg-soft);
  color: var(--text);
}

.field-submit {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-direction: row;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #04101f;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-soft);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-message {
  font-size: 0.84rem;
  color: var(--muted);
}

.form-message.error {
  color: #f87171;
}

.form-message.success {
  color: #34d399;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--accent-soft);
}

.site-footer a:hover {
  text-decoration: underline;
}

/* SmedPanel login */
.login-main {
  max-width: 460px;
  margin: 0 auto;
  padding: 72px 24px 90px;
}

.login-card {
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 245, 245, 0.02);
}

.login-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
}

.login-card-header i {
  font-size: 1.7rem;
  color: var(--accent);
  background: rgba(8, 155, 219, 0.1);
  border: 1px solid rgba(8, 155, 219, 0.22);
  border-radius: 12px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-card-header h1 {
  font-size: 1.25rem;
}

.login-card-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .topbar-cta span {
    display: none;
  }
  .hero {
    padding: 48px 0 36px;
  }
  .project-form {
    grid-template-columns: 1fr;
  }
  .field-submit {
    flex-direction: column;
    align-items: flex-start;
  }
}
