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

html {
  height: 100%;
}

html:has(body.site-theme) {
  scroll-behavior: smooth;
}

/* Shared site theme */
body.site-theme {
  --bg: #0a0a0b;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --grid-line: rgba(255, 255, 255, 0.02);
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body.site-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -2;
}

body.site-theme::after {
  content: "";
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent 70%);
  top: -300px;
  right: -200px;
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

body.site-theme.light {
  --bg: #f5f5f5;
  --surface: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.1);
  --text: #111111;
  --muted: #555555;
  --grid-line: rgba(0, 0, 0, 0.06);
}

body.site-theme.light::after {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.04), transparent 70%);
}

.site-nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 28px clamp(1.25rem, 5vw, 5rem);
  position: fixed;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(10px);
  background: rgba(10, 10, 11, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.site-theme.light .site-nav {
  background: rgba(245, 245, 245, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.site-logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

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

.site-nav-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-nav-btn:hover,
.site-nav-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7.5rem clamp(1.25rem, 5vw, 5rem) 3rem;
}

.page-header {
  margin-bottom: 2.5rem;
}

.page-eyebrow,
.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-header h1,
body.site-theme.is-landing .hero h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-lead,
.hero-tagline {
  margin: 1rem 0 0;
  max-width: 40rem;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  line-height: 1.65;
  color: var(--muted);
}

.site-stack {
  display: grid;
  gap: 1.25rem;
}

.site-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 5rem) 5rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
}

.section-header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  color: var(--text);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

a.site-card {
  text-decoration: none;
}

.site-card:hover,
.site-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

body.site-theme.light .site-card:hover,
body.site-theme.light .site-card:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.18);
}

.site-card h2,
.site-card h3 {
  margin: 0 0 0.65rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.site-card p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.card-label {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-cta {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.85;
}

.section-card,
.path-card {
  display: block;
}

.section-card:hover .card-cta,
.section-card:focus-visible .card-cta,
.path-card:hover .card-cta,
.path-card:focus-visible .card-cta {
  opacity: 1;
}

.page-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-back:hover,
.page-back:focus-visible {
  color: var(--text);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.social-link-card {
  display: block;
}

.social-empty {
  grid-column: 1 / -1;
}

.admin-hint,
.admin-preview-row {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-preview-row + .admin-preview-row {
  margin-top: 0.35rem;
}

.admin-status {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-status.is-error {
  color: #f87171;
}

.social-editor-row {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.social-editor-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.social-remove-btn {
  justify-self: start;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.social-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.site-footer {
  text-align: center;
  padding: 3rem clamp(1.25rem, 5vw, 5rem) 4rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.site-theme.light .site-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* Landing-only */
body.site-theme.is-landing .hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10rem clamp(1.25rem, 5vw, 5rem) 5rem;
}

body.site-theme.is-landing .hero h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

body.site-theme.is-landing .hub-statement {
  max-width: 40rem;
  margin: 1.75rem auto 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

body.site-theme.is-landing .hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.btn-primary {
  padding: 0.85rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #f5f5f5;
  color: #0a0a0b;
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
}

body.site-theme.light .btn-primary {
  background: #111111;
  color: #f5f5f5;
  border-color: transparent;
}

.btn-secondary {
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--surface);
}

/* Admin forms */
.site-form {
  display: grid;
  gap: 0.85rem;
}

.site-field {
  display: grid;
  gap: 0.35rem;
  text-align: left;
}

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

.site-input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font: inherit;
}

body.site-theme.light .site-input {
  background: rgba(0, 0, 0, 0.04);
}

.site-input::placeholder {
  color: var(--muted);
}

.site-preview-title {
  margin: 0 0 0.35rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
}

.site-preview-subtitle,
.site-preview-about {
  margin: 0;
  color: var(--muted);
}

.site-preview-about {
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .site-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .site-nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-nav-links a,
  .site-nav-btn {
    font-size: 0.85rem;
  }
}
