/* ============================================================
   portfolio-atlas.css — "Atlas" aesthetic for Finance Tracking.
   Blueprint paper with hand-drawn grid, plates, compass rose.
   ============================================================ */

.page-atlas {
  --paper: #f1ede0;
  --paper-2: #e5e0cf;
  --grid: rgba(60, 80, 110, 0.08);
  --grid-bold: rgba(60, 80, 110, 0.16);
  --ink: #1e2a3a;
  --ink-2: #3e4a5e;
  --ink-3: #7a8294;
  --rule: #b8c0cc;
  --indigo: #2b3a64;
  --copper: #b06a3a;

  --serif: "New York", "Source Serif 4", Georgia, "Times New Roman", ui-serif, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  min-height: 100vh;
  background: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  background-position: 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page-atlas,
.page-atlas * { box-sizing: border-box; }

.page-atlas a { color: inherit; text-decoration: none; }

/* ---------- Full-bleed hero ---------- */
.at-hero {
  --hero-img: none;
  position: relative;
  height: 100vh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink);
  background: var(--paper);
}

.at-hero-bg {
  position: absolute;
  inset: -4%;
  z-index: -3;
  background-color: #c8c0a8;
  background-image:
    linear-gradient(135deg, rgba(200, 192, 168, 0.55) 0%, rgba(170, 175, 195, 0.4) 55%, rgba(43, 58, 100, 0.55) 100%),
    var(--hero-img);
  background-size: cover, cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: at-kenburns 34s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes at-kenburns {
  0%   { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.07) translate3d(-1.5%, 0.5%, 0); }
}

/* Grid slowly drifts diagonally — like the map is being unrolled */
.at-hero-grid {
  animation: at-grid-drift 28s linear infinite;
  background-attachment: local;
}

@keyframes at-grid-drift {
  0%   { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 32px 32px, 32px 32px, 160px 160px, 160px 160px; }
}

.at-hero-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(43, 58, 100, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 58, 100, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(43, 58, 100, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 58, 100, 0.3) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px;
  pointer-events: none;
}

.at-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(241, 237, 224, 0.4) 0%, transparent 20%, transparent 75%, rgba(241, 237, 224, 0.55) 100%);
}

.at-hero-tl {
  position: absolute;
  top: clamp(24px, 4vw, 48px);
  left: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-transform: uppercase;
  max-width: 320px;
}

.at-hero-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  transition: color 200ms ease;
  align-self: flex-start;
}

.at-hero-home:hover { color: var(--copper); }

.at-hero-mark { display: flex; flex-direction: column; gap: 14px; }

.at-hero-mark-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: var(--indigo);
  font-weight: 500;
  text-transform: none;
}

.at-hero-mark-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  line-height: 1.5;
}

.at-hero-tr {
  position: absolute;
  top: clamp(24px, 4vw, 48px);
  right: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
  max-width: 260px;
  line-height: 1.45;
}

.at-hero-tr-tag {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 12px;
}

.at-hero-coords {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--indigo);
  pointer-events: none;
  padding: 16px 28px;
  border: 1px solid var(--indigo);
  background: rgba(241, 237, 224, 0.7);
}

.at-hero-bl {
  position: absolute;
  bottom: clamp(24px, 4vw, 48px);
  left: clamp(24px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.at-hero-bl span:last-child {
  animation: at-hero-bob 2.2s ease-in-out infinite;
}

@keyframes at-hero-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

.at-hero-br {
  position: absolute;
  bottom: clamp(24px, 4vw, 48px);
  right: clamp(24px, 4vw, 48px);
}

.at-hero-compass {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: rgba(241, 237, 224, 0.7);
}

.at-hero-compass-n {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--copper);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.at-hero-compass-needle {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 2px;
  height: 26px;
  background: var(--copper);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(12deg);
  animation: at-compass-spin 14s ease-in-out infinite;
}

@keyframes at-compass-spin {
  0%   { transform: translateX(-50%) rotate(12deg); }
  35%  { transform: translateX(-50%) rotate(-32deg); }
  65%  { transform: translateX(-50%) rotate(46deg); }
  100% { transform: translateX(-50%) rotate(12deg); }
}

@media (max-width: 720px) {
  .at-hero-tr { max-width: 170px; font-size: 0.95rem; }
  .at-hero-mark-name { font-size: 2.5rem; }
  .at-hero-coords { padding: 10px 16px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .at-hero-bl span:last-child,
  .at-hero-bg,
  .at-hero-grid,
  .at-hero-compass-needle { animation: none !important; }
  .at-hero-bg { inset: 0; transform: none; }
}

/* ---------- Top bar ---------- */
.at-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 56px);
  background: rgba(241, 237, 224, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.at-topbar-home { color: var(--ink); font-weight: 500; }
.at-topbar-home:hover { color: var(--copper); }
.at-topbar-meta { justify-self: center; color: var(--ink-3); }
.at-topbar-back:hover { color: var(--copper); }

/* ---------- Frame corners (used on cover + plates) ---------- */
.at-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
}

.at-corner-tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.at-corner-tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.at-corner-bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.at-corner-br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

/* ---------- Cover ---------- */
.at-cover {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 56px);
}

.at-cover-frame {
  position: relative;
  border: 1px solid var(--ink);
  background: rgba(241, 237, 224, 0.6);
  padding: clamp(48px, 8vw, 96px) clamp(32px, 6vw, 80px);
}

.at-cover-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 24px;
}

.at-cover-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 24px;
  font-weight: 500;
  max-width: 14ch;
}

.at-cover-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 32px;
  max-width: 36ch;
}

.at-cover-coords {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

/* ---------- Legend ---------- */
.at-legend {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 56px);
}

.at-legend-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.at-legend-icon {
  color: var(--copper);
  font-size: 14px;
}

.at-legend-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
  font-weight: 500;
}

.at-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 0;
}

.at-legend-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.at-legend-item dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.at-legend-item dd {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--indigo);
  margin: 0;
  font-weight: 500;
}

/* ---------- Stack strip ---------- */
.at-stack-strip {
  max-width: 1080px;
  margin: 16px auto 0;
  padding: 24px clamp(20px, 5vw, 56px);
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.at-stack-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.at-stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.at-stack-list li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 5px 10px;
  border: 1px solid var(--rule);
  background: rgba(241, 237, 224, 0.6);
}

/* ---------- Plates ---------- */
.at-plates {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 56px);
}

.at-plate { margin-bottom: 56px; }
.at-plate:last-child { margin-bottom: 0; }

.at-plate-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.at-plate-tag {
  color: var(--ink);
  font-weight: 500;
  padding: 6px 12px;
  background: var(--copper);
  color: var(--paper);
}

.at-plate-eyebrow {
  color: var(--ink-3);
}

.at-plate-frame {
  position: relative;
  border: 1px solid var(--ink);
  padding: clamp(32px, 5vw, 56px);
  background: rgba(241, 237, 224, 0.6);
}

.at-plate-heading {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--indigo);
  margin: 0 0 24px;
  max-width: 28ch;
}

.at-plate-para {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 16px;
  max-width: 60ch;
}

.at-plate-para:last-child { margin-bottom: 0; }

/* ---------- Coda ---------- */
.at-coda {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) clamp(20px, 5vw, 56px);
  text-align: center;
}

.at-compass {
  margin: 0 auto 40px;
  width: 96px;
  height: 96px;
}

.at-compass-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.at-compass-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed var(--ink-3);
  border-radius: 50%;
}

.at-compass-n, .at-compass-e, .at-compass-s, .at-compass-w {
  position: absolute;
}

.at-compass-n { top: 4px; left: 50%; transform: translateX(-50%); color: var(--copper); font-weight: 700; }
.at-compass-e { right: 6px; top: 50%; transform: translateY(-50%); }
.at-compass-s { bottom: 4px; left: 50%; transform: translateX(-50%); }
.at-compass-w { left: 6px; top: 50%; transform: translateY(-50%); }

.at-compass-needle {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 2px;
  height: 32px;
  background: var(--copper);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(15deg);
}

.at-coda-line {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 32px;
}

.at-back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 14px 24px;
  border: 1px solid var(--ink);
  transition: background 200ms ease, color 200ms ease;
}

.at-back:hover { background: var(--indigo); color: var(--paper); border-color: var(--indigo); }

/* ---------- Footer ---------- */
.at-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px 48px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
}

.at-footer a:hover { color: var(--copper); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .at-topbar-meta { display: none; }
  .at-cover-frame, .at-plate-frame { padding: 32px 24px; }
  .at-stack-strip { gap: 12px; }
}
