/* InfraFort — production-ready */

:root {
  --bg: #0c0b10;
  --bg-elevated: #15111e;
  --bg-card: #1d1828;
  --text: #f5f5f7;
  --text-muted: #a09aae;
  --accent: #7c35ab;
  --accent-hover: #9248c5;
  --accent-glow: rgba(124, 53, 171, 0.42);
  --accent2: #5b21b6;
  --accent3: #c084fc;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(200, 160, 255, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --space: 1.5rem;
  --max-width: 980px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: var(--space) 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.nav-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.nav-sections {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.nav-sections a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-sections a:hover {
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-search-link,
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-search-link:hover,
.nav-link:hover {
  color: var(--text);
}

.nav-search-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
  border-radius: 8px;
}

.logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

/* Hero */
.hero {
  padding: 6rem 24px 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% -5%, rgba(124, 53, 171, 0.26) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 80% -5%, rgba(91, 33, 182, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 50% 110%, rgba(192, 132, 252, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 75%);
}

.hero-inner {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 53, 171, 0.12);
  border: 1px solid rgba(124, 53, 171, 0.32);
  border-radius: 100px;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #d8b4fe;
  margin-bottom: 1.75rem;
  letter-spacing: 0.01em;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.9);
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(168, 85, 247, 0.9); }
  50% { opacity: 0.7; box-shadow: 0 0 20px rgba(168, 85, 247, 0.5); }
}

.hero-title {
  font-size: clamp(2.75rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  line-height: 1.05;
  background: linear-gradient(135deg, #f5f5f7 0%, #e9d5ff 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
  max-width: 560px;
  margin-inline: auto;
}

.hero-actions {
  margin-top: 2.25rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.8125rem 2rem;
  border-radius: 100px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 28px var(--accent-glow);
}

.hero-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(146, 72, 197, 0.55);
}

/* Search drawer */
.search-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.2s;
}

.search-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.search-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.search-drawer.is-open .search-drawer-backdrop {
  opacity: 1;
}

.search-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.25s ease-out;
  pointer-events: auto;
}

.search-drawer.is-open .search-drawer-panel {
  transform: translateY(0);
}

.search-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 24px 0;
}

.search-drawer-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.search-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
  transition: color 0.2s;
  margin: -0.25rem -0.25rem -0.25rem 0;
}

.search-drawer-close:hover {
  color: var(--text);
}

.search-drawer-input {
  width: 100%;
  margin: 1rem 24px 0;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
}

.search-drawer-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.search-drawer-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 53, 171, 0.28);
}

.search-results {
  padding: 1rem 24px 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.search-results-empty {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.search-result-item {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.search-result-title {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.search-result-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-results-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0 24px 1rem;
  margin: 0;
}

body.search-drawer-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.no-results {
  padding: 3rem 24px;
  text-align: center;
}

.no-results-text {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}


/* Guides section */
.guides-section {
  padding: 3rem 24px 4rem;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.section-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.15em 0.65em;
}

/* Tag filter bar */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag-filter-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 100px;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.tag-filter-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.tag-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.guide-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 1;
}

.guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(124, 53, 171, 0.18);
}

.guide-card:hover::before {
  opacity: 1;
}

.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.guide-card:hover .card-media img {
  transform: scale(1.03);
}

.card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}

.card-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2em 0.625em;
  border-radius: 100px;
  background: rgba(124, 53, 171, 0.14);
  color: #d8b4fe;
  border: 1px solid rgba(124, 53, 171, 0.28);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.card-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.card-link-text {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-left: auto;
}

.guide-card:hover .card-link-text {
  color: var(--accent-hover);
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* Guide page */
.guide-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 24px 4rem;
}

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

.guide-header-inner {
  margin-bottom: 1.5rem;
}

.guide-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.guide-tags a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.guide-tags a:hover {
  text-decoration: underline;
}

.guide-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.guide-date {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.guide-hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.guide-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Prose (guide body) */
.prose {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.25rem;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text);
}

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

.prose a:hover {
  text-decoration: underline;
}

.prose ul, .prose ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.prose pre, .prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

.prose code {
  background: var(--bg-elevated);
  padding: 0.2em 0.4em;
  border-radius: 6px;
}

.prose pre {
  background: var(--bg-elevated);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 24px;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.25rem;
  margin-bottom: 1.25rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.footer-social-link:hover {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.footer-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
