:root {
  --bg: #f3efe6;
  --text: #0a0a0a;
  --muted: #5c544a;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.shell {
  width: min(1320px, calc(100% - 18px));
  margin: 0 auto;
  padding: 14px 0 80px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 2px 0 20px;
}

.topbar nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.topbar a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.topbar .brand {
  font-weight: 700;
  font-size: 0.82rem;
}

.eyebrow,
.section-label,
.marker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
}

.chaos-stage {
  position: relative;
  min-height: 92vh;
  padding: 18px 0 10px;
}

.marker-top {
  position: absolute;
  top: 14px;
  left: 2px;
}

.noise-anchor {
  position: absolute;
  top: 4%;
  left: 18%;
  z-index: 0;
  pointer-events: none;
}

.noise-word {
  margin: 0;
  line-height: 0.8;
  text-transform: lowercase;
  opacity: 0.9;
}

.noise-word:first-child {
  font-size: clamp(3rem, 10vw, 8rem);
  transform: translateX(-8%);
}

.noise-word:last-child {
  font-size: clamp(5rem, 18vw, 14rem);
  letter-spacing: -0.09em;
}

.poem-main {
  width: min(780px, 100%);
  padding-top: 180px;
  margin-left: 3%;
  position: relative;
  z-index: 1;
}

.poem-side {
  width: min(420px, 96%);
  position: absolute;
  right: 4%;
  top: 34%;
  transform: rotate(-4deg);
}

.line {
  margin: 0;
  line-height: 0.9;
  text-transform: lowercase;
}

.giant { font-size: clamp(4rem, 16vw, 11rem); }
.huge { font-size: clamp(3rem, 12vw, 8rem); }
.medium { font-size: clamp(1.4rem, 4vw, 3.2rem); }
.small { font-size: clamp(0.9rem, 1.6vw, 1.15rem); letter-spacing: 0.08em; }

.serif { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.sans { font-family: Arial, Helvetica, sans-serif; font-weight: 800; letter-spacing: -0.06em; }
.mono { font-family: "Courier New", Courier, monospace; }

.float-note {
  position: absolute;
  max-width: 18ch;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  animation: drift 8s ease-in-out infinite;
}

.note-a { top: 18%; right: 16%; animation-delay: -1s; }
.note-b { bottom: 25%; left: 8%; animation-delay: -3s; }
.note-c { bottom: 8%; right: 10%; animation-delay: -2s; }

.home-feed {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-top: 10px;
}

.fragment-post {
  position: relative;
  width: min(860px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
}

.fragment-post.latest {
  width: min(1020px, 100%);
}

.fragment-post:nth-child(even) {
  margin-left: auto;
  width: min(760px, 92%);
  transform: rotate(1.6deg);
}

.fragment-post:nth-child(odd):not(.latest) {
  margin-left: 8%;
  transform: rotate(-1.8deg);
}

.post-1 { margin-top: -20px; }
.post-2 { margin-top: 34px; }
.post-3 { margin-top: -18px; }

.post-body h1,
.post-body h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 5.5rem);
  line-height: 0.9;
  text-transform: lowercase;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.post-body > p {
  color: var(--muted);
  line-height: 1.86;
}

.post-body img {
  width: min(760px, 100%);
  height: auto;
  margin: 18px 0 24px;
  box-shadow: 18px 18px 0 rgba(10,10,10,0.06);
}

.shard-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px 28px;
  margin: 10px 0 24px;
  align-items: start;
}

.shard-grid.second-pass {
  width: min(760px, 94%);
  margin-left: auto;
}

.shard {
  margin: 0;
  line-height: 0.92;
  text-transform: lowercase;
  color: var(--text);
}

.shard.right {
  text-align: right;
}

.shard.xl { font-size: clamp(2.5rem, 7vw, 6rem); }
.shard.lg { font-size: clamp(1.6rem, 4vw, 3.4rem); }
.shard.md { font-size: clamp(1.1rem, 2.5vw, 2rem); }
.shard.sm { font-size: clamp(0.95rem, 1.8vw, 1.3rem); }
.shard.xs { font-size: clamp(0.68rem, 1.2vw, 0.9rem); letter-spacing: 0.16em; text-transform: uppercase; }

.shard-grid .shard:nth-child(1) { transform: rotate(-2deg); }
.shard-grid .shard:nth-child(2) { transform: translateY(22px) rotate(1deg); }
.shard-grid .shard:nth-child(3) { transform: translateX(8%) rotate(-1deg); }
.shard-grid .shard:nth-child(4) { transform: translateY(-8px) rotate(2deg); }
.shard-grid .shard:nth-child(5) { transform: translateX(-4%) rotate(-2deg); }
.shard-grid .shard:nth-child(6) { transform: translateY(18px) rotate(1deg); }

.footer {
  padding-top: 44px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10px, -12px) rotate(-2deg); }
}

@media (max-width: 980px) {
  .chaos-stage {
    min-height: auto;
    padding-bottom: 40px;
  }

  .poem-side,
  .marker-top,
  .noise-anchor {
    position: relative;
    inset: auto;
    margin-top: 18px;
    display: block;
  }

  .float-note {
    position: absolute;
    font-size: 0.64rem;
    max-width: 13ch;
  }

  .note-a { top: 8%; right: 4%; }
  .note-b { top: 58%; left: 2%; }
  .note-c { bottom: 2%; right: 2%; }

  .poem-main {
    padding-top: 40px;
    margin-left: 0;
  }

  .fragment-post,
  .fragment-post.latest {
    width: 100%;
  }

  .fragment-post:nth-child(even) {
    margin-left: 6%;
    width: 94%;
    transform: rotate(1.2deg);
  }

  .fragment-post:nth-child(odd):not(.latest) {
    margin-left: 0;
    width: 96%;
    transform: rotate(-1.2deg);
  }

  .shard-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 10px, 1320px);
  }

  .topbar {
    flex-direction: column;
  }

  .chaos-stage {
    min-height: auto;
    padding-bottom: 24px;
  }

  .noise-anchor {
    transform: rotate(-3deg);
  }

  .poem-side {
    transform: rotate(-5deg);
    width: 92%;
    margin-left: auto;
  }

  .float-note {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }

  .fragment-post,
  .fragment-post.latest,
  .fragment-post:nth-child(even),
  .fragment-post:nth-child(odd):not(.latest) {
    width: 100%;
    margin-left: 0;
  }

  .fragment-post:nth-child(odd) { transform: rotate(-1.1deg); }
  .fragment-post:nth-child(even) { transform: rotate(1.1deg); }

  .post-body img {
    width: 94%;
  }

  .shard-grid,
  .shard-grid.second-pass {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-left: 0;
  }

  .shard.right {
    text-align: left;
  }

  .shard-grid .shard:nth-child(odd) {
    transform: translateX(4%) rotate(-2deg);
  }

  .shard-grid .shard:nth-child(even) {
    transform: translateY(10px) rotate(2deg);
  }
}
