:root {
  --bg: #0d0f14;
  --fg: #e6e6e9;
  --muted: #a8adb7;
  --primary: #67b7ff;
  --accent: #ff7aa8;
  --sand: #c8b79a;
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans SC, Helvetica, Arial, "Segoe UI Emoji";
}

@media (prefers-color-scheme: light) {
  :root { --bg: #f7f7fa; --fg: #0d0f14; --muted: #4b5361; }
}

* { box-sizing: border-box; }
html, body { 
  height: 100%; 
  overflow-x: hidden; 
  overscroll-behavior-y: contain; /* Prevent browser default refresh */
} 
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-header, .site-footer {
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.title { margin: 0; font-size: 2rem; letter-spacing: 0.04em; }
.subtitle { margin: 6px 0 0; color: var(--muted); }

.layout { 
  max-width: 900px; /* Slightly reduced max-width */
  width: 100%;
  margin: 0 auto; 
  padding: 16px 24px; /* Added horizontal padding */
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 24px; 
}

.controls { display: none; } /* Hidden as requested */

.article p { 
  font-size: 1.125rem; 
  margin: 1.2rem 0; 
  max-width: 100%;
  overflow-wrap: break-word; /* Ensure text wraps */
}
.article .word { display: inline-block; white-space: pre-wrap; } /* Allow wrap */
.article .letter { display: inline-block; }

.canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 5; }

@keyframes jitter {
  0% { transform: translate3d(0,0,0) rotate(0deg); }
  50% { transform: translate3d(.8px,-1px,0) rotate(.4deg); }
  100% { transform: translate3d(0,0,0) rotate(0deg); }
}
.jitter { animation: jitter .22s ease-in-out infinite; }

.site-footer { color: var(--muted); }

.refresh-indicator {
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 20px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--muted);
}
.refresh-indicator .icon {
  font-size: 24px;
  margin-bottom: 8px;
  transition: transform 0.3s;
  transform: rotate(180deg); /* Default Arrow Up for Pull Up */
}
.refresh-indicator.visible { opacity: 1; }
.refresh-indicator.release .icon { transform: rotate(0deg); } /* Rotate to Down on release */

@media (max-width: 640px) {
  .title { font-size: 1.6rem; }
  .article p { font-size: 1rem; }
  .layout { padding: 16px; }
}
