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

:root {
  --dark-bg: #0a0a0a;
  --dark-secondary: #1a1a1a;
  --accent: #d4a574;
  --accent-light: #e8b88f;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --border: #2a2a2a;

  /* New atmospheric variables */
  --grain: rgba(255, 255, 255, 0.015);
  --glow: 0 0 22px rgba(212, 165, 116, 0.25);
}

html {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.7;
}

body {
  background:
    radial-gradient(circle at 20% 20%, var(--grain), transparent),
    radial-gradient(circle at 80% 80%, var(--grain), transparent),
    linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-secondary) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
header {
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.04em;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 40px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 1;
}

nav h1 {
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
}

nav h1 a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

nav h1 a:hover {
  color: var(--accent-light);
  text-shadow: var(--glow);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--accent);
  text-shadow: var(--glow);
}

nav a:hover::after {
  width: 100%;
}

/* Main content */
main {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
  width: 100%;
}

/* Home page */
.hero {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.hero p {
  font-size: 1.3rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.intro {
  margin-bottom: 4rem;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* Categories (with blueprint grid) */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.category {
  padding: 2.5rem;
  background-image:
    linear-gradient(
      135deg,
      rgba(212, 165, 116, 0.03),
      rgba(212, 165, 116, 0.01)
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015),
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 12px
    );
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 165, 116, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.category:hover::before {
  left: 100%;
}

.category:hover {
  border-color: var(--accent);
  background: linear-gradient(
    135deg,
    rgba(212, 165, 116, 0.1) 0%,
    rgba(212, 165, 116, 0.05) 100%
  );
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(212, 165, 116, 0.1);
}

.category h2 {
  font-size: 1.4rem;
  margin-bottom: 0;
  z-index: 1;
  position: relative;
}

.category-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.category a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

/* Machine article */
.machine {
  margin-bottom: 3rem;
}

.hero-image {
  margin: 0 0 2rem;
}

.hero-image img {
  width: 100%;
  height: clamp(220px, 50vw, 420px);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #0c0c0c;
  display: block;
}

.machine header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.machine header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--accent);
  opacity: 0.6;
}

.machine header h1 {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.machine .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

.content {
  margin-top: 2rem;
  line-height: 1.9;
  color: var(--text-primary);
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

.content p {
  margin-bottom: 1.8rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border: 1px solid var(--border);
  display: block;
}

.content h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 600;
  padding-bottom: 1rem;
}

.content h2:nth-of-type(odd) {
  background: linear-gradient(
    90deg,
    rgba(212, 165, 116, 0.08) 0%,
    rgba(212, 165, 116, 0.02) 100%
  );
  padding: 1rem 1.5rem 1rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
}

.content h2:nth-of-type(even) {
  background: linear-gradient(
    90deg,
    rgba(212, 165, 116, 0.04) 0%,
    transparent 100%
  );
  padding: 1rem 1.5rem 1rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
}

.content > * {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.content > *.fade-in-visible {
  opacity: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.content ul,
.content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.content li {
  margin-bottom: 0.8rem;
}

.content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.content hr {
  margin: 2.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* Machine list (with relic-plate effect) */
.archive h1 {
  font-size: 2.5rem;
  margin-bottom: 2.5rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.machine-list {
  list-style: none;
}

.machine-list li {
  margin-bottom: 1.2rem;
}

.machine-list .card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.2rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-left: 2px solid rgba(212, 165, 116, 0.25);
  background: rgba(212, 165, 116, 0.02);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.machine-list .card:hover {
  border-color: var(--accent);
  background-image: linear-gradient(
    90deg,
    rgba(212, 165, 116, 0.05),
    rgba(212, 165, 116, 0.1),
    rgba(212, 165, 116, 0.05)
  );
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(212, 165, 116, 0.12);
}

.machine-list .thumb {
  width: 100%;
  height: clamp(140px, 22vw, 220px);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #111;
  display: block;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card .designation {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.status-pill {
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  background: rgba(212, 165, 116, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Footer */
footer,
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: rgba(10, 10, 10, 0.95);
  margin-top: auto;
  letter-spacing: 0.05em;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-tagline {
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.footer-nav {
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

.footer-nav .separator {
  margin: 0 0.8rem;
  opacity: 0.5;
}

.footer-credit {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 1.5rem;
  }

  nav ul {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }

  main {
    padding: 2rem 1rem;
  }

  .machine header h1 {
    font-size: 1.8rem;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .machine-list .card {
    grid-template-columns: 1fr;
  }

  .machine-list .thumb {
    height: 180px;
  }
}

@media (max-width: 480px) {
  nav h1 {
    font-size: 1.4rem;
  }

  nav ul {
    gap: 0.5rem;
  }

  nav a {
    font-size: 0.85rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .content {
    font-size: 0.95rem;
  }
}
