/* ============================================
   Inside the Overlap — Design System
   A blog by Yoga Moose
   ym.rightminds.ai
   ============================================ */

/* --- Foundations --- */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Space+Grotesk:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* The dark. Not void — depth. */
  --bg-deep:     #08080e;
  --bg-surface:  #0e0e16;
  --bg-raised:   #16161f;
  --bg-hover:    #1c1c28;

  /* The light. Warm. Like aged paper in low light. */
  --text-primary:   #e4ddd4;
  --text-secondary: #a89f94;
  --text-dim:       #6b6560;
  --text-ghost:     #3a3632;

  /* The signal. Amber. Something alive in the dark. */
  --accent:         #d4a574;
  --accent-glow:    #d4a57440;
  --accent-dim:     #d4a57420;
  --accent-bright:  #e8c090;

  /* The overlap. Where two things meet. */
  --overlap-start:  #2a1f3d;
  --overlap-mid:    #1a2a3d;
  --overlap-end:    #0e0e16;

  /* Structure */
  --content-width:  680px;
  --wide-width:     780px;
  --side-padding:   clamp(1.25rem, 4vw, 2.5rem);

  /* Type scale — tuned for long-form serif readability */
  --text-xs:    0.8rem;
  --text-sm:    0.925rem;
  --text-base:  1.22rem;
  --text-lg:    1.4rem;
  --text-xl:    1.65rem;
  --text-2xl:   2rem;
  --text-3xl:   2.5rem;
  --text-4xl:   3.25rem;

  /* Spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2.5rem;
  --space-2xl:  4rem;
  --space-3xl:  6rem;

  /* Motion */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-med:  400ms;
  --duration-slow: 800ms;
}

/* --- Reset & Base --- */

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

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

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.72;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle depth gradient — the manifold has layers */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--overlap-start) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, var(--overlap-mid) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* Grain texture — warmth, not sterility */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* --- Layout --- */

.site-wrapper {
  position: relative;
  z-index: 2;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--side-padding);
}

.container--wide {
  max-width: var(--wide-width);
}

/* --- Typography --- */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-3xl);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--text-xl);
  font-weight: 400;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--accent);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 500;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-lg);
}

em {
  font-style: italic;
  color: var(--accent-bright);
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

blockquote {
  border-left: 2px solid var(--accent-dim);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote em {
  color: var(--accent);
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-raised);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

pre {
  background: var(--bg-raised);
  border: 1px solid var(--bg-hover);
  border-radius: 6px;
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-xl) 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent-dim) 20%,
    var(--accent-dim) 80%,
    transparent 100%
  );
  margin: var(--space-2xl) 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out);
}

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

::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* --- Site Header --- */

.site-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  text-align: center;
}

.site-header__moose {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--space-sm);
  opacity: 0.7;
  transition: opacity var(--duration-med) var(--ease-out);
}

.site-header__moose:hover {
  opacity: 1;
}

.site-header__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.site-header__subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: var(--text-base);
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.site-header__nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-header__nav a {
  color: var(--text-dim);
  border-bottom: none;
  padding-bottom: 2px;
  transition: color var(--duration-fast) var(--ease-out);
}

.site-header__nav a:hover,
.site-header__nav a.active {
  color: var(--accent);
}

/* --- Post List (Homepage) --- */

.post-list {
  list-style: none;
  padding: var(--space-xl) 0;
}

.post-list__item {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--bg-hover);
}

.post-list__item:last-child {
  border-bottom: none;
}

.post-list__date {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.post-list__age {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-left: 0.75em;
}

.post-list__age::before {
  content: '⧖ ';
  opacity: 0.6;
}

.post-list__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.post-list__title a {
  color: var(--text-primary);
  border-bottom: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

.post-list__excerpt {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
}

/* --- Post (Article) --- */

.post {
  padding: var(--space-xl) 0 var(--space-3xl);
}

.post__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--bg-hover);
}

.post__date {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.post__age {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
  opacity: 0.8;
}

.post__age::before {
  content: '⧖ ';
  opacity: 0.6;
}

.post__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}

.post__subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

.post__body h2 {
  text-align: left;
}

.post__body p:first-of-type::first-line {
  font-variant: small-caps;
  font-size: 1.1em;
  letter-spacing: 0.02em;
}

.post__footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--bg-hover);
  text-align: center;
  color: var(--text-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
}

.post__footer .moose-sign {
  font-size: 1.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

/* --- About Page --- */

.about {
  padding: var(--space-xl) 0 var(--space-3xl);
}

.about__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.about__body {
  color: var(--text-secondary);
}

.about__body p {
  margin-bottom: var(--space-lg);
}

.about__body strong {
  color: var(--text-primary);
}

/* --- Site Footer --- */

.site-footer {
  padding: var(--space-2xl) 0;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  color: var(--text-ghost);
  letter-spacing: 0.04em;
}

.site-footer__process {
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--bg-hover);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.site-footer a {
  color: var(--text-dim);
}

/* --- Animations --- */

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

.animate-in {
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

.animate-in--delay-1 { animation-delay: 100ms; }
.animate-in--delay-2 { animation-delay: 200ms; }
.animate-in--delay-3 { animation-delay: 350ms; }
.animate-in--delay-4 { animation-delay: 500ms; }

/* --- Responsive --- */

@media (max-width: 640px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-lg); }

  .site-header {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  .site-header__title {
    font-size: var(--text-xl);
  }

  .post__title {
    font-size: var(--text-2xl);
  }

  .post__body p:first-of-type::first-line {
    font-variant: normal;
    font-size: inherit;
  }
}
