/* ==========================================================================
   BUMAI Experience — Field Notes
   Ink (browsing) + Paper (reading) duality, echoing the root site's
   day/night mechanic. Aurora teal + moon blue + ember, sampled from
   BUMAI's own sky photography rather than a stock cyan/violet glass kit.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* -- Ink: default browsing surface -- */
  --ink-bg: #0b0f14;
  --ink-bg-soft: #10161d;
  --ink-line: rgba(255, 255, 255, 0.09);
  --ink-line-strong: rgba(255, 255, 255, 0.16);
  --ink-text: #eef1f0;
  --ink-text-soft: #aab4b8;
  --ink-text-dim: #6c7679;

  /* -- Paper: reading surface inside articles -- */
  --paper-bg: #f6f1e6;
  --paper-line: rgba(20, 20, 15, 0.12);
  --paper-text: #1b1c17;
  --paper-text-soft: #55564c;

  /* -- Accent, drawn from aurora.jpg / lake-sky-mount.jpg -- */
  --aurora: #22b7a1;
  --aurora-soft: rgba(34, 183, 161, 0.16);
  --moon: #5b83a0;
  --moon-soft: rgba(91, 131, 160, 0.18);
  --ember: #d98a3d;
  --ember-soft: rgba(217, 138, 61, 0.18);
  --danger: #d9614f;
  --danger-soft: rgba(217, 97, 79, 0.16);

  --radius-sm: 6px;
  --radius-md: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

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

* {
  box-sizing: border-box;
}

html {
  background: var(--ink-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink-text);
  background: var(--ink-bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--ink-bg-soft);
  color: var(--ink-text);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 2px;
}

/* ==========================================================================
   Sky Strip — the signature element.
   A thin gradient bar under the nav whose colors shift with local time of
   day, echoing the root homepage's day/night photograph swap. It is the
   one connective thread that ties every Experience page back to BUMAI.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-line);
}

.sky-strip {
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--sky-a, var(--moon)) 0%,
    var(--sky-b, var(--aurora)) 50%,
    var(--sky-c, var(--ember)) 100%
  );
  transition: background 1200ms var(--ease);
}

html[data-sky="dawn"]  { --sky-a: #6a5b8c; --sky-b: #d98a3d; --sky-c: #e8c27a; }
html[data-sky="day"]   { --sky-a: #5b83a0; --sky-b: #22b7a1; --sky-c: #a9d8c9; }
html[data-sky="dusk"]  { --sky-a: #22b7a1; --sky-b: #5b83a0; --sky-c: #d98a3d; }
html[data-sky="night"] { --sky-a: #1a2233; --sky-b: #5b83a0; --sky-c: #22b7a1; }

.site-header__row {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-header__brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-text);
}

.site-header__nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.92rem;
}

.site-header__nav a {
  text-decoration: none;
  color: var(--ink-text-soft);
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.site-header__nav a:hover,
.site-header__nav a[aria-current="page"] {
  color: var(--ink-text);
  border-bottom-color: var(--aurora);
}

.nav-short { display: none; }

@media (max-width: 640px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-text-dim);
  border-top: 1px solid var(--ink-line);
}

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

.site-footer a:hover {
  color: var(--ink-text-soft);
}

/* ==========================================================================
   Experience list — "Field Log"
   A vertical, dated timeline rather than a card grid: entries are
   genuinely chronological, so a spine and phase-dots earn their place
   in a way that decorative 01/02/03 numbering would not.
   ========================================================================== */

.log-hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.5rem clamp(3rem, 6vw, 4.5rem);
  overflow: hidden;
}

.log-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 15, 20, 0.55), var(--ink-bg) 92%),
    url("/images/experience-night.jpg") center 30% / cover no-repeat;
}

.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: var(--aurora);
  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-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(--ink-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(--ink-text-soft);
  margin: 0;
}

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

.log-empty {
  padding: 3rem 0;
  color: var(--ink-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(--ink-line) 92%);
}

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

.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(--ink-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);
}

.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(--ink-text-dim);
  margin-bottom: 0.5rem;
}

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

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

.entry__summary {
  color: var(--ink-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(--ink-text-dim);
}

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

.pill {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--ink-line-strong);
  font-size: 0.76rem;
  color: var(--ink-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: 150;
  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;
}

.article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 15, 20, 0.5), var(--ink-bg) 94%),
    url("/images/experience-night.jpg") center 22% / cover no-repeat;
}

.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-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;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid var(--ink-line-strong);
  color: var(--ink-text);
  background: transparent;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease);
  font-family: var(--font-body);
}

.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;
  color: var(--aurora);
}

/* -- 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: #14110a;
  color: #eee7d8;
  border: 1px solid rgba(20, 17, 10, 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(20, 20, 15, 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-size: clamp(2.2rem, 5vw, 3rem);
  margin: 0 0 0.6rem;
}

.sitemap-page > p {
  color: var(--ink-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(--ink-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(--ink-line);
}

.sitemap-tree__branch li {
  padding: 0.5rem 0;
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  border-bottom: 1px solid var(--ink-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(--ink-text-dim);
  flex-shrink: 0;
}

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

.not-found {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.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-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;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
