/* ==========================================================================
   Yan Wu — Minimal Personal Website Stylesheet (Light Mode Only)
   Clean, typography-driven, zero AI slop, zero dark mode clutter.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-subtle: #f9f9f9;
  --bg-hover: #f3f3f3;
  --text: #111111;
  --text-muted: #555555;
  --text-dim: #888888;
  --border: #e8e8e8;
  --border-focus: #111111;
  --link: #111111;
  --accent: #111111;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  border-bottom-color: var(--link);
}

.text-link {
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}

.text-link:hover {
  border-bottom-color: var(--text);
}

/* Layout: 2 Columns (Sidebar Left, Content Right) */
.page-container {
  position: relative;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 4.25rem 2rem 3.5rem;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 3rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

/* Top Right Language Switcher */
.lang-switch-container {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  z-index: 50;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.15rem 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.ai-trans-notice {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.25;
  user-select: none;
  white-space: nowrap;
}

.ai-trans-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  background: var(--bg-subtle);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  transition: color 0.15s ease;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--text);
  font-weight: 700;
}

.lang-divider {
  color: var(--border-focus);
  user-select: none;
}

.site-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.site-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.site-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* Navigation Menu */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  transition: color 0.15s ease;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.active {
  color: var(--text);
  font-weight: 600;
}

.nav-item-badge {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Sidebar Links */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.88rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.social-links a:hover {
  color: var(--text);
}

.social-links .social-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.social-links a:hover .social-icon {
  opacity: 1;
}

.social-links .external-arrow {
  font-size: 0.8rem;
  opacity: 0.65;
  margin-left: 0.05rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.social-links a:hover .external-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* Main Content Area */
.content {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography & Section Styles */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.page-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.bio-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
}

.bio-section p strong {
  font-weight: 600;
}

/* Interactive World Map & Journey */
.journey-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0 2rem 0;
}

.journey-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.journey-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

.journey-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.journey-btn {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.journey-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.map-viewport {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.map-viewport svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
}

.world-land {
  fill: var(--bg-subtle);
  stroke: var(--border);
  stroke-width: 1;
}

.journey-arc-path {
  display: none;
  fill: none;
  stroke: var(--border-focus);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 4 3;
  opacity: 0.25;
}

.journey-arc-path.completed {
  display: block;
  opacity: 0.45;
  stroke-dasharray: 2 2;
  stroke-width: 1.2;
}

.journey-arc-path.active {
  display: block;
  opacity: 1;
  stroke: var(--text);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawFlightArc 1.2s cubic-bezier(0.2, 0.9, 0.4, 1) forwards;
}

@keyframes drawFlightArc {
  to {
    stroke-dashoffset: 0;
  }
}

.city-marker-group {
  cursor: pointer;
}

.city-point {
  fill: var(--bg);
  stroke: var(--text);
  stroke-width: 1.6;
}

.city-point.visited {
  fill: var(--text);
}

.city-point.active {
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 2.5;
  r: 5;
}

.city-pulse-ring {
  fill: none;
  stroke: var(--text);
  stroke-width: 1;
  opacity: 0;
  transform-origin: center;
}

.city-pulse-ring.active {
  opacity: 0.5;
  animation: pulseRing 1.8s infinite ease-out;
}

@keyframes pulseRing {
  0% { r: 5; opacity: 0.8; }
  100% { r: 16; opacity: 0; }
}

.city-name-text {
  font-size: 9.5px;
  font-family: var(--font-mono);
  fill: var(--text);
  font-weight: 500;
  opacity: 0.65;
  pointer-events: none;
}

.city-name-text.active {
  opacity: 1;
  font-weight: 700;
}

.journey-crumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.crumb-btn {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.22rem 0.55rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.crumb-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.crumb-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

.crumb-btn.completed {
  border-color: var(--border-focus);
  color: var(--text);
}

.crumb-arrow {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.journey-story {
  border-left: 2px solid var(--border-focus);
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border-radius: 0 3px 3px 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.story-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.story-age-badge {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.story-route-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.story-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.story-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Preview Section in Main/Overview page */
.preview-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.45rem;
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.preview-action {
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.preview-action:hover {
  color: var(--text);
}

/* Experience List & Preview Items */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.experience-entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.entry-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.entry-period {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.entry-company {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.entry-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0.25rem;
}

/* Blog / Writing Section */
.notice-box {
  background: var(--bg-subtle);
  border-left: 2px solid var(--border-focus);
  padding: 0.65rem 0.95rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.writing-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.writing-entry {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.writing-entry:last-child {
  border-bottom: none;
}

.writing-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.writing-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s ease;
}

.writing-entry:hover .writing-title {
  text-decoration: underline;
}

.writing-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.writing-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.empty-state-msg {
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 0.75rem 0;
  margin: 0;
}

/* Dedicated Single Blog Post Page */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--text);
}

.single-post-view {
  display: flex;
  flex-direction: column;
}

.single-post-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.single-post-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.single-post-summary-box {
  background: var(--bg-subtle);
  border-left: 2px solid var(--border-focus);
  padding: 0.9rem 1.15rem;
  margin-bottom: 2rem;
  border-radius: 0 4px 4px 0;
}

.single-post-summary-title {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.single-post-summary-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  font-weight: 500;
}

.single-post-image {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin: 1.25rem 0;
  display: block;
}

.post-figure {
  margin: 1.5rem 0;
  display: block;
}

.post-figure.float-right {
  float: right;
  max-width: 220px;
  margin: 0.25rem 0 1.25rem 1.75rem;
}

.post-figure.float-right .post-inline-image {
  max-width: 220px;
  width: 100%;
}

.post-figure.float-right .post-caption {
  text-align: center;
  max-width: 220px;
}

.post-figure.float-left {
  float: left;
  max-width: 220px;
  margin: 0.25rem 1.75rem 1.25rem 0;
}

.post-figure.float-left .post-inline-image {
  max-width: 220px;
  width: 100%;
}

.post-figure.float-left .post-caption {
  text-align: center;
  max-width: 220px;
}

.post-inline-image {
  width: 100%;
  max-width: 540px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

.post-caption {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 0.45rem;
  line-height: 1.4;
}

.single-post-body {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
}

.single-post-body::after {
  content: "";
  display: table;
  clear: both;
}

.single-post-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem 0;
  color: var(--text);
}

.single-post-body h3:first-child {
  margin-top: 0;
}

.single-post-body p {
  margin-bottom: 1rem;
}

.single-post-body ul, .single-post-body ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}

.single-post-body li {
  margin-bottom: 0.35rem;
}

/* Tag Filter & Pill Styles for Misc */
.tag-filters {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tag-filter-btn {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-filter-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.tag-filter-btn.active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

/* Misc / Food & Places */
.misc-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.misc-tag-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.misc-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.08rem 0.4rem;
  border-radius: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .page-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 3.75rem 1.25rem 2rem;
  }

  .lang-switch-container {
    top: 1.25rem;
    right: 1.25rem;
  }

  .sidebar {
    position: static;
    gap: 1.5rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
  }

  .social-links {
    flex-direction: row;
    gap: 1rem;
  }

  .post-figure.float-right,
  .post-figure.float-left {
    max-width: 150px;
    margin: 0.25rem 0 0.75rem 1rem;
  }

  .post-figure.float-right .post-inline-image,
  .post-figure.float-left .post-inline-image {
    max-width: 150px;
  }
}
