/* ============================================
   MACHINES OF CODE
   A living notebook on patterns, information,
   structure, change, and limits.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #ffffff;
  --border: #222222;
  --font-mono: 'Space Mono', monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  gap: 3rem;
}

.nav-logo-stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.nav-logo {
  height: 40px;
  width: auto;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

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

.nav-links a.active {
  color: var(--text-primary);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 4rem;
  max-width: 900px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--text-secondary);
}

.hero-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--text-primary);
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background: transparent;
  color: var(--text-primary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

/* ============================================
   SECTIONS (Generic)
   ============================================ */

section {
  padding: 6rem 3rem;
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

/* ============================================
   PILLARS SECTION
   ============================================ */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.pillar {
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.pillar:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.pillar-number {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.pillar h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.pillar p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   FEATURED / POSTS SECTION
   ============================================ */

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.post-item:hover {
  padding-left: 1rem;
}

.post-item:hover .post-title {
  color: var(--text-primary);
}

.post-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.post-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================
   ABOUT PREVIEW / CTA
   ============================================ */

.about-preview {
  max-width: 700px;
}

.about-preview p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-preview .btn {
  margin-top: 1rem;
}

/* ============================================
   SUBSCRIBE SECTION
   ============================================ */

.subscribe-section {
  background: var(--bg-secondary);
}

.subscribe-form {
  display: flex;
  gap: 1rem;
  max-width: 500px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 250px;
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s ease;
}

.subscribe-form input[type="email"]:focus {
  border-color: var(--text-muted);
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  padding: 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ============================================
   ABOUT PAGE SPECIFIC
   ============================================ */

.about-page {
  padding-top: 8rem;
}

.about-content {
  max-width: 700px;
  padding: 0 3rem 6rem;
}

.about-content h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  margin-bottom: 3rem;
}

.about-content h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-content ul {
  list-style: none;
  margin-bottom: 2rem;
}

.about-content li {
  color: var(--text-secondary);
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.about-content li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.about-content strong {
  color: var(--text-primary);
  font-weight: 400;
}

.about-content em {
  font-family: var(--font-serif);
  font-style: italic;
}

/* ============================================
   ESSAYS / CONTENT PAGES
   ============================================ */

.page-header {
  padding: 10rem 3rem 4rem;
  max-width: 900px;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  margin-bottom: 1rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 7rem 1.5rem 3rem;
  }

  section {
    padding: 4rem 1.5rem;
  }

  .about-content {
    padding: 0 1.5rem 4rem;
  }

  .page-header {
    padding: 8rem 1.5rem 3rem;
  }

  footer {
    padding: 2rem 1.5rem;
    flex-direction: column;
    text-align: center;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.hero h1,
.hero-description,
.hero-buttons {
  animation: fadeInUp 0.8s ease forwards;
}

.hero-description {
  animation-delay: 0.1s;
}

.hero-buttons {
  animation-delay: 0.2s;
}

/* Scroll reveal for sections */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
