/**
 * 07-ATLAS — האטלס: Cartographer's Field Journal
 * Palette: aged paper #ece2cc · sepia ink #43382a · expedition red #b13a2c · water-blue #5b7a8c
 * Fonts: David Libre (display) · Heebo (body) · JetBrains Mono (stamps) · Amatic SC (margin notes)
 */

@import url('https://fonts.googleapis.com/css2?family=David+Libre:wght@400;700&family=Heebo:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&family=Amatic+SC:wght@400;700&display=swap');

/* ─── Custom Properties ─── */
:root {
  --paper: #ece2cc;
  --paper-dark: #e0d5b8;
  --paper-light: #f5edd8;
  --ink: #43382a;
  --ink-light: #6b5a47;
  --ink-faint: rgba(67, 56, 42, 0.15);
  --red: #b13a2c;
  --red-light: rgba(177, 58, 44, 0.12);
  --blue: #5b7a8c;
  --blue-light: rgba(91, 122, 140, 0.12);
  --blue-dark: #3d5a6b;
  --font-display: 'David Libre', 'FrankRuehl CLM', serif;
  --font-body: 'Heebo', 'Arial Hebrew', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-hand: 'Amatic SC', cursive;
  --shadow-paper: 2px 4px 16px rgba(67, 56, 42, 0.18), 0 1px 4px rgba(67, 56, 42, 0.10);
  --shadow-lift: 4px 8px 28px rgba(67, 56, 42, 0.22), 0 2px 6px rgba(67, 56, 42, 0.14);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  direction: rtl;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ─── Topo background layer ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cdefs%3E%3Cstyle%3E.c%7Bfill:none;stroke:%2343382a;stroke-width:0.5;opacity:0.07%7D%3C/style%3E%3C/defs%3E%3Cellipse class='c' cx='200' cy='200' rx='180' ry='140'/%3E%3Cellipse class='c' cx='200' cy='200' rx='150' ry='110'/%3E%3Cellipse class='c' cx='200' cy='200' rx='120' ry='85'/%3E%3Cellipse class='c' cx='200' cy='200' rx='92' ry='62'/%3E%3Cellipse class='c' cx='200' cy='200' rx='65' ry='42'/%3E%3Cellipse class='c' cx='200' cy='200' rx='40' ry='25'/%3E%3Cellipse class='c' cx='60' cy='80' rx='55' ry='45'/%3E%3Cellipse class='c' cx='60' cy='80' rx='38' ry='30'/%3E%3Cellipse class='c' cx='60' cy='80' rx='22' ry='16'/%3E%3Cellipse class='c' cx='340' cy='320' rx='60' ry='50'/%3E%3Cellipse class='c' cx='340' cy='320' rx='40' ry='32'/%3E%3Cellipse class='c' cx='340' cy='320' rx='22' ry='17'/%3E%3Cellipse class='c' cx='330' cy='70' rx='45' ry='38'/%3E%3Cellipse class='c' cx='330' cy='70' rx='28' ry='22'/%3E%3Cellipse class='c' cx='80' cy='340' rx='50' ry='38'/%3E%3Cellipse class='c' cx='80' cy='340' rx='30' ry='22'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  pointer-events: none;
  z-index: 0;
}

/* Graticule grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(67,56,42,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67,56,42,0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Typography ─── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--blue); }

/* ─── Coordinate Margins ─── */
.coord-margin {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  padding: 60px 0 40px;
}

.coord-margin--right { right: 0; }
.coord-margin--left  { left: 0; }

.coord-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(67, 56, 42, 0.4);
  writing-mode: vertical-lr;
  letter-spacing: 0.05em;
}

/* ─── Site Header / Masthead ─── */
.masthead {
  position: relative;
  z-index: 20;
  padding: 28px 60px 20px;
  border-bottom: 1.5px solid var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(236, 226, 204, 0.85);
  backdrop-filter: blur(4px);
}

.masthead-left {
  display: flex;
  flex-direction: column;
}

.masthead-expedition {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-light);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.masthead-name {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}

.masthead-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-light);
  margin-top: 4px;
}

.masthead-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.masthead-nav a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.03em;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s, color 0.2s;
}

.masthead-nav a:hover,
.masthead-nav a.active {
  color: var(--red);
  border-color: var(--red);
}

.masthead-compass {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Ticker / Expedition Wire ─── */
.ticker-wrap {
  position: relative;
  z-index: 20;
  background: var(--ink);
  overflow: hidden;
  border-bottom: 2px solid var(--red);
}

.ticker-label {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  padding: 0 14px;
  z-index: 2;
  white-space: nowrap;
}

.ticker-tape {
  display: flex;
  align-items: center;
  height: 36px;
  padding-left: 0;
  /* RTL marquee: container + track ltr, items rtl */
  direction: ltr;
  overflow: hidden;
  margin-right: 90px;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 38s linear infinite;
}

.ticker-item {
  direction: rtl;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--paper);
  padding: 0 28px;
  border-right: 1px solid rgba(236, 226, 204, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-item-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(236, 226, 204, 0.5);
  flex-shrink: 0;
}

.ticker-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

/* Perforated edge feel — dot pattern top of ticker */
.ticker-perforation {
  height: 5px;
  background-image: radial-gradient(circle, var(--paper-dark) 1.5px, transparent 1.5px);
  background-size: 10px 5px;
  background-color: var(--ink);
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Main Layout ─── */
.atlas-main {
  position: relative;
  z-index: 5;
  padding: 0 60px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── Hero Map Section ─── */
.section-map {
  padding: 40px 0 0;
  position: relative;
}

.section-map-header {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.section-map-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.section-map-coord {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(67, 56, 42, 0.4);
}

.map-container {
  position: relative;
  width: 100%;
  background: var(--paper-light);
  border: 1.5px solid rgba(67, 56, 42, 0.2);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow-paper);
}

.map-svg {
  display: block;
  /* Absolute fill inside the padding-bottom aspect-ratio wrapper */
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

/* Compass in corner */
.compass-container {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 70px;
  height: 70px;
  z-index: 10;
  pointer-events: none;
}

.compass-rose {
  width: 70px;
  height: 70px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Waypoint hover labels */
.waypoint-label {
  position: absolute;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 2px;
  white-space: nowrap;
  max-width: 220px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  transform: translateY(6px);
  z-index: 20;
  box-shadow: var(--shadow-paper);
  line-height: 1.35;
}

.waypoint-label::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: rotate(45deg);
}

.waypoint-group:hover .waypoint-label,
.waypoint-group:focus-within .waypoint-label {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Section Headers ─── */
.section-header {
  margin: 56px 0 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--ink);
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--ink-faint);
}

/* ─── Journal Entry Cards ─── */
.journal-entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
  padding: 8px 0;
}

/* deckled / rough-edge paper card */
.journal-card {
  background: var(--paper-light);
  position: relative;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-paper);
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.25s;
  clip-path: polygon(
    0% 2%, 2% 0%, 4% 1.5%, 6% 0%, 8% 1%, 10% 0%,
    12% 1.5%, 14% 0.5%, 16% 0%, 18% 1%, 20% 0%,
    22% 1.5%, 25% 0.5%, 30% 0%, 35% 1%, 40% 0%,
    45% 1.5%, 50% 0%, 55% 1%, 60% 0%, 65% 1.5%,
    70% 0.5%, 75% 0%, 80% 1%, 85% 0%, 90% 1.5%,
    95% 0.5%, 98% 0%, 100% 2%,
    100% 98%, 98% 100%, 95% 98.5%, 90% 100%,
    85% 98.5%, 80% 100%, 75% 98.5%, 70% 100%,
    65% 98.5%, 60% 100%, 55% 98.5%, 50% 100%,
    45% 98.5%, 40% 100%, 35% 98.5%, 30% 100%,
    25% 98.5%, 20% 100%, 15% 98.5%, 10% 100%,
    5% 98.5%, 2% 100%, 0% 98%
  );
}

.journal-card:nth-child(odd)  { transform: rotate(-0.8deg); }
.journal-card:nth-child(even) { transform: rotate(0.7deg); }
.journal-card:nth-child(3n)   { transform: rotate(1.2deg); }

.journal-card:hover {
  box-shadow: var(--shadow-lift);
  transform: rotate(0deg) translateY(-3px) !important;
  z-index: 5;
}

.card-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border: 1.5px solid var(--red);
  padding: 2px 8px;
  opacity: 0.82;
  margin-bottom: 10px;
  transform: rotate(-1.5deg);
  display: inline-block;
}

.card-stamp:nth-child(1) { transform: rotate(-2deg); }

.card-coord {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-light);
  margin-bottom: 8px;
  opacity: 0.65;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-light);
  margin-bottom: 10px;
  opacity: 0.6;
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 10px;
}

.card-excerpt {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 14px;
}

.card-author {
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-light);
  border-top: 1px dashed rgba(67, 56, 42, 0.2);
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-author-pen {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.card-read-more {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--red);
  font-weight: 500;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

/* ─── Telegram / News Section ─── */
.telegram-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.telegram-strip {
  background: var(--paper-light);
  border: 1px solid rgba(67, 56, 42, 0.15);
  position: relative;
  padding: 16px 18px 14px;
  box-shadow: 1px 2px 8px rgba(67, 56, 42, 0.1);
}

/* Perforated top edge */
.telegram-strip::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 8px;
  background-image: radial-gradient(circle, var(--paper) 2.5px, transparent 2.5px);
  background-size: 12px 8px;
  background-color: rgba(67, 56, 42, 0.15);
}

/* Perforated bottom edge */
.telegram-strip::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 8px;
  background-image: radial-gradient(circle, var(--paper) 2.5px, transparent 2.5px);
  background-size: 12px 8px;
  background-color: rgba(67, 56, 42, 0.15);
}

.telegram-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-top: 6px;
}

.telegram-rule {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.telegram-urgency {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  padding: 2px 8px;
  border: 1.5px solid;
  text-transform: uppercase;
  flex-shrink: 0;
}

.telegram-urgency--breaking {
  color: var(--red);
  border-color: var(--red);
  transform: rotate(-1.5deg);
  display: inline-block;
}

.telegram-urgency--high {
  color: var(--blue);
  border-color: var(--blue);
}

.telegram-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-light);
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  opacity: 0.65;
}

.telegram-headline {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 6px;
}

.telegram-dek {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.5;
}

.telegram-source {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--blue);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(91, 122, 140, 0.3);
}

/* ─── Field Radio / Chat Phone ─── */
.section-radio {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: start;
  margin: 40px 0;
}

.radio-intro {
  padding-top: 16px;
}

.radio-intro-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.3;
}

.radio-intro-body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 20px;
}

.radio-margin-note {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--blue);
  transform: rotate(-3deg);
  display: inline-block;
  margin-top: 10px;
  line-height: 1.4;
}

/* Skin buttons */
.skin-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.skin-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(67, 56, 42, 0.3);
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  border-radius: 1px;
}

.skin-btn.active,
.skin-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Phone Device */
.phone-device-wrap {
  position: relative;
}

.phone-device {
  width: 270px;
  background: #1a1a1a;
  border-radius: 36px;
  box-shadow: 0 20px 60px rgba(67, 56, 42, 0.35), inset 0 0 0 1.5px rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}

.phone-notch {
  width: 80px;
  height: 24px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.phone-screen {
  background: var(--phone-bg, #ece5dd);
  min-height: 440px;
  display: flex;
  flex-direction: column;
}

.phone-header {
  background: var(--phone-header, #075e54);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.3s;
}

.phone-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phone-header-info { flex: 1; }

.phone-header-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.phone-header-status {
  font-family: var(--font-body);
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}

.phone-messages {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
}

.phone-bubble {
  max-width: 85%;
  padding: 8px 12px;
  background: #fff;
  border-radius: var(--phone-bubble-r, 8px);
  font-family: var(--font-body);
  font-size: 12px;
  color: #1a1a1a;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: relative;
  align-self: flex-end;
  direction: rtl;
}

.phone-bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.phone-bubble-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  background: var(--red);
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
}

.phone-bubble-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-light);
  margin-top: 4px;
  text-align: left;
}

.phone-bubble.urgent .phone-bubble-tag {
  background: var(--red);
}

.phone-home {
  height: 28px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-home-bar {
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}

/* skin variations */
.phone-device.skin-wa .phone-screen { background: #ece5dd; }
.phone-device.skin-wa .phone-header { background: #075e54; }
.phone-device.skin-wa .phone-bubble { border-radius: 8px; background: #fff; }

.phone-device.skin-telegram .phone-screen { background: #e8f5fe; }
.phone-device.skin-telegram .phone-header { background: #2AABEE; }
.phone-device.skin-telegram .phone-bubble { border-radius: 14px; background: #fff; }

.phone-device.skin-messenger .phone-screen { background: #f5f0fe; }
.phone-device.skin-messenger .phone-header { background: linear-gradient(135deg, #0099FF, #A033FF); }
.phone-device.skin-messenger .phone-bubble { border-radius: 18px; background: #fff; }

/* ─── Draggable Field Notes ─── */
.field-notes-section {
  position: relative;
  min-height: 380px;
  margin: 0 -20px;
  padding: 20px;
}

.field-note {
  position: absolute;
  width: 220px;
  background: var(--paper-light);
  padding: 32px 20px 20px;
  box-shadow: var(--shadow-paper);
  cursor: grab;
  user-select: none;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 100%,
    5% 100%, 0% 95%
  );
  will-change: transform;
}

.field-note:hover {
  box-shadow: var(--shadow-lift);
  z-index: 50 !important;
}

.field-note-tape {
  position: absolute;
  top: -8px;
  right: 50%;
  transform: translateX(50%) rotate(-3deg);
  width: 50px;
  height: 22px;
  pointer-events: none;
}

.note-quote-text {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  font-style: italic;
  margin-bottom: 12px;
}

.note-quote-author {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--red);
}

.note-quote-role {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-light);
  margin-top: 2px;
  line-height: 1.4;
}

/* ─── Article Page: Journal Spread ─── */
.article-spread {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 0 80px;
  position: relative;
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 36px;
  transition: color 0.2s;
}
.article-back-link:hover { color: var(--red); }

.article-category-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  padding: 3px 12px;
  transform: rotate(-1deg);
  opacity: 0.85;
  margin-bottom: 18px;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 8px;
  position: relative;
}

/* Wavy red underline */
.article-title-rule {
  display: block;
  width: 100%;
  margin-bottom: 24px;
  overflow: visible;
}

.article-meta-expedition {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
}

.expedition-datum {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.expedition-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.expedition-value {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

/* Article body */
.article-body {
  position: relative;
}

.article-body p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 66ch;
}

/* Scroll progress margin route line */
.scroll-route {
  position: fixed;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 30;
  pointer-events: none;
}

.scroll-route-track {
  position: absolute;
  top: 60px;
  bottom: 60px;
  left: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--red) 0px,
    var(--red) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.3;
}

.scroll-route-marker {
  position: absolute;
  left: -8px;
  width: 18px;
  transition: top 0.1s linear;
}

/* TL;DR box */
.tldr-box {
  background: rgba(177, 58, 44, 0.06);
  border: 1.5px solid rgba(177, 58, 44, 0.25);
  border-right: 4px solid var(--red);
  padding: 20px 24px 20px 20px;
  margin: 36px 0;
  position: relative;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.tldr-seal {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
}

.tldr-content {}

.tldr-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.tldr-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.6;
}

/* Takeaways — waypoint list */
.takeaways-box {
  margin: 36px 0;
}

.takeaways-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.takeaway-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.waypoint-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.takeaway-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.65;
  padding-top: 4px;
}

/* Sources */
.sources-box {
  margin: 36px 0;
  padding: 20px 22px;
  border: 1px solid var(--ink-faint);
  background: rgba(91, 122, 140, 0.04);
}

.sources-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sources-title svg {
  width: 16px;
  height: 16px;
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-body);
  font-size: 13px;
}

.source-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  flex-shrink: 0;
  padding-top: 2px;
}

.source-item a {
  color: var(--blue);
  border-bottom: 1px solid rgba(91, 122, 140, 0.3);
}
.source-item a:hover { color: var(--blue-dark); border-color: var(--blue-dark); }

/* Related articles */
.related-section {
  margin: 48px 0 0;
  border-top: 1px solid var(--ink-faint);
  padding-top: 28px;
}

.related-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.related-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-card {
  padding: 14px 16px;
  border: 1px solid rgba(67, 56, 42, 0.15);
  background: var(--paper-light);
  display: block;
  position: relative;
  transition: box-shadow 0.2s;
}
.related-card:hover { box-shadow: var(--shadow-paper); }

.related-card-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}

.related-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

/* Margin note annotation */
.margin-note {
  position: absolute;
  right: -160px;
  top: 0;
  width: 140px;
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--blue);
  transform: rotate(-2deg);
  line-height: 1.5;
  opacity: 0.75;
}

/* ─── News Page: Telegram Office ─── */
.news-page-header {
  padding: 40px 0 0;
  margin-bottom: 32px;
}

.news-office-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  margin-bottom: 8px;
}

.news-office-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.1em;
}

.news-sort-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.sort-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 14px;
  border: 1px solid rgba(67, 56, 42, 0.25);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.sort-btn.active,
.sort-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.news-telegram-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* Full telegram strip for news page */
.news-telegram {
  background: var(--paper-light);
  border: 1px solid rgba(67, 56, 42, 0.12);
  border-bottom: none;
  position: relative;
  padding: 18px 24px 16px 24px;
  padding-top: 22px; /* room for perf strip */
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  gap: 24px;
  align-items: start;
  transition: background 0.2s;
}

.news-telegram:last-child { border-bottom: 1px solid rgba(67, 56, 42, 0.12); }

/* Perforated strip along the top edge of each telegram */
.news-telegram::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background-image: radial-gradient(circle, rgba(236,226,204,0.9) 2.5px, transparent 2.5px);
  background-size: 12px 8px;
  background-color: rgba(67, 56, 42, 0.08);
  border-bottom: 1px solid rgba(67, 56, 42, 0.06);
}

.news-telegram:hover { background: rgba(236, 226, 204, 0.8); }

.nt-timestamp {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-light);
  padding-top: 8px;
}

.nt-date {
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  font-size: 11px;
}

.nt-time {
  opacity: 0.6;
  font-size: 10px;
}

.nt-body {
  padding-top: 6px;
}

.nt-headline {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 8px;
}

.nt-dek {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.55;
}

.nt-source {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  margin-top: 10px;
}

.nt-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  padding-top: 6px;
}

.nt-category {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  border: 1px solid rgba(67, 56, 42, 0.2);
  padding: 2px 7px;
}

.nt-urgency {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1.5px solid;
  display: inline-block;
}

.nt-urgency--breaking {
  color: var(--red);
  border-color: var(--red);
  transform: rotate(-1deg);
}

.nt-urgency--high {
  color: var(--blue);
  border-color: var(--blue);
}

/* ─── Footer / Colophon ─── */
.colophon {
  border-top: 1.5px solid var(--ink-faint);
  padding: 40px 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: start;
  position: relative;
  z-index: 5;
  background: rgba(236, 226, 204, 0.7);
}

.colophon-brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.colophon-tagline {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.6;
}

.colophon-coord-block {
  text-align: center;
}

.colophon-coord {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  line-height: 1.8;
}

.colophon-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.colophon-links a {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-light);
  transition: color 0.2s;
}
.colophon-links a:hover { color: var(--red); }

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
  .masthead {
    padding: 18px 20px 14px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .masthead-nav { gap: 14px; flex-wrap: wrap; }
  .masthead-compass { display: none; }

  .atlas-main {
    padding: 0 20px 40px;
  }

  .coord-margin { display: none; }

  .journal-entries {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .journal-card:nth-child(odd),
  .journal-card:nth-child(even),
  .journal-card:nth-child(3n) {
    transform: rotate(0deg);
  }
  .journal-card:hover { transform: translateY(-3px) !important; }

  .telegram-grid {
    grid-template-columns: 1fr;
  }

  .section-radio {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .field-notes-section {
    min-height: 1400px;
  }

  .field-notes-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
    margin: 0;
    padding: 0;
  }

  .field-note {
    position: static !important;
    transform: none !important;
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: block;
    left: auto !important;
    top: auto !important;
    clip-path: none;
    border-radius: 2px;
  }

  .article-spread {
    padding: 20px 0 60px;
  }

  .margin-note { display: none; }

  .related-cards {
    grid-template-columns: 1fr;
  }

  .news-telegram {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .nt-badges {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .colophon {
    grid-template-columns: 1fr;
    padding: 28px 20px;
    gap: 24px;
  }

  .scroll-route { display: none; }
}

@media (max-width: 480px) {
  .masthead-name { font-size: 20px; }

  .map-container {
    min-height: 240px;
  }

  .compass-container {
    width: 50px;
    height: 50px;
  }
  .compass-rose {
    width: 50px;
    height: 50px;
  }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .compass-rose { transition: none; }
  .journal-card,
  .phone-device,
  .field-note { transition: none; }

  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
