/* Base reset and tokens */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Color system */
  --bc-primary: #0F8A9C;      /* deep teal */
  --bc-secondary: #35B76C;    /* fresh green */
  --bc-accent: #FF6F61;       /* soft coral */
  --bc-bg: #F7FAFC;           /* light background */
  --bc-surface: #FFFFFF;      /* card surface */
  --bc-ink: #222222;          /* main text */
  --bc-muted: #4A5568;        /* muted text */
  --bc-edge-soft: rgba(15,138,156,0.18);
  --bc-edge-strong: rgba(15,138,156,0.45);
  --bc-shadow: rgba(15,138,156,0.16);

  /* Radius and layout */
  --bc-radius-sm: 8px;
  --bc-radius-lg: 18px;
  --bc-max-width: 1040px;
  --bc-space-section: 3.5rem;
  --bc-space-block: 1.5rem;

  /* Extra tokens */
  --bc-paper: #F7FAFC;
  --bc-ink-strong: #111111;

  /* Motion tokens */
  --bc-motion-fast: 150ms;
  --bc-motion-med: 260ms;
  --bc-motion-slow: 420ms;
  --bc-easing: cubic-bezier(.22,.61,.36,1);
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bc-bg);
  color: var(--bc-ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

/* Ultra subtle moving background wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 80% 20%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(135deg, rgba(15,138,156,0.08), rgba(53,183,108,0.05));
  animation: bc-wash 24s ease-in-out infinite alternate;
  opacity: 0.35;
}

@keyframes bc-wash {
  0% {
    transform: translate3d(0,0,0) scale(1);
  }
  100% {
    transform: translate3d(0,-2%,0) scale(1.02);
  }
}

/* Layout shell */
.bc-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header and navigation */
.bc-header {
  background: linear-gradient(120deg, rgba(15,138,156,0.95), rgba(53,183,108,0.9));
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.bc-header-inner {
  max-width: var(--bc-max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.bc-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bc-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: rgba(255,255,255,0.08);
  display: block;
}

.bc-brand-text {
  display: flex;
  flex-direction: column;
}

.bc-brand-name {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.bc-brand-tagline {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Nav layout and link micro interaction */
.bc-nav {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.bc-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  font-size: 0.85rem;
  text-decoration: none;
  background: rgba(0,0,0,0.06);
  transition:
    background var(--bc-motion-fast) var(--bc-easing),
    border-color var(--bc-motion-fast) var(--bc-easing),
    color var(--bc-motion-fast) var(--bc-easing);
}

/* Animated underline grow for nav links and text links */
.bc-link,
.bc-nav a {
  position: relative;
  text-decoration: none;
  border-bottom: none;
}

.bc-link::after,
.bc-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--bc-primary), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--bc-motion-med) var(--bc-easing);
}

.bc-link:hover::after,
.bc-nav a:hover::after {
  transform: scaleX(1);
}

.bc-nav a:hover {
  background: rgba(0,0,0,0.16);
  border-color: rgba(255,255,255,0.5);
}

.bc-nav a.bc-current {
  background: #ffffff;
  color: #0F8A9C;
  border-color: rgba(255,255,255,0.85);
}

/* Main layout */
.bc-main {
  flex: 1;
}

.bc-main-inner {
  max-width: var(--bc-max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
}

/* Article container */
.bc-article {
  background-color: var(--bc-surface);
  border-radius: var(--bc-radius-lg);
  box-shadow: 0 14px 40px var(--bc-shadow);
  padding: 2.5rem 2.25rem 2.75rem;
  border: 1px solid var(--bc-edge-soft);
}

/* Article header */
.bc-article-header {
  margin-bottom: 1.75rem;
}

.bc-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bc-secondary);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.bc-title {
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
  color: var(--bc-ink-strong);
}

.bc-dek {
  margin: 0;
  font-size: 1rem;
  color: var(--bc-muted);
  max-width: 44rem;
}

/* Hero image block - exactly one main image per page */
.bc-hero {
  margin: 1.75rem 0 2rem;
}

.bc-hero figure {
  margin: 0;
}

.bc-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--bc-edge-soft);
  box-shadow: 0 18px 50px rgba(0,0,0,0.20);
}

.bc-hero figcaption {
  font-size: 0.8rem;
  color: var(--bc-muted);
  margin-top: 0.55rem;
}

/* Section layout and capsule header animation */
.bc-section {
  position: relative;
  padding-top: var(--bc-space-block);
  margin-top: var(--bc-space-section);
}

.bc-section::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--bc-primary), transparent);
  transition: width var(--bc-motion-slow) var(--bc-easing);
}

.bc-section.is-seen::before {
  width: 100%;
}

.bc-section-title {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--bc-ink-strong);
}

.bc-section-lede {
  margin: 0 0 1rem;
  color: var(--bc-muted);
  font-size: 0.98rem;
}

.bc-section p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
}

/* Card hover lift for callouts */
.bc-card {
  border-radius: var(--bc-radius-sm);
  border: 1px solid var(--bc-edge-soft);
  padding: 1.25rem 1.3rem;
  margin: 1.25rem 0;
  background: linear-gradient(135deg, rgba(15,138,156,0.03), rgba(255,255,255,0.9));
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition:
    transform var(--bc-motion-fast) var(--bc-easing),
    box-shadow var(--bc-motion-fast) var(--bc-easing),
    border-color var(--bc-motion-fast) var(--bc-easing);
}

.bc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--bc-shadow);
  border-color: var(--bc-edge-strong);
}

.bc-card-title {
  font-weight: 600;
  margin: 0 0 0.45rem;
  color: var(--bc-ink-strong);
}

.bc-card p {
  margin: 0.15rem 0 0.65rem;
}

/* Footer */
.bc-footer {
  border-top: 1px solid rgba(15,138,156,0.15);
  background: rgba(247,250,252,0.96);
  backdrop-filter: blur(4px);
}

.bc-footer-inner {
  max-width: var(--bc-max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1.75rem;
  font-size: 0.85rem;
  color: var(--bc-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bc-footer-brand {
  font-weight: 600;
  color: var(--bc-ink-strong);
}

.bc-footer-small {
  opacity: 0.85;
}

/* Back to top button */
.bc-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: var(--bc-primary);
  color: #111111;
  font: 700 18px/46px system-ui,-apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  opacity: 0 !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease;
  z-index: 9999 !important;
  overflow: hidden;
}

.bc-to-top:hover {
  background: #ffffff;
}

.bc-to-top.bc-show {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Reading progress bar */
.bc-progress {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--bc-primary), transparent);
  z-index: 9998;
  transition: width var(--bc-motion-fast) linear;
}

/* Optional ripple inside back to top */
.bc-to-top .ripple {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.35;
  transform: translate(-50%,-50%) scale(0);
  background: #ffffff;
  animation: bc-ripple 0.6s ease-out forwards;
}

@keyframes bc-ripple {
  to {
    transform: translate(-50%,-50%) scale(8);
    opacity: 0;
  }
}

/* Site-wide paragraph justification */
article p,
section p,
main p,
p {
  text-align: justify !important;
  text-justify: inter-word !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .bc-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .bc-article {
    padding: 1.75rem 1.5rem 2.1rem;
  }

  .bc-main-inner {
    padding: 2rem 1.1rem 3rem;
  }

  .bc-title {
    font-size: 1.6rem;
  }
}

/* Motion reduction respect */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
