/* Fewster Collective */
:root {
  --bg: #0f1219;
  --bg-elevated: #1a1f2e;
  --bg-card: #222836;
  --text: #e8e4dc;
  --text-muted: #9ca3af;
  --accent: #c9a962;
  --accent-hover: #dbbe78;
  --border: rgba(232, 228, 220, 0.1);
  --header-h: 72px;
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(15, 18, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  background: rgba(15, 18, 25, 0.95);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 2rem) 1.5rem 4rem;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 18, 25, 0.55) 0%,
    rgba(15, 18, 25, 0.75) 50%,
    rgba(15, 18, 25, 0.92) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
}

.hero-logo {
  width: min(280px, 50vw);
  height: auto;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.5));
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

/* Sections */
.section {
  padding: 6rem 1.5rem;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  margin: 0 0 2.5rem;
}

.about {
  background: var(--bg-elevated);
}

.about-text {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.8;
}

/* Business cards */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-chip:hover,
.filter-chip.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.business-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.business-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 98, 0.35);
  box-shadow: var(--shadow);
}

.business-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.business-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.business-logo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.25rem;
}

.business-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  background: rgba(201, 169, 98, 0.12);
  border-radius: 6px;
}

.business-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.business-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.business-link {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: auto;
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 4rem 1.5rem 2rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
}

.footer-brand img {
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0;
}

.footer-details {
  color: var(--text-muted);
}

.footer-details p {
  margin: 0 0 0.5rem;
}

.footer-details a {
  color: var(--text-muted);
}

.footer-details a:hover {
  color: var(--accent);
}

.footer-copy {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 2rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text);
}

/* Construction & admin auth */
.construction-page,
.admin-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at top, #1a1f2e 0%, var(--bg) 60%);
}

.construction-card,
.admin-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.construction-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-lg);
}

.construction-card h1,
.admin-card h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.construction-tagline,
.admin-subtitle {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.construction-form,
.admin-form {
  text-align: left;
}

.construction-form label,
.admin-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.construction-form input,
.admin-form input,
.admin-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.construction-form input:focus,
.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.construction-form .btn,
.admin-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.form-error {
  color: #f87171;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.form-success {
  color: #4ade80;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.admin-back {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.admin-back a {
  color: var(--text-muted);
}

/* Admin dashboard */
.admin-dashboard {
  display: block;
  padding: 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0;
}

.admin-header-actions {
  display: flex;
  gap: 0.75rem;
}

.admin-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.admin-panel h2 {
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
}

.admin-form-grid {
  display: grid;
  gap: 0 0.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.current-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  white-space: nowrap;
}

.inline-form {
  display: inline;
}

.link-danger {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: #f87171;
  cursor: pointer;
}

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

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav a {
    display: block;
    padding: 0.85rem 1.5rem;
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .admin-header {
    padding: 1rem 1.25rem;
  }

  .admin-main {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
