/**
 * Lo/Be Lab - Base Styles
 *
 * Full-width editorial layout with fixed top navigation
 * Inspired by tishukov.com's generous spacing and large text
 */

/* ========== RESET ========== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  font-weight: var(--weight-regular);
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, figure {
  margin: 0;
  padding: 0;
}

/* ========== HEADINGS ========== */

h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--lh-body);
}

/* ========== TEXT ========== */

p {
  margin-bottom: var(--space-4);
  line-height: var(--lh-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

/* ========== LINKS ========== */

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--duration-base) var(--easing);
}

a:hover {
  color: var(--color-link-hover);
}

/* ========== MEDIA ========== */

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========== SELECTION ========== */

::selection {
  background-color: var(--color-text);
  color: white;
}

/* ========== FIXED TOP NAVIGATION ========== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding);
  height: var(--nav-height);
  background: var(--color-bg);
  font-size: var(--text-sm);
}

.nav-left {
  display: flex;
  align-items: center;
}

.nav-left a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-left a:hover .nav-logo {
  opacity: 0.7;
}

.nav-logo {
  width: 28px;
  height: 28px;
  transition: opacity var(--duration-base) var(--easing);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-right a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

.nav-right a.active {
  text-decoration-thickness: 2px;
}

/* ========== MAIN CONTENT AREA ========== */

.page-content {
  padding-top: calc(var(--nav-height) + var(--space-12));
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
  max-width: var(--page-max);
  margin: 0 auto;
}

/* ========== SECTION SPACING ========== */

.section {
  margin-bottom: var(--section-gap);
}

.section--dark {
  background: var(--color-bg-dark);
  color: white;
  margin-left: calc(-1 * var(--page-padding));
  margin-right: calc(-1 * var(--page-padding));
  padding: var(--space-12) var(--page-padding);
}

/* ========== GRID DOTS SEPARATOR ========== */

.dot-grid {
  display: flex;
  gap: calc((100% - 28px) / 6);
  padding: var(--space-8) 0;
  justify-content: flex-start;
}

.dot-grid::before,
.dot-grid::after {
  content: none;
}

.dot-grid span {
  width: 4px;
  height: 4px;
  background: var(--color-text);
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  animation: dotPop 0.4s ease forwards;
}

.dot-grid span:nth-child(1) { animation-delay: 0s; }
.dot-grid span:nth-child(2) { animation-delay: 0.08s; }
.dot-grid span:nth-child(3) { animation-delay: 0.16s; }
.dot-grid span:nth-child(4) { animation-delay: 0.24s; }
.dot-grid span:nth-child(5) { animation-delay: 0.32s; }
.dot-grid span:nth-child(6) { animation-delay: 0.40s; }
.dot-grid span:nth-child(7) { animation-delay: 0.48s; }

@keyframes dotPop {
  0% { opacity: 0; transform: scale(0); }
  70% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 1; transform: scale(1); }
}

/* ========== SECTION LABELS ========== */

.label {
  font-size: var(--text-xs);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-3);
  display: block;
}

.label--light {
  color: rgba(255,255,255,0.5);
}

/* ========== THREE COLUMN LAYOUT ========== */

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--col-gap);
}

.three-col .col-label {
  font-size: var(--text-xs);
  letter-spacing: var(--ls-wider);
  text-transform: lowercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.three-col .col-text {
  font-size: var(--text-hero);
  font-weight: var(--weight-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
}

/* ========== TWO COLUMN LAYOUT ========== */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--col-gap);
}

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

.site-footer {
  padding: var(--space-16) 0 var(--space-10) 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-wide);
}

/* ========== FADE-UP ANIMATION ========== */

/* Content visible by default; JS adds .js-loaded to body to enable animations */
.fade-up {
  opacity: 1;
  transform: translateY(0);
}

body.js-loaded .fade-up {
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--duration-slow) var(--easing);
}

body.js-loaded .fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 900px) {
  .three-col {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  .nav-right {
    gap: var(--space-5);
  }

  .site-nav {
    font-size: var(--text-xs);
  }
}

@media (max-width: 520px) {
  .site-nav {
    height: auto;
    padding: var(--space-3) var(--page-padding);
  }

  .nav-right {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
  }

  .nav-logo {
    width: 24px;
    height: 24px;
  }

  .page-content {
    padding-top: calc(60px + var(--space-12));
  }
}

/* ========== REDUCED MOTION ========== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
