/* ==========================================================================
   BUMAI Experience — Field Notes
   Re-themed to match the studio-modular-inspired design system in theme.css:
   dark navy hero bands (BUMAI's own aurora/satellite photography) giving way
   to a warm paper reading surface, set in Noto Sans throughout.
   ========================================================================== */

:root {
  /* -- Ink: dark hero / browsing surface -- */
  --ink-bg: #0b0f14;
  --ink-bg-soft: #142a25;
  --ink-line: rgba(255, 255, 255, 0.1);
  --ink-line-strong: rgba(255, 255, 255, 0.18);
  --ink-text: #f5f7f2;
  --ink-text-soft: rgba(245, 247, 242, 0.72);
  --ink-text-dim: rgba(245, 247, 242, 0.5);

  /* -- Paper: reading surface inside articles -- */
  --paper-bg: #f7f3ea;
  --paper-line: rgba(11, 15, 20, 0.12);
  --paper-text: #0b0f14;
  --paper-text-soft: rgba(11, 15, 20, 0.68);

  /* -- Accents, matched to theme.css -- */
  --aurora: #1f9c7a;
  --aurora-soft: rgba(51, 214, 166, 0.16);
  --moon: #4d78ab;
  --moon-soft: rgba(188, 216, 255, 0.28);
  --ember: #d9713d;
  --ember-soft: rgba(255, 138, 76, 0.18);
  --danger: #d9614f;
  --danger-soft: rgba(217, 97, 79, 0.16);

  --radius-sm: 8px;
  --radius-md: clamp(14px, 1.6vw, 24px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Noto Sans", "Noto Sans SC", -apple-system, sans-serif;
  --font-body: "Noto Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ==========================================================================
   Experience list — "Field Log"
   A vertical, dated timeline: entries are genuinely chronological, so a
   spine and phase-dots earn their place.
   ========================================================================== */

.log-hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.5rem clamp(3rem, 6vw, 4.5rem);
  overflow: hidden;
  color: var(--ink-text);
  background: var(--ink-bg);
  border-radius: var(--radius-md);
  max-width: var(--container, 1400px);
  margin: 0 auto;
}

.log-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 15, 20, 0.6), var(--ink-bg) 92%),
    url("/images/hero-aurora.jpg") center 25% / cover no-repeat;
  animation: kenBurns 24s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* -- Rotating circular badge (Studio Modular-style scroll/status flourish) -- */

.hero-badge {
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(1.25rem, 4vw, 2.5rem);
  width: 84px;
  height: 84px;
  z-index: 2;
}

.hero-badge__ring {
  width: 100%;
  height: 100%;
  animation: badgeSpin 15s linear infinite;
}

.hero-badge__ring text {
  font-size: 8px;
  letter-spacing: 2px;
  fill: rgba(245, 247, 242, 0.7);
  text-transform: uppercase;
  font-family: var(--font-body);
}

.hero-badge__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--aurora);
  box-shadow: 0 0 0 0 var(--aurora-soft);
  animation: pulse 3.2s var(--ease) infinite;
}

@keyframes badgeSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .hero-badge { display: none; }
}

.log-hero__inner {
  max-width: 1080px;
  margin: 0 auto;
}

.log-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-text-soft);
  margin-bottom: 1.4rem;
}

.log-hero__eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #33d6a6;
  box-shadow: 0 0 0 0 var(--aurora-soft);
  animation: pulse 3.2s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 0 0 var(--aurora-soft); }
  50% { opacity: 1; box-shadow: 0 0 0 7px var(--aurora-soft); }
}

.log-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
}

.log-hero__dek {
  max-width: 34rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-text-soft);
  margin: 0;
}

.log-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(4rem, 8vw, 6rem);
}

.log-body__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--paper-line);
  margin-bottom: 0.5rem;
}

.log-body__head h2 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-text-soft);
  margin: 0;
  font-weight: 600;
}

.log-body__count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--paper-text-soft);
}

.log-empty {
  padding: 3rem 0;
  color: var(--paper-text-soft);
  line-height: 1.7;
}

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--moon), var(--paper-line) 92%);
}

.entry {
  position: relative;
  padding: 1.8rem 0 1.8rem 2.3rem;
  border-bottom: 1px solid var(--paper-line);
}

.entry.reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.entry.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.entry:first-child {
  padding-top: 0.4rem;
}

.entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2.3rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper-bg);
  border: 2px solid var(--moon);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.entry--featured::before {
  border-color: var(--aurora);
  background: var(--aurora);
}

.entry a.entry__link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  margin: -0.6rem -0.8rem;
  padding: 0.6rem 0.8rem;
  transition: background 200ms var(--ease);
}

.entry a.entry__link:hover {
  background: var(--ink-bg-soft);
  background: rgba(11, 15, 20, 0.05);
}

.entry a.entry__link:hover .entry__title {
  color: var(--aurora);
}

.entry a.entry__link:hover .entry__arrow {
  transform: translate(2px, -2px);
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--paper-text-soft);
  margin-bottom: 0.5rem;
}

.entry__meta time {
  color: var(--paper-text-soft);
}

.entry__title {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.4rem;
  transition: color 200ms var(--ease);
}

.entry__summary {
  color: var(--paper-text-soft);
  line-height: 1.65;
  margin: 0 0 0.7rem;
  max-width: 46rem;
}

.entry__footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: var(--paper-text-soft);
}

.tag {
  font-family: var(--font-mono);
  color: var(--moon);
}

.pill {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--paper-line);
  font-size: 0.76rem;
  color: var(--paper-text-soft);
}

.entry__arrow {
  margin-left: auto;
  display: inline-block;
  transition: transform 180ms var(--ease);
}

/* ==========================================================================
   Article page — Ink hero, then a Paper reading pane.
   ========================================================================== */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 250;
  background: linear-gradient(90deg, var(--moon), var(--aurora));
  transition: width 80ms linear;
}

.article-hero {
  position: relative;
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
  color: var(--ink-text);
  background: var(--ink-bg);
  border-radius: var(--radius-md);
  max-width: var(--container, 1400px);
  margin: 0 auto;
}

.article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 15, 20, 0.55), var(--ink-bg) 94%),
    url("/images/hero-satellite.jpg") center 30% / cover no-repeat;
  animation: kenBurns 24s ease-in-out infinite alternate;
}

.article-hero__inner {
  max-width: 760px;
  margin: 0 auto;
}

.article-hero__crumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-text-dim);
  margin-bottom: 1.1rem;
}

.article-hero__crumb a {
  color: var(--ink-text-dim);
  text-decoration: none;
}

.article-hero__crumb a:hover {
  color: var(--ink-text-soft);
}

.article-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}

.article-hero__dek {
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.6;
  color: var(--ink-text-soft);
  max-width: 40rem;
  margin: 0 0 1.6rem;
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-text-dim);
  margin-bottom: 1.6rem;
}

.article-hero__meta time {
  color: var(--ink-text-soft);
}

.article-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.article-hero .btn {
  border-color: var(--ink-line-strong);
  color: var(--ink-text);
}

.article-hero .btn:hover {
  border-color: var(--aurora);
  background: var(--aurora-soft);
}

.btn--ghost {
  border-color: transparent;
  color: var(--ink-text-soft);
  padding-left: 0;
}

.btn--ghost:hover {
  background: transparent !important;
  color: #33d6a6;
}

/* -- Reading pane: switches to Paper -- */

.reading-pane {
  background: var(--paper-bg);
  color: var(--paper-text);
}

.reading-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) 1.5rem clamp(4rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: 200px minmax(0, 760px);
  gap: 3.5rem;
  align-items: start;
}

.reading-layout--no-toc {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.toc {
  position: sticky;
  top: 6.5rem;
  font-size: 0.85rem;
}

.toc__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-text-soft);
  margin-bottom: 0.8rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--paper-line);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--paper-text-soft);
  line-height: 1.4;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.toc li.toc__sub a {
  padding-left: 1.6rem;
  font-size: 0.82rem;
}

.toc a:hover {
  color: var(--paper-text);
}

.toc a.is-active {
  color: var(--aurora);
  border-left-color: var(--aurora);
}

.toc-mobile {
  display: none;
}

@media (max-width: 1024px) {
  .reading-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
    margin-bottom: 2rem;
    border: 1px solid var(--paper-line);
    border-radius: var(--radius-md);
  }

  .toc-mobile summary {
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--paper-text-soft);
  }

  .toc-mobile ol {
    list-style: none;
    margin: 0;
    padding: 0 1.1rem 1rem;
  }

  .toc-mobile a {
    display: block;
    padding: 0.4rem 0;
    text-decoration: none;
    color: var(--paper-text);
  }

  .toc-mobile li.toc__sub a {
    padding-left: 1rem;
    font-size: 0.9rem;
    color: var(--paper-text-soft);
  }
}

/* -- Article typography -- */

.prose {
  max-width: 760px;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  line-height: 1.85;
}

.prose > * + * {
  margin-top: 1.4rem;
}

.prose p {
  margin: 0;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 3.6rem;
  margin-bottom: 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--aurora);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-top: 2.2rem;
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose a {
  color: var(--moon);
  text-decoration-color: var(--moon-soft);
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--aurora);
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--paper-line);
  color: var(--paper-text-soft);
  font-style: italic;
}

.prose img {
  border-radius: var(--radius-md);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--paper-line);
  margin: 2.4rem 0;
}

/* -- Code blocks -- */

.prose pre {
  position: relative;
  margin: 0;
  padding: 1.1rem 1.2rem;
  background: #0b0f14;
  color: #eee7d8;
  border: 1px solid rgba(11, 15, 20, 0.2);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

.prose :not(pre) > code {
  background: rgba(11, 15, 20, 0.08);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.code-copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: #b9b0a0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.code-copy:hover {
  color: #eee7d8;
  border-color: var(--aurora);
}

.code-copy.is-copied {
  color: var(--aurora);
  border-color: var(--aurora);
}

/* -- Callouts -- */

.callout {
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--moon);
  background: var(--moon-soft);
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 0.6rem;
}

.callout__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  color: var(--paper-text);
}

.callout--warning {
  border-left-color: var(--ember);
  background: var(--ember-soft);
}

.callout--danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.article-footer {
  max-width: 760px;
  margin: 3rem auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--paper-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--paper-text-soft);
}

.article-footer a {
  text-decoration: none;
  color: var(--moon);
}

.article-footer a:hover {
  color: var(--aurora);
}

/* ==========================================================================
   Sitemap page
   ========================================================================== */

.sitemap-page {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) 1.5rem clamp(4rem, 8vw, 6rem);
}

.sitemap-page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3rem);
  margin: 0 0 0.6rem;
}

.sitemap-page > p {
  color: var(--paper-text-soft);
  margin: 0 0 2.5rem;
  line-height: 1.6;
}

.sitemap-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sitemap-tree > li {
  margin-bottom: 0.6rem;
}

.sitemap-tree a {
  text-decoration: none;
  color: var(--paper-text);
  border-bottom: 1px solid transparent;
}

.sitemap-tree a:hover {
  color: var(--aurora);
  border-bottom-color: var(--aurora);
}

.sitemap-tree__branch {
  list-style: none;
  margin: 0.8rem 0 0;
  padding-left: 1.4rem;
  border-left: 1px solid var(--paper-line);
}

.sitemap-tree__branch li {
  padding: 0.5rem 0;
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  border-bottom: 1px solid var(--paper-line);
}

.sitemap-tree__branch li:last-child {
  border-bottom: none;
}

.sitemap-tree__branch time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--paper-text-soft);
  flex-shrink: 0;
}

/* ==========================================================================
   404
   ========================================================================== */

.not-found {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
  color: var(--ink-text);
  background: var(--ink-bg);
  border-radius: var(--radius-md);
  max-width: var(--container, 1400px);
  margin: 0 auto;
}

.not-found::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 15, 20, 0.72), var(--ink-bg) 96%),
    url("/images/hero-phases-moon.jpg") center 25% / cover no-repeat;
  animation: kenBurns 24s ease-in-out infinite alternate;
}

.not-found__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-text-dim);
  margin-bottom: 1rem;
}

.not-found__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 0 0 1rem;
}

.not-found p {
  color: var(--ink-text-soft);
  max-width: 30rem;
  line-height: 1.6;
  margin: 0 0 1.8rem;
}

.not-found .btn {
  border-color: var(--ink-line-strong);
  color: var(--ink-text);
}
