/* lurch.dev - Memphis Group meets sepia daguerreotype */

:root {
  --bg: #f2e8d5;
  --text: #3b2f1e;
  --text-secondary: #7a6652;
  --accent: #b8943e;
  --memphis-red: #c4573a;
  --memphis-teal: #5a8a7a;
  --memphis-yellow: #d4a843;
  --deep: #1e1610;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  position: relative;
}

/* Paper grain texture overlay */
#paper-grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect x='1' y='2' width='1' height='1' fill='%233b2f1e' opacity='0.3'/%3E%3Crect x='5' y='6' width='1' height='1' fill='%233b2f1e' opacity='0.25'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%233b2f1e' opacity='0.2'/%3E%3Crect x='7' y='1' width='1' height='1' fill='%233b2f1e' opacity='0.15'/%3E%3Crect x='0' y='7' width='1' height='1' fill='%233b2f1e' opacity='0.2'/%3E%3Crect x='6' y='3' width='1' height='1' fill='%233b2f1e' opacity='0.25'/%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

/* Selection color */
::selection {
  background: var(--memphis-yellow);
  color: var(--text);
}

/* Fixed logo */
#logo {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  text-decoration: none;
  transition: transform 0.3s ease;
}

#logo:hover {
  transform: rotate(-12deg) scale(1.1);
}

/* Content column - the lurching column */
.content-column {
  max-width: 680px;
  margin: 0 auto;
  padding: 120px 24px 60px;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateX(var(--lurch-offset, 0));
}

/* Typography */
h1.section-heading {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(3.5rem, 9vw, 8rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 0.95;
  margin-bottom: 0.4em;
  transform: rotate(0deg);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

h1.section-heading.tilted {
  transform: rotate(var(--tilt, 0deg));
}

h2.project-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.3em;
  margin-top: 1.5em;
}

.project:first-child h2.project-title {
  margin-top: 0;
}

/* Section teaser */
.section-teaser {
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin-bottom: 0.5em;
}

/* Section body - progressive disclosure */
.section-body {
  overflow: hidden;
  transition: max-height 0.8s ease-out, opacity 0.6s ease-in;
}

.section-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.section-body.expanded {
  max-height: 2000px;
  opacity: 1;
}

/* Lurch sections */
.lurch-section {
  padding: 60px 0 40px;
}

.lurch-section p {
  margin-bottom: 1em;
}

.lurch-section em {
  font-style: italic;
  color: var(--memphis-red);
}

/* Meta / code labels */
.meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.code-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--memphis-teal);
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--memphis-red);
}

/* ==========================================
   GEOMETRY BANDS
   ========================================== */

.geometry-band {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: 160px;
  margin-top: 20px;
  margin-bottom: 20px;
  overflow: hidden;
}

.geometry-band.constellation {
  height: 180px;
}

/* ==========================================
   MEMPHIS SHAPES
   ========================================== */

.memphis-shape {
  position: absolute;
  opacity: 0;
  transition: none;
}

.memphis-shape.animated {
  animation: memphis-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes memphis-enter {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-20deg) translate(var(--enter-x, 0), var(--enter-y, 0));
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(var(--final-rotation, 0deg)) translate(0, 0);
  }
}

/* Tilted Circle */
.tilted-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--memphis-red);
}

.tilted-circle.small {
  width: 35px;
  height: 35px;
}

.tilted-circle.large {
  width: 85px;
  height: 85px;
}

/* Offset Triangle */
.offset-triangle {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 52px solid var(--memphis-teal);
  background: transparent;
}

.offset-triangle.small {
  border-left-width: 18px;
  border-right-width: 18px;
  border-bottom-width: 32px;
}

.offset-triangle.large {
  border-left-width: 42px;
  border-right-width: 42px;
  border-bottom-width: 72px;
}

/* Half Circle */
.half-circle {
  width: 70px;
  height: 35px;
  border-radius: 70px 70px 0 0;
  background: var(--accent);
}

.half-circle.flipped {
  border-radius: 0 0 70px 70px;
}

/* Squiggle Line (SVG) */
.squiggle-line {
  overflow: visible;
}

/* Dotted Grid */
.dotted-grid {
  width: 60px;
  height: 60px;
  display: grid;
  grid-template-columns: repeat(4, 8px);
  grid-template-rows: repeat(4, 8px);
  gap: 12px;
  background: transparent;
}

.dotted-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--text-secondary) 3px, transparent 3px);
  background-size: 20px 20px;
  background-position: 0 0;
  opacity: 0.4;
}

/* Zigzag Border */
.zigzag-border {
  width: 100px;
  height: 30px;
  background: repeating-linear-gradient(
    135deg,
    var(--memphis-red) 0px,
    var(--memphis-red) 4px,
    transparent 4px,
    transparent 8px
  );
}

.zigzag-border.small {
  width: 60px;
  height: 20px;
}

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

#footer {
  background: var(--deep);
  padding: 60px 24px;
  margin-top: 40px;
}

.footer-content {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-text {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  color: var(--bg);
  font-size: 0.9rem;
  opacity: 0.7;
}

.footer-sep {
  color: var(--accent);
  margin: 0 4px;
}

.footer-text .code-label {
  color: var(--memphis-teal);
  opacity: 0.8;
}

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

@media (max-width: 768px) {
  .content-column {
    padding: 80px 20px 40px;
  }

  #logo {
    top: 16px;
    left: 16px;
  }

  .geometry-band {
    height: 120px;
  }

  .geometry-band.constellation {
    height: 140px;
  }

  .lurch-section {
    padding: 40px 0 30px;
  }

  h1.section-heading {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }
}

@media (max-width: 480px) {
  .content-column {
    transform: translateX(0) !important;
  }

  .geometry-band {
    height: 100px;
  }

  h1.section-heading {
    font-size: clamp(2rem, 14vw, 3.5rem);
  }
}