/* ==========================================================================
   THE HOPE MACHINE — Vintage Notebook & Art Installation Stylesheet
   ========================================================================== */

:root {
  --paper-bg: #f5eedb;
  --paper-grain: #e8dcb9;
  --paper-shadow: rgba(45, 30, 15, 0.25);
  --line-blue: rgba(85, 120, 165, 0.22);
  --margin-red: rgba(200, 50, 45, 0.45);
  --ink-black: #1a1714;
  --ink-blue: #1c3258;
  --ink-faint: #5a5248;
  --stamp-red: #a82315;
  --stamp-red-faint: rgba(168, 35, 21, 0.12);
  --highlight-gold: #f4d06f;
  
  --font-script: 'Caveat', 'Patrick Hand', cursive;
  --font-rough: 'Patrick Hand', 'Caveat', cursive;
  --font-typewriter: 'Courier Prime', 'Special Elite', monospace;
  --font-stamp: 'Special Elite', 'Courier Prime', monospace;

  --line-height-ruled: 34px;
}

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

body {
  background-color: #231d18;
  background-image: 
    radial-gradient(circle at 50% 30%, #3a3026 0%, #171310 100%);
  color: var(--ink-black);
  font-family: var(--font-rough);
  font-size: 19px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Grain & Vignette */
.vintage-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 99;
  background: 
    radial-gradient(ellipse at center, transparent 55%, rgba(15, 10, 5, 0.6) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.015) 0px, rgba(0, 0, 0, 0.015) 1px, transparent 1px, transparent 3px);
}

/* Dust particles container */
.dust-particles {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 98;
  opacity: 0.35;
}

/* Outer Wrapper */
.machine-wrapper {
  max-width: 1200px;
  margin: 20px auto 40px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   TOP HEADER & MACHINE TICKER
   ========================================================================== */
.machine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(245, 238, 219, 0.06);
  border: 1px dashed rgba(230, 210, 180, 0.2);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.machine-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.header-machine-svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  color: #eeddbb;
}

.badge-text {
  display: flex;
  flex-direction: column;
}

.badge-title {
  font-family: var(--font-typewriter);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #f7ecd5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.badge-sub {
  font-family: var(--font-typewriter);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #bfae90;
}

.machine-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(244, 208, 111, 0.25);
  border-radius: 20px;
  color: #eedcb3;
  font-family: var(--font-typewriter);
  font-size: 12px;
  letter-spacing: 1px;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60c268;
  box-shadow: 0 0 8px #60c268;
  animation: pulse-light 1.8s infinite ease-in-out;
}

@keyframes pulse-light {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45, 38, 30, 0.7);
  color: #e5dac2;
  border: 1px solid rgba(230, 215, 185, 0.25);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-typewriter);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: rgba(70, 58, 46, 0.9);
  border-color: var(--highlight-gold);
  color: #fff;
  transform: translateY(-1px);
}

.control-btn.active {
  background: #3f5540;
  border-color: #7bc379;
  color: #fff;
}

.control-btn.pen-btn {
  background: #8b251a;
  border-color: #d1493b;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(139, 37, 26, 0.4);
}

.control-btn.pen-btn:hover {
  background: #a92f22;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(169, 47, 34, 0.5);
}

/* ==========================================================================
   NAVIGATION & TWISTORI FILTER BAR
   ========================================================================== */
.view-navigation {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-tabs {
  display: flex;
  gap: 8px;
}

.view-tab {
  background: rgba(245, 238, 219, 0.12);
  color: #cbbe9f;
  border: none;
  padding: 8px 18px;
  border-radius: 6px 6px 0 0;
  font-family: var(--font-typewriter);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.view-tab:hover {
  background: rgba(245, 238, 219, 0.25);
  color: #fff;
}

.view-tab.active {
  background: var(--paper-bg);
  color: var(--ink-black);
  box-shadow: 0 -3px 8px rgba(0,0,0,0.25);
}

.view-tab.active .tab-ink-indicator {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stamp-red);
}

/* Twistori Horizontal Verbs Bar */
.twistori-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(18, 14, 11, 0.6);
  border: 1px solid rgba(220, 200, 160, 0.2);
  border-radius: 6px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

.filter-label {
  font-family: var(--font-typewriter);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #a89a80;
  margin-right: 4px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45, 38, 30, 0.5);
  border: 1px solid rgba(190, 170, 130, 0.25);
  color: #dfd2b5;
  padding: 5px 12px;
  border-radius: 18px;
  font-family: var(--font-typewriter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-pill:hover {
  border-color: var(--highlight-gold);
  color: #fff;
  transform: translateY(-2px);
}

.filter-pill.active {
  background: #f4eedb;
  color: #1a1714;
  border-color: #f4eedb;
  box-shadow: 0 2px 8px rgba(244, 238, 219, 0.3);
  font-weight: 700;
}

.filter-pill.active .pill-count {
  background: #1a1714;
  color: #f4eedb;
}

.pill-count {
  font-size: 10px;
  background: rgba(0,0,0,0.3);
  color: #cbbe9f;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ==========================================================================
   THE NOTEBOOK CANVAS (PAPER SHEET)
   ========================================================================== */
.notebook-canvas {
  position: relative;
  background: var(--paper-bg);
  /* Weathered paper gradient with aged yellowed borders */
  background-image: 
    radial-gradient(circle at 50% 50%, #fbf5e7 0%, #f3ebda 60%, #e2d3b2 100%),
    repeating-linear-gradient(transparent, transparent calc(var(--line-height-ruled) - 1px), var(--line-blue) calc(var(--line-height-ruled) - 1px), var(--line-blue) var(--line-height-ruled));
  background-size: 100% 100%, 100% var(--line-height-ruled);
  border-radius: 4px;
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 0 60px rgba(180, 150, 100, 0.25);
  border: 1px solid #d4c5a3;
  min-height: 700px;
  padding: 30px 40px;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Center spine & stitches for authentic notebook feel */
.notebook-spine {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 20px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(90deg, 
    rgba(140, 115, 80, 0) 0%, 
    rgba(140, 115, 80, 0.15) 40%, 
    rgba(90, 70, 45, 0.28) 50%, 
    rgba(140, 115, 80, 0.15) 60%, 
    rgba(140, 115, 80, 0) 100%);
}

.spine-thread {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-left: 2px dashed rgba(80, 60, 40, 0.4);
}

.stitch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(70, 50, 30, 0.6);
  box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}
.stitch-1 { top: 15%; }
.stitch-2 { top: 50%; }
.stitch-3 { top: 85%; }

/* Coffee Stain Ring Watermark */
.coffee-stain {
  position: absolute;
  right: 50px;
  bottom: 80px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.18;
  border: 7px solid #7a5029;
  filter: blur(1.5px);
  transform: rotate(-12deg);
  box-shadow: inset 0 0 15px rgba(122, 80, 41, 0.4);
}

/* View Panels */
.view-panel {
  display: none;
  position: relative;
  z-index: 10;
}

.view-panel.active {
  display: block;
  animation: fadeInPaper 0.4s ease forwards;
}

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

/* ==========================================================================
   VIEW 1: THE LIVE STREAM (TWISTORI STYLE)
   ========================================================================== */
.stream-panel {
  position: relative;
}

.stream-margin-line {
  position: absolute;
  top: 0; bottom: 0; left: 70px;
  width: 2px;
  background: var(--margin-red);
  pointer-events: none;
  z-index: 4;
}

.stream-intro {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 90px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(180, 150, 110, 0.4);
}

.stream-lead {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--ink-faint);
  max-width: 650px;
}

.stream-feed-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-left: 90px;
  margin-right: 20px;
  min-height: 480px;
}

/* Stream loading placeholder */
.stream-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--ink-faint);
  font-family: var(--font-typewriter);
  gap: 16px;
}

.loading-gear {
  width: 40px;
  height: 40px;
  border: 4px dashed #6b5c47;
  border-radius: 50%;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Stream Item Thought Card */
.stream-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-left: 4px solid #3c3228;
  box-shadow: 0 1px 4px rgba(60, 45, 25, 0.08);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  animation: inkAppear 0.5s ease-out;
}

@keyframes inkAppear {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.stream-item:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px rgba(60, 45, 25, 0.15);
  transform: translateX(4px);
}

.stream-item.user-penned {
  border-left-color: var(--stamp-red);
  background: rgba(255, 244, 230, 0.7);
}

.stream-item-doodle {
  flex-shrink: 0;
  width: 50px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b231b;
  opacity: 0.85;
}

.stream-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stream-item-text {
  font-family: var(--font-script);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-black);
}

/* Twistori Highlight on trigger phrase */
.stream-item-text .trigger-phrase {
  font-weight: 700;
  color: var(--ink-blue);
  background: linear-gradient(180deg, transparent 65%, rgba(244, 208, 111, 0.45) 65%);
  padding: 0 3px;
  border-radius: 2px;
}

.stream-item.cat-i_hope .trigger-phrase { color: #8a3512; }
.stream-item.cat-i_wish .trigger-phrase { color: #1c5270; }
.stream-item.cat-i_love .trigger-phrase { color: #9c1f2b; }
.stream-item.cat-my_idea_is .trigger-phrase { color: #2e663a; }
.stream-item.cat-i_believe .trigger-phrase { color: #7a4f00; }
.stream-item.cat-i_dream .trigger-phrase { color: #432b70; }

.stream-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-typewriter);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}

.stream-item-source {
  font-weight: 700;
  color: #4b4134;
}

.stream-item-tag {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.stream-footer-note {
  margin-top: 30px;
  margin-left: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px dashed rgba(180, 150, 110, 0.4);
  font-family: var(--font-typewriter);
  font-size: 13px;
  color: var(--ink-faint);
}

.refresh-feed-btn {
  background: transparent;
  border: 1px solid #9c8a70;
  color: #4b4134;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--font-typewriter);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-feed-btn:hover {
  background: #2b231b;
  color: #fff;
}

/* ==========================================================================
   VIEW 2: THE 33 RULINS (TWO-PAGE NOTEBOOK SPREAD)
   ========================================================================== */
.notebook-panel {
  position: relative;
  padding: 10px 0;
}

/* Top Cutout Archival Notch */
.notebook-top-notch {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #ded0ae;
  border: 1px solid #b8a582;
  border-bottom: none;
  padding: 3px 18px;
  border-radius: 8px 8px 0 0;
  font-family: var(--font-typewriter);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #63523f;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  z-index: 6;
}

.notebook-preamble {
  margin-bottom: 25px;
  padding-left: 55px;
  max-width: 600px;
}

.preamble-script {
  font-family: var(--font-script);
  font-size: 27px;
  line-height: 1.25;
  color: var(--ink-blue);
  letter-spacing: 0.5px;
  transform: rotate(-0.5deg);
}

.preamble-headline {
  margin-top: 8px;
  display: flex;
  gap: 22px;
  font-family: var(--font-typewriter);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink-black);
}

.headline-underline {
  border-bottom: 2px solid var(--ink-black);
  padding-bottom: 1px;
}

/* Spread Layout */
.spread-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  position: relative;
}

.spread-page {
  position: relative;
  padding-left: 45px;
}

.page-margin-line {
  position: absolute;
  top: 0; bottom: 0; left: 35px;
  width: 2px;
  background: var(--margin-red);
  pointer-events: none;
}

.rulins-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rulin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--line-height-ruled);
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.rulin-item:hover {
  background: rgba(244, 208, 111, 0.25);
}

.rulin-left-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
}

.rulin-num {
  font-family: var(--font-typewriter);
  font-size: 16px;
  font-weight: 700;
  color: #3b3228;
  min-width: 28px;
}

.rulin-text {
  font-family: var(--font-typewriter);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ink-black);
  line-height: 1.25;
}

.rulin-doodle-box {
  flex-shrink: 0;
  width: 60px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b231b;
}

/* Rule 19: Keep Hoping Machine Running — Highlighting */
.rulin-item.highlight-rulin {
  background: rgba(244, 208, 111, 0.45);
  border: 1px dashed #b8860b;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.25);
  animation: glowRule19 3s infinite alternate ease-in-out;
}

@keyframes glowRule19 {
  from { box-shadow: 0 2px 6px rgba(184, 134, 11, 0.2); }
  to { box-shadow: 0 4px 14px rgba(184, 134, 11, 0.45); }
}

.rulin-item.highlight-rulin .rulin-text {
  color: #8b251a;
  font-size: 16.5px;
}

/* Animated Locomotive SVG in Rule 19 */
.doodle-machine.animated-machine .gear-wheel-1,
.doodle-machine.animated-machine .gear-wheel-2,
.doodle-machine.animated-machine .gear-wheel-3 {
  transform-origin: center;
  animation: rotateGear 2.5s linear infinite;
}

@keyframes rotateGear {
  100% { transform: rotate(360deg); }
}

.doodle-machine.animated-machine .steam-puffs {
  animation: puffSteam 1.5s infinite ease-out;
}

@keyframes puffSteam {
  0% { transform: translate(0, 0) scale(0.8); opacity: 0.4; }
  50% { transform: translate(-3px, -4px) scale(1.1); opacity: 0.9; }
  100% { transform: translate(-6px, -8px) scale(1.3); opacity: 0; }
}

.notebook-colophon {
  margin-top: 30px;
  text-align: center;
  font-family: var(--font-typewriter);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 1px;
}

/* ==========================================================================
   MODAL: PEN YOUR HOPE (CONTRIBUTION DRAWER)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 12, 10, 0.78);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.pen-card, .field-card {
  position: relative;
  background: #fbf5e6;
  background-image: 
    radial-gradient(circle at 50% 50%, #fefcf5 0%, #f6edd9 100%),
    repeating-linear-gradient(transparent, transparent 31px, rgba(85, 120, 165, 0.18) 31px, rgba(85, 120, 165, 0.18) 32px);
  max-width: 620px;
  width: 100%;
  padding: 36px 36px 30px 36px;
  border-radius: 4px;
  box-shadow: 
    0 15px 45px rgba(0, 0, 0, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.25);
  border: 1px solid #d4c6a6;
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.modal-backdrop.active .pen-card,
.modal-backdrop.active .field-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: #7a6b57;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  color: #1a1714;
  background: rgba(0, 0, 0, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #d1c1a0;
}

.card-title {
  font-family: var(--font-typewriter);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #231b14;
}

.card-subtitle {
  font-family: var(--font-rough);
  font-size: 17px;
  color: #635442;
}

.pen-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-label {
  font-family: var(--font-typewriter);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #4b4133;
  margin-bottom: 6px;
  display: block;
}

.prefix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prefix-chip {
  background: #ede3cc;
  border: 1px solid #c2b395;
  color: #3b3226;
  font-family: var(--font-rough);
  font-size: 18px;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.prefix-chip:hover {
  background: #e2d4b8;
}

.prefix-chip.active {
  background: #3b3226;
  color: #f7eedb;
  border-color: #3b3226;
}

.lined-textarea-wrapper {
  position: relative;
}

.lined-textarea {
  width: 100%;
  background: transparent;
  border: 1px solid #c8ba9c;
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--font-script);
  font-size: 24px;
  line-height: 32px;
  color: var(--ink-black);
  resize: vertical;
  min-height: 120px;
}

.lined-textarea:focus {
  outline: none;
  border-color: #8b251a;
  background: rgba(255, 255, 255, 0.4);
}

.char-count {
  position: absolute;
  right: 10px; bottom: 8px;
  font-family: var(--font-typewriter);
  font-size: 11px;
  color: #857560;
}

.form-row-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ruled-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #8e7c65;
  padding: 6px 4px;
  font-family: var(--font-rough);
  font-size: 18px;
  color: var(--ink-black);
}

.ruled-input:focus {
  outline: none;
  border-bottom: 2px solid #8b251a;
}

.form-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.stamp-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #8b251a;
  color: #fff;
  border: 2px solid #6b1c13;
  padding: 10px 24px;
  font-family: var(--font-typewriter);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(139, 37, 26, 0.4);
  transition: all 0.2s ease;
}

.stamp-submit-btn:hover {
  background: #a92f22;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(169, 47, 34, 0.5);
}

/* Rubber Stamp Overlay */
.stamp-animation-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(255, 250, 240, 0.85);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stamp-animation-overlay.show {
  opacity: 1;
}

.rubber-stamp-mark {
  border: 4px dashed var(--stamp-red);
  color: var(--stamp-red);
  font-family: var(--font-stamp);
  padding: 20px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 8px;
  transform: scale(2.5) rotate(-20deg);
  opacity: 0;
  filter: blur(1px);
}

.stamp-animation-overlay.show .rubber-stamp-mark {
  animation: stampCrash 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampCrash {
  0% { transform: scale(3.5) rotate(-25deg); opacity: 0; }
  60% { transform: scale(0.95) rotate(-7deg); opacity: 0.95; }
  100% { transform: scale(1) rotate(-8deg); opacity: 0.9; }
}

.stamp-border-text {
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 700;
}

.stamp-status {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}

.stamp-date {
  font-size: 12px;
  letter-spacing: 2px;
}

/* Field Note Detail Card */
.field-card {
  text-align: center;
}

.field-stamp {
  display: inline-block;
  border: 2px solid #8b251a;
  color: #8b251a;
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 2px 10px;
  margin-bottom: 14px;
  transform: rotate(-3deg);
}

.field-doodle {
  margin: 10px auto;
  color: #2b231b;
}

.field-text {
  font-family: var(--font-script);
  font-size: 32px;
  line-height: 1.35;
  color: var(--ink-black);
  margin: 16px 0 24px 0;
}

.field-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: var(--font-typewriter);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  border-top: 1px dashed #d1c1a0;
  padding-top: 14px;
}

/* ==========================================================================
   ART INSTALLATION / GALLERY FULLSCREEN MODE
   ========================================================================== */
body.mode-installation {
  background: #110e0c;
  overflow: hidden;
}

body.mode-installation .machine-header,
body.mode-installation .view-navigation,
body.mode-installation .machine-footer {
  display: none !important;
}

body.mode-installation .machine-wrapper {
  max-width: 100vw;
  margin: 0;
  padding: 0;
  height: 100vh;
}

body.mode-installation .notebook-canvas {
  height: 100vh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 50px 80px;
  overflow-y: auto;
  /* Gentle slow scroll animation */
  animation: ambientParallax 30s ease-in-out infinite alternate;
}

@keyframes ambientParallax {
  0% { transform: scale(1); }
  50% { transform: scale(1.015) rotate(0.2deg); }
  100% { transform: scale(1); }
}

.installation-badge {
  display: none;
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f7eedb;
  font-family: var(--font-typewriter);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 2000;
  pointer-events: none;
}

body.mode-installation .installation-badge {
  display: block;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.machine-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  color: #9f9179;
  font-family: var(--font-typewriter);
  font-size: 12px;
  letter-spacing: 1px;
}

.status-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60c268;
  margin-right: 6px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 900px) {
  .spread-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .notebook-spine {
    display: none;
  }
  .stream-margin-line {
    left: 20px;
  }
  .stream-intro, .stream-feed-list, .stream-footer-note {
    margin-left: 32px;
  }
  .notebook-canvas {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .machine-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-controls {
    justify-content: space-between;
  }
  .form-row-duo {
    grid-template-columns: 1fr;
  }
  .stream-item-text {
    font-size: 21px;
  }
  .preamble-script {
    font-size: 22px;
  }
}
