/* ============================================
   Personal Hub - Monochrome Design System
   B&W Minimal / Sharp Edges / Refined
   ============================================ */

/* --- Font Face --- */
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-Thin.woff2') format('woff2'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-ExtraLight.woff2') format('woff2'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('../fonts/Pretendard-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* --- CSS Variables --- */
:root {
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --bg-nav: rgba(255,255,255,0.85);
  --text: #000000;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: #e0e0e0;
  --border-light: #eeeeee;
  --accent: #000000;
  --accent-hover: #333333;
  --accent-light: rgba(0,0,0,0.04);
  --danger: #000000;
  --success: #000000;
  --warning: #000000;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

[data-theme="dark"] .nav-logo-icon { filter: invert(1); }
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #111111;
  --bg-nav: rgba(10,10,10,0.88);
  --text: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #555555;
  --border: #222222;
  --border-light: #1a1a1a;
  --accent: #ffffff;
  --accent-hover: #cccccc;
  --accent-light: rgba(255,255,255,0.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
a:hover { border-bottom-color: var(--text); }

/* --- Typography --- */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 600; line-height: 1.3; letter-spacing: -0.03em; }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.5rem; font-weight: 700; }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-bold { font-weight: 600; }

/* --- Layout --- */
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }

.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 40px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.nav-logo-icon { width: 28px; height: 28px; }

.nav-logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.nav-links { display: flex; gap: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: var(--transition);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 18px; right: 18px;
  height: 1.5px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--text); font-weight: 700; }
.nav-link.active::after { transform: scaleX(1); }

.nav-icon { font-size: 0.95rem; }

.nav-section-badge {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--text);
  padding: 2px 6px;
  margin-left: 8px;
  text-transform: uppercase;
  vertical-align: middle;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  color: var(--text-muted);
}
.theme-toggle:hover { border-color: var(--text-secondary); color: var(--text); background: var(--accent-light); }

.mobile-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* --- Page --- */
.page {
  padding-top: 96px;
  padding-bottom: 60px;
  min-height: 100vh;
  animation: fadeIn 0.4s ease;
}

.page-header { margin-bottom: 40px; }
.page-title { margin-bottom: 4px; letter-spacing: -0.04em; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 28px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.card-title { font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.card-body { position: relative; }

/* --- Buttons (sdij-inspired, soft monochrome) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text-secondary); color: var(--text); background: var(--accent-light); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger { color: var(--text-muted); border-color: var(--border); background: transparent; }
.btn-danger:hover { background: rgba(200,30,30,0.06); color: #c81e1e; border-color: #c81e1e; }

.btn-ghost { border: none; background: none; color: var(--text-muted); padding: 6px 10px; letter-spacing: -0.01em; }
.btn-ghost:hover { color: var(--text); background: var(--accent-light); }

.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 0; font-size: 0.85rem; border: 1px solid var(--border); color: var(--text-muted); }
.btn-icon:hover { border-color: var(--text-secondary); color: var(--text); background: var(--accent-light); }

/* --- Inputs --- */
.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  border-radius: 0;
  transition: var(--transition);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--text);
}
.textarea { min-height: 80px; resize: vertical; }
.select { cursor: pointer; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0;
  background: var(--accent-light);
  color: var(--text);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-green { background: var(--accent-light); color: var(--text); }
.badge-red { background: var(--text); color: var(--bg); }
.badge-yellow { background: var(--accent-light); color: var(--text); }

/* --- Stat Cards --- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--text); }
.stat-icon { font-size: 1.3rem; margin-bottom: 8px; }
.stat-number { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Visitor Stats Chart */
.vs-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.vs-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 28px;
}
.vs-bar-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.vs-bar {
  width: 100%;
  max-width: 32px;
  background: var(--text);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.vs-bar-date {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
}

/* --- Calendar --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.calendar-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.calendar-day {
  text-align: center;
  padding: 10px 4px;
  font-size: 0.85rem;
  border-radius: 0;
  cursor: default;
  position: relative;
  transition: var(--transition);
  font-variant-numeric: tabular-nums;
}
.calendar-day:not(.empty):hover { background: var(--accent-light); }
.calendar-day.today {
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}
.calendar-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--text);
}
.calendar-day.today.has-event::after { background: var(--bg); }

.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 0;
  margin-top: 6px;
  font-size: 0.85rem;
  border-left: 2px solid var(--text);
}

/* --- Todo --- */
.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.todo-item:last-child { border-bottom: none; }

.todo-check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--text);
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: transparent;
}
.todo-check:hover { background: var(--accent-light); }
.todo-check.done { background: var(--text); border-color: var(--text); color: var(--bg); }

.todo-text { flex: 1; font-size: 0.9rem; }
.todo-text.done { text-decoration: line-through; color: var(--text-muted); }

/* --- Ideas --- */
.idea-card {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 0;
  margin-bottom: 8px;
  transition: var(--transition);
  border-left: 2px solid var(--border);
}
.idea-card:hover { border-left-color: var(--text); }
.idea-content { font-size: 0.9rem; margin-bottom: 8px; line-height: 1.6; }
.idea-tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* --- Habit Tracker --- */
.habit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.habit-label { width: 80px; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; }
.habit-cells { display: flex; gap: 3px; flex: 1; }
.habit-cell {
  width: 28px; height: 28px;
  border-radius: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.habit-cell:hover { border-color: var(--text); }
.habit-cell.completed { background: var(--text); border-color: var(--text); color: var(--bg); }

.habit-header { display: flex; gap: 3px; margin-bottom: 6px; margin-left: 88px; }
.habit-header span { width: 28px; text-align: center; font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }

/* --- Progress/Goals --- */
.progress-item { margin-bottom: 20px; }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.85rem; }
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 0;
  background: var(--text);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* --- Hero (Portfolio) --- */
.hero {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 60px,
    var(--border-light) 60px,
    var(--border-light) 61px
  );
  opacity: 0.25;
}

.hero-row {
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.hero-cell {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-cell + .hero-cell {
  border-left: 1px solid var(--border);
}
.hero-cell-name {
  flex: 1;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}
.hero-cell-desc {
  flex: 1.4;
}
.hero-cell-links {
  flex: 0 0 auto;
  flex-direction: row;
  gap: 0;
  align-items: stretch;
  padding: 0;
  border-left: none;
}

.hero-title { font-size: clamp(1.4rem, 3.5vw, 1.85rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1.2; margin: 0; }
.hero-title span { border-bottom: 2px solid var(--text); padding-bottom: 1px; }
.hero-subtitle { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin: 0; letter-spacing: -0.01em; }

.hero-cell-links .btn {
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}
.hero-cell-links .btn:hover { color: var(--text); background: var(--accent-light); }
.hero-cell-links .btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--border);
}
.hero-cell-links .btn-primary:hover { background: var(--accent-hover); }

.hero-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}
.hero-tabs {
  display: flex;
  gap: 0;
  border-right: 1px solid var(--border);
}
.hero-tab {
  padding: 14px 22px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-tab:last-child { border-right: none; }
.hero-tab:hover { color: var(--text); background: var(--accent-light); }
.hero-tab.active { color: var(--bg); background: var(--text); }
.tab-initial { font-size: 1.1em; font-weight: 900; color: var(--text); }

.hero-bar .visitor-counter { border: none; margin-left: auto; }
.hero-bar .visitor-stat { padding: 10px 20px; }
.hero-bar .visitor-divider { height: 100%; background: var(--border); }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 36px; }
.timeline-dot {
  position: absolute;
  left: -32px; top: 6px;
  width: 11px; height: 11px;
  background: var(--text);
  border: none;
  border-radius: 0;
}
.timeline-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.05em; font-weight: 600; }
.timeline-title { font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.timeline-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* --- Work Grid (Portfolio) --- */
.work-card {
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  transition: var(--transition);
}
.work-card:hover { border-color: var(--text); }
.work-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.work-card-info { padding: 20px; }
.work-card-type { font-size: 0.65rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }

/* --- Pomodoro (circular timer) --- */
.pomodoro { text-align: center; padding: 20px 0; }

.pomo-presets-wrap { margin-bottom: 28px; }
.pomo-setting { margin-bottom: 12px; }
.pomo-setting-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.pomo-presets { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.pomo-preset {
  padding: 5px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
}
.pomo-preset:hover { border-color: var(--text-secondary); color: var(--text-secondary); }
.pomo-preset.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.pomo-circle-wrap {
  position: relative;
  width: 220px; height: 220px;
  margin: 0 auto 28px;
}
.pomo-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-track { fill: none; stroke: var(--border); stroke-width: 2; }
.pomo-progress { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linecap: square; transition: stroke-dashoffset 1s linear; }
.pomo-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.pomo-time { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; line-height: 1; }
.pomo-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; letter-spacing: 0.04em; }
.pomo-sessions { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

.pomodoro-controls { display: flex; gap: 8px; justify-content: center; }

.pomo-custom { margin-top: 16px; }
.pomo-custom-row { display: flex; gap: 6px; justify-content: center; align-items: center; }
.pomo-custom-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  text-align: center;
  border-radius: 0;
  outline: none;
  transition: var(--transition);
}
.pomo-custom-input:focus { border-color: var(--text-secondary); }
.pomo-custom-label { font-size: 0.7rem; color: var(--text-muted); }

/* --- D-Day --- */
.dday-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: 0;
  margin-bottom: 8px;
  transition: var(--transition);
  border-left: 2px solid var(--text);
}
.dday-item:hover { background: var(--accent-light); }
.dday-name { font-weight: 700; font-size: 0.9rem; letter-spacing: -0.02em; }
.dday-date { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.02em; }
.dday-count { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.dday-count.past { color: var(--text-muted); }

/* --- Bookmarks --- */
.bookmark-category { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 20px 0 8px; }
.bookmark-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 0;
  transition: var(--transition);
  cursor: pointer;
}
.bookmark-item:hover { background: var(--accent-light); }
.bookmark-favicon { width: 20px; height: 20px; border-radius: 0; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; border: 1px solid var(--border); }
.bookmark-title { font-size: 0.9rem; font-weight: 500; }
.bookmark-url { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* --- Reading List --- */
.book-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 0;
  margin-bottom: 8px;
  border-left: 2px solid var(--border);
}
.book-cover {
  width: 44px; height: 60px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.book-info { flex: 1; }
.book-title { font-weight: 700; font-size: 0.9rem; letter-spacing: -0.01em; }
.book-author { font-size: 0.8rem; color: var(--text-secondary); }
.book-status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 0;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}
.book-status.want { background: transparent; color: var(--text-muted); }
.book-status.reading { background: var(--text); color: var(--bg); border-color: var(--text); }
.book-status.read { background: var(--accent-light); color: var(--text); }

/* --- Diary --- */
.mood-selector { display: flex; gap: 6px; margin: 12px 0; }
.mood-btn {
  width: 44px; height: 44px;
  border: 1.5px solid var(--border);
  background: transparent;
  border-radius: 0;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mood-btn:hover { border-color: var(--text); }
.mood-btn.selected { border-color: var(--text); background: var(--text); filter: grayscale(0); }

.entry-item {
  padding: 18px;
  background: var(--bg-secondary);
  border-radius: 0;
  margin-bottom: 8px;
  transition: var(--transition);
  border-left: 2px solid var(--text);
}
.entry-item:hover { padding-left: 22px; }
.entry-date { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.03em; }
.entry-mood { font-size: 1.25rem; }
.entry-preview { font-size: 0.9rem; color: var(--text-secondary); margin-top: 8px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Mood Stats --- */
.mood-stats { display: flex; gap: 10px; }
.mood-stat-item { flex: 1; text-align: center; }
.mood-bar-bg {
  height: 80px;
  background: var(--bg-secondary);
  border-radius: 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border: 1px solid var(--border);
}
.mood-bar-fill {
  width: 100%;
  background: var(--text);
  border-radius: 0;
  transition: height 0.6s ease;
}
.mood-stat-label { font-size: 0.7rem; margin-top: 6px; }

/* --- Tabs --- */
.tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 12px 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.02em; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.8rem; color: var(--text-secondary); transition: var(--transition); border-bottom: none; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.footer-links a:hover { color: var(--text); }

/* --- Top Button --- */
.top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, background 0.2s, border-color 0.2s;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-btn.visible { opacity: 1; pointer-events: auto; }
.top-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* --- Skill Tags --- */
.skill-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.skill-tag {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.skill-tag:hover { border-color: var(--text-secondary); color: var(--text); background: var(--accent-light); }

/* --- Visitor Counter --- */
.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
}
.visitor-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
}
.visitor-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.visitor-count {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.visitor-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* --- Visitor Counter --- */
.nav-visitor-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-family: var(--font);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.nav-vc-item strong {
  font-weight: 700;
  color: var(--text-secondary);
}
.nav-vc-divider {
  opacity: 0.3;
}
.align-center { align-items: center; }

/* --- Language Toggle --- */
.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: var(--transition);
}
.lang-toggle:hover {
  border-color: var(--text-secondary);
  color: var(--text);
  background: var(--accent-light);
}

/* --- Board --- */
.board-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.board-filter {
  padding: 6px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
  letter-spacing: 0.02em;
}
.board-filter:hover { border-color: var(--text-secondary); color: var(--text); }
.board-filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.board-list { display: flex; flex-direction: column; gap: 0; }
.board-item {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-bottom: none;
  transition: var(--transition);
  cursor: default;
}
.board-item:last-child { border-bottom: 1px solid var(--border); }
.board-item:hover { background: var(--accent-light); padding-left: 28px; }
.board-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.board-item-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.board-item-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.board-item-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.board-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: right;
  letter-spacing: 0.02em;
}

/* --- Board Detail --- */
.board-item-clickable { cursor: pointer; }
.board-item-clickable:hover { background: var(--accent-light); padding-left: 28px; }

.board-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.board-detail-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
  line-height: 1.2;
}
.board-detail-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}
.board-detail-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.board-detail-section {
  margin-bottom: 28px;
}
.board-detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.board-detail-features {
  list-style: none;
  padding: 0;
}
.board-detail-features li {
  position: relative;
  padding: 8px 0 8px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.board-detail-features li:last-child { border-bottom: none; }
.board-detail-features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.board-detail-content {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
  line-height: 1.8;
}
.board-detail-h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 12px;
  letter-spacing: -0.03em;
}
.board-detail-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 24px 0 8px;
  letter-spacing: -0.02em;
}
.board-detail-p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.board-detail-li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}
.board-detail-li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* --- Markdown Body --- */
.markdown-body { line-height: 1.8; }
.markdown-body h1 { font-size: 1.5rem; font-weight: 800; margin: 32px 0 12px; letter-spacing: -0.04em; }
.markdown-body h2 { font-size: 1.2rem; font-weight: 700; margin: 28px 0 10px; letter-spacing: -0.03em; }
.markdown-body h3 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 8px; }
.markdown-body p { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 12px; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin-bottom: 12px; }
.markdown-body li { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 4px; }
.markdown-body code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 0;
}
.markdown-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
}
.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.markdown-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  margin: 16px 0;
}
.markdown-body iframe {
  max-width: 100%;
  border: 1px solid var(--border);
  margin: 16px 0;
}
.markdown-body a { color: var(--text); border-bottom: 1px solid var(--text); }
.markdown-body a:hover { border-bottom-width: 2px; }
.markdown-body blockquote {
  border-left: 3px solid var(--text);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* --- Post Editor --- */
.post-editor-body {
  min-height: 400px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  resize: vertical;
}
/* Editor Expanded Mode */
.editor-expanded {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-expanded .card-body {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.editor-expanded .post-editor-body {
  flex: 1;
  min-height: 0;
  resize: none;
}
.editor-expanded .markdown-body {
  flex: 1;
  overflow: auto;
}
.editor-expanded + .flex { display: none; }

/* Markdown Guide Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--bg);
  border-radius: 16px;
  padding: 28px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.md-guide-modal {
  width: 100%;
  max-width: 640px;
}
.md-guide-table {
  width: 100%;
  border-collapse: collapse;
}
.md-guide-table th,
.md-guide-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
}
.md-guide-table th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.md-guide-table code {
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* --- PDF Library --- */
.pdf-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pdf-viewer-frame {
  width: 100%;
  height: 80vh;
  border: none;
  border-radius: 0 0 12px 12px;
}
.pdf-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.pdf-list-item:last-child { border-bottom: none; }
.pdf-list-item:hover { background: var(--accent-light); margin: 0 -16px; padding: 14px 16px; border-radius: 8px; }

.post-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.post-manage-item:last-child { border-bottom: none; }

.drag-item { cursor: grab; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.drag-item:active { cursor: grabbing; }
.drag-item.dragging { opacity: 0.35; }
.drag-item.drag-over {
  border-top: 2px solid var(--text);
  background: var(--accent-light);
  transform: translateY(2px);
}
.drag-handle {
  cursor: grab;
  font-size: 16px;
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.drag-item:hover .drag-handle { color: var(--text); }
.drag-handle:active { cursor: grabbing; }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
.empty-state-text { font-size: 0.85rem; letter-spacing: 0.01em; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.fade-in { animation: fadeIn 0.4s ease; }
.slide-up { animation: slideUp 0.6s ease; }

/* --- Hero Avatar --- */
.hero-avatar {
  width: 64px; height: 64px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* --- Hero Stats Row --- */
.hero-stats-row {
  display: flex;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.hero-stat-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-right: 1px solid var(--border);
}
.hero-stat-cell:last-child { border-right: none; }
.hero-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.hero-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --- Pinned Section --- */
.pinned-section { margin-bottom: 28px; }
.pinned-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.pinned-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.pinned-card {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-right: none;
  cursor: pointer;
  transition: var(--transition);
}
.pinned-card:last-child { border-right: 1px solid var(--border); }
.pinned-card:hover { background: var(--accent-light); }
.pinned-card-tab {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.pinned-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.pinned-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Bio Profile --- */
.bio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.skill-group { margin-bottom: 16px; }
.skill-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.skill-group-tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* --- Board Card Grid --- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.board-card {
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  margin-right: -1px;
  margin-bottom: -1px;
}
.board-card:hover { background: var(--accent-light); z-index: 1; border-color: var(--text); }
.board-card-thumb {
  aspect-ratio: 16/7;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}
.board-card-icon { font-size: 2.2rem; opacity: 0.5; }
.board-card:hover .board-card-icon { opacity: 1; }
.board-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.board-card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.board-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.board-card-tech { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; margin-bottom: 10px; }
.tech-badge {
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.board-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.board-card-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.board-card-links { display: flex; gap: 8px; }
.board-card-link {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: none !important;
  letter-spacing: 0.02em;
}
.board-card-link:hover { color: var(--text); }

/* --- Footer Enhanced --- */
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
.footer-brand { max-width: 300px; }
.footer-brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.footer-brand-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: none;
  padding: 4px 0;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Scroll Portfolio --- */
.portfolio-scroll { padding-top: 0; min-height: 100vh; }

.s-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
}
.s-hero { position: relative; overflow: hidden; }
.s-hero-content { max-width: 960px; position: relative; z-index: 1; }

/* Globe Animation */
.hero-globe {
  position: absolute;
  right: 10%;
  top: 50%;
  width: 520px;
  height: 520px;
  opacity: 0.07;
  transform: translateY(-50%) rotate(-23.5deg);
}
.gl {
  fill: none;
  stroke: var(--text);
  stroke-width: 1;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawGl 1.8s ease forwards;
}
.gl-outer { stroke-width: 1.5; animation-delay: 0s; }
.gl-lat { stroke-dasharray: 500; stroke-dashoffset: 500; }
.gl-lon { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
@keyframes drawGl {
  to { stroke-dashoffset: 0; }
}
.gl-marker {
  fill: var(--text);
  opacity: 0;
  animation: markerIn 0.4s 1.8s ease forwards;
}
.gl-pulse {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
  opacity: 0;
  animation: pulseRing 2s 2s ease-out infinite;
}
@keyframes markerIn {
  from { opacity: 0; r: 0; }
  to { opacity: 1; r: 5; }
}
@keyframes pulseRing {
  0% { opacity: 0.6; r: 5; }
  100% { opacity: 0; r: 28; }
}
.s-hero-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  animation: slideUp 0.8s 0.2s forwards;
}
.s-hero-name {
  font-size: clamp(48px, 7vw, 80px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  opacity: 0;
  animation: slideUp 0.8s 0.4s forwards;
}
.s-hero-name-sub {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 32px;
  opacity: 0;
  animation: slideUp 0.8s 0.5s forwards;
}
.s-hero-desc {
  font-size: 17px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.9;
  opacity: 0;
  animation: slideUp 0.8s 0.6s forwards;
}
.s-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  opacity: 0;
  animation: slideUp 0.8s 0.8s forwards;
}
.s-hero-tag {
  font-size: 12px;
  color: var(--text);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Scroll Sections */
.s-section { padding: 100px 0; }
.s-section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 56px;
}
.s-section-num {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.s-section-title {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}
.s-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 16px;
}

/* Project Cards */
.s-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.s-project-card, .s-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
}
.s-project-card.visible, .s-post-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.35s, border-color 0.35s;
}
.s-project-card:hover, .s-post-card:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.s-project-card::before, .s-post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.s-project-card:hover::before, .s-post-card:hover::before { transform: scaleX(1); }

.s-project-arrow {
  position: absolute;
  top: 28px; right: 28px;
  font-size: 18px;
  color: var(--text-muted);
  transition: all 0.3s;
}
.s-project-card:hover .s-project-arrow {
  color: var(--text);
  transform: translate(3px, -3px);
}
.s-card-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.s-card-header-row .s-project-icon { margin-bottom: 0; }
.s-card-header-row .s-project-name { margin-bottom: 0; }
.s-project-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.s-project-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.s-project-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}
.s-project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.s-project-tech span {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}
.s-project-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* About Section */
.s-about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.s-about-text {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 2;
}
.s-about-text p + p { margin-top: 20px; }
.s-about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.s-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  opacity: 0;
  transform: translateY(20px);
}
.s-stat-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.s-stat-number {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}
.s-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* YouTube Section */
.s-youtube-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  display: flex;
  align-items: center;
  gap: 48px;
  opacity: 0;
  transform: translateY(30px);
}
.s-youtube-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.s-yt-icon {
  width: 80px; height: 80px;
  border-radius: 20px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.s-yt-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.s-yt-handle { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.s-yt-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.s-yt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: none !important;
  transition: gap 0.2s;
}
.s-yt-link:hover { gap: 12px; }

.s-yt-video-card { cursor: pointer; }
.s-yt-thumb-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.s-yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.s-yt-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.2s;
}
.s-yt-video-card:hover .s-yt-play-overlay { opacity: 1; }

/* Contact Grid */
.s-contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.s-contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px);
}
.s-contact-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s, box-shadow 0.3s;
}
.s-contact-card:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow-md);
}
.s-contact-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.s-contact-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.s-contact-value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

/* Bio Timeline */
.s-timeline {
  position: relative;
  padding-left: 140px;
}
.s-timeline::before {
  content: '';
  position: absolute;
  left: 128px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.s-timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 32px;
}
.s-timeline-item:last-child { margin-bottom: 0; }
.s-timeline-date {
  position: absolute;
  left: -140px;
  width: 120px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.s-timeline-dot {
  position: absolute;
  left: -16px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--text);
  border-radius: 50%;
  flex-shrink: 0;
}
.s-timeline-body { padding-left: 12px; }
.s-timeline-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.s-timeline-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Nav scroll links (public) */
.nav-scroll-links {
  display: flex;
  gap: 32px;
}
.nav-scroll-link {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
}
.nav-scroll-initial {
  color: var(--text);
  font-weight: 700;
}
.nav-scroll-link:hover {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--text);
}

/* Scroll Footer */
.s-footer-quote {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 8px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .board-grid { grid-template-columns: repeat(2, 1fr); }
  .pinned-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }

  .nav { height: 56px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 14px 16px; font-size: 0.9rem; justify-content: flex-start; }
  .nav-link::after { display: none; }
  .nav-link.active { background: var(--accent-light); }
  .mobile-toggle { display: block; }

  .page { padding-top: 76px; }
  .page-header { margin-bottom: 24px; }

  .hero-row { flex-direction: column; }
  .hero-cell + .hero-cell { border-left: none; border-top: 1px solid var(--border); }
  .hero-cell { padding: 16px; }
  .hero-cell-links { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .hero-title { font-size: clamp(1.3rem, 5vw, 1.6rem) !important; }
  .hero-cell-name { flex-direction: column; gap: 12px; }
  .hero-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
  .hero-stats-row { flex-wrap: wrap; }
  .hero-stat-cell { min-width: 50%; }
  .hero-bar { flex-direction: column; padding: 0; gap: 0; }
  .hero-tabs { width: 100%; }
  .hero-tab { flex: 1; padding: 10px 10px; font-size: 0.7rem; }
  .pinned-grid { grid-template-columns: 1fr; }
  .pinned-card { border-right: 1px solid var(--border); border-bottom: none; }
  .pinned-card:last-child { border-bottom: 1px solid var(--border); }
  .bio-grid { grid-template-columns: 1fr; }
  .board-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .s-timeline { padding-left: 24px; }
  .s-timeline::before { left: 4px; }
  .s-timeline-date { position: static; width: auto; text-align: left; margin-bottom: 4px; }
  .s-timeline-item { flex-direction: column; }
  .s-timeline-dot { left: -24px; top: 30px; }
  .s-timeline-body { padding-left: 0; }
  .hero-globe { width: 300px; height: 300px; right: -60px; opacity: 0.05; }
  .s-hero { padding: 100px 0 60px; min-height: auto; }
  .s-section { padding: 60px 0; }
  .s-projects-grid { grid-template-columns: 1fr; }
  .s-about-content { grid-template-columns: 1fr; gap: 40px; }
  .s-youtube-card { flex-direction: column; text-align: center; padding: 32px; }
  .s-contact-grid { flex-direction: column; }
  .nav-scroll-links { display: none; }
  .hero .visitor-counter { width: 100%; justify-content: center; border-top: 1px solid var(--border); }
  .hero .visitor-stat { flex: 1; }

  .footer-content { flex-direction: column; gap: 12px; text-align: center; }

  .mood-selector { justify-content: center; }
  .mood-btn { width: 40px; height: 40px; }

  .pomo-circle-wrap { width: 180px; height: 180px; }
  .pomo-time { font-size: 2.2rem; }
  .pomo-presets { gap: 3px; }
  .pomo-preset { padding: 5px 10px; font-size: 0.7rem; }

  .habit-label { width: 56px; font-size: 0.7rem; }
  .habit-cell { width: 26px; height: 26px; font-size: 0.6rem; }
  .habit-header { margin-left: 64px; }
  .habit-header span { width: 26px; font-size: 0.55rem; }

  .input-row { flex-direction: column; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { flex-shrink: 0; padding: 10px 14px; font-size: 0.75rem; }

  .visitor-counter { margin-top: 24px; }
  .visitor-stat { padding: 8px 16px; }
  .visitor-count { font-size: 1.1rem; }

  .btn { padding: 10px 18px; font-size: 0.78rem; }
  .btn-sm { padding: 7px 12px; }

  .stat-card { padding: 16px; }
  .stat-number { font-size: 1.5rem; }

  .dday-item { padding: 14px 16px; }
  .dday-count { font-size: 1.25rem; }

  .calendar-day { padding: 8px 2px; font-size: 0.8rem; }

  .timeline { padding-left: 24px; }
  .timeline-dot { left: -24px; width: 9px; height: 9px; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .page { padding-top: 68px; padding-bottom: 40px; }
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  .hero-cell { padding: 12px; }

  .pomo-circle-wrap { width: 160px; height: 160px; }
  .pomo-time { font-size: 2rem; }
  .pomodoro-controls { flex-wrap: wrap; }

  .grid { gap: 12px; }

  .habit-label { width: 48px; font-size: 0.65rem; }
  .habit-cell { width: 22px; height: 22px; }
  .habit-header { margin-left: 56px; }
  .habit-header span { width: 22px; }

  .book-item { flex-direction: column; gap: 10px; }
  .book-cover { width: 100%; height: 40px; }

  .work-card-img { aspect-ratio: 4/3; }

  .mood-stats { gap: 6px; }
  .mood-bar-bg { height: 60px; }
}

/* touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { width: 36px; height: 36px; }
  .nav-link { min-height: 44px; }
  .todo-check { width: 24px; height: 24px; }
  .habit-cell { min-width: 28px; min-height: 28px; }
  .mood-btn { width: 48px; height: 48px; }
  .pomo-preset { min-height: 36px; padding: 8px 14px; }
  .tab { min-height: 44px; }
  .bookmark-item { padding: 12px; }
}
