:root {
  --frost: #f0f6f7;
  --slate: #89aec8;
  --brass: #7b6727;
  --timber: #4e452a;
  --marine: #002c55;
  --midnight: #0b0e29;
  --abyss: #18232a;
  --cloud: #dfe1e2;
  --moss: #393f3a;
  --steel: #7f96ae;
  --sand: #e3c686;
  --sage: #7da17e;
  --snow: #f7f6f9;
  --mint: #98b6b0;
  --pine: #163f38;
  --ice: #d6e0e2;

  --bg-base: var(--frost);
  --bg-surface: var(--frost);
  --bg-elevated: var(--frost);
  --bg-subtle: rgba(137, 174, 200, 0.12);
  --bg-hover: rgba(137, 174, 200, 0.2);
  
  --border-subtle: rgba(137, 174, 200, 0.35);
  --border-strong: var(--slate);
  --border-active: var(--marine);
  
  --text-primary: var(--midnight);
  --text-secondary: var(--timber);
  --text-muted: var(--slate);
  
  --accent-main: var(--marine);
  --accent-subtle: var(--slate);
  --accent-highlight: var(--brass);
  --accent-contrast: var(--frost);
  
  --badge-bg: rgba(123, 103, 39, 0.12);
  --badge-text: var(--brass);
  --tag-bg: rgba(137, 174, 200, 0.12);
  --tag-border: rgba(137, 174, 200, 0.35);
  --tag-text: var(--marine);
  
  --shortcut-bg: var(--frost);
  --shortcut-border: rgba(137, 174, 200, 0.4);
  --shortcut-text: var(--timber);

  --modal-backdrop: rgba(11, 14, 41, 0.45);
  --card-shadow: 0 1px 3px rgba(11, 14, 41, 0.05), 0 4px 12px rgba(11, 14, 41, 0.04);
  --card-shadow-hover: 0 4px 16px rgba(11, 14, 41, 0.08), 0 1px 4px rgba(11, 14, 41, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-sans: 'Ubuntu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-arabic: 'Cairo', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  
  --sidebar-width: 250px;
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-base: var(--midnight);
  --bg-surface: var(--midnight);
  --bg-elevated: var(--midnight);
  --bg-subtle: var(--marine);
  --bg-hover: rgba(137, 174, 200, 0.15);
  
  --border-subtle: rgba(137, 174, 200, 0.2);
  --border-strong: rgba(137, 174, 200, 0.4);
  --border-active: var(--brass);
  
  --text-primary: var(--frost);
  --text-secondary: var(--slate);
  --text-muted: rgba(137, 174, 200, 0.7);
  
  --accent-main: var(--brass);
  --accent-subtle: var(--slate);
  --accent-highlight: var(--slate);
  --accent-contrast: var(--midnight);
  
  --badge-bg: rgba(123, 103, 39, 0.3);
  --badge-text: var(--brass);
  --tag-bg: var(--marine);
  --tag-border: rgba(137, 174, 200, 0.3);
  --tag-text: var(--frost);
  
  --shortcut-bg: var(--marine);
  --shortcut-border: rgba(137, 174, 200, 0.25);
  --shortcut-text: var(--slate);

  --modal-backdrop: rgba(11, 14, 41, 0.88);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--brass);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
}

ul, ol {
  list-style: none;
}

.arabic-text {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic) !important;
  line-height: 1.8;
}

.bg-marine { background-color: var(--marine) !important; color: var(--frost); }
.bg-midnight { background-color: var(--midnight) !important; color: var(--frost); }
.bg-timber { background-color: var(--timber) !important; color: var(--frost); }
.bg-abyss { background-color: var(--abyss) !important; color: var(--frost); }
.bg-moss { background-color: var(--moss) !important; color: var(--frost); }
.bg-pine { background-color: var(--pine) !important; color: var(--frost); }

.bg-frost { background-color: var(--frost) !important; color: var(--midnight); }
.bg-cloud { background-color: var(--cloud) !important; color: var(--midnight); }
.bg-snow { background-color: var(--snow) !important; color: var(--midnight); }
.bg-ice { background-color: var(--ice) !important; color: var(--midnight); }

.bg-slate { background-color: var(--slate) !important; color: var(--midnight); }
.bg-brass { background-color: var(--brass) !important; color: var(--midnight); }
.bg-steel { background-color: var(--steel) !important; color: var(--midnight); }
.bg-sand { background-color: var(--sand) !important; color: var(--midnight); }
.bg-sage { background-color: var(--sage) !important; color: var(--midnight); }
.bg-mint { background-color: var(--mint) !important; color: var(--midnight); }

.pattern-marine { background: repeating-linear-gradient(45deg, var(--marine), var(--marine) 10px, #001f3d 10px, #001f3d 20px) !important; }
.pattern-midnight { background: repeating-linear-gradient(45deg, var(--midnight), var(--midnight) 10px, #0d1130 10px, #0d1130 20px) !important; }
.pattern-frost { background: repeating-linear-gradient(45deg, var(--frost), var(--frost) 10px, #e2ebec 10px, #e2ebec 20px) !important; }
.pattern-slate { background: repeating-linear-gradient(45deg, var(--slate), var(--slate) 10px, #7a9cb5 10px, #7a9cb5 20px) !important; }
.pattern-brass { background: repeating-linear-gradient(45deg, var(--brass), var(--brass) 10px, #655420 10px, #655420 20px) !important; }
.pattern-timber { background: repeating-linear-gradient(45deg, var(--timber), var(--timber) 10px, #3d3621 10px, #3d3621 20px) !important; }
.pattern-abyss { background: repeating-linear-gradient(45deg, var(--abyss), var(--abyss) 10px, #10171c 10px, #10171c 20px) !important; }
.pattern-cloud { background: repeating-linear-gradient(45deg, var(--cloud), var(--cloud) 10px, #c9caca 10px, #c9caca 20px) !important; }
.pattern-moss { background: repeating-linear-gradient(45deg, var(--moss), var(--moss) 10px, #2a2e2b 10px, #2a2e2b 20px) !important; }
.pattern-steel { background: repeating-linear-gradient(45deg, var(--steel), var(--steel) 10px, #6d8196 10px, #6d8196 20px) !important; }
.pattern-sand { background: repeating-linear-gradient(45deg, var(--sand), var(--sand) 10px, #c9af76 10px, #c9af76 20px) !important; }
.pattern-sage { background: repeating-linear-gradient(45deg, var(--sage), var(--sage) 10px, #6c8c6d 10px, #6c8c6d 20px) !important; }
.pattern-snow { background: repeating-linear-gradient(45deg, var(--snow), var(--snow) 10px, #e2e1e3 10px, #e2e1e3 20px) !important; }
.pattern-mint { background: repeating-linear-gradient(45deg, var(--mint), var(--mint) 10px, #859f9a 10px, #859f9a 20px) !important; }
.pattern-pine { background: repeating-linear-gradient(45deg, var(--pine), var(--pine) 10px, #102d28 10px, #102d28 20px) !important; }
.pattern-ice { background: repeating-linear-gradient(45deg, var(--ice), var(--ice) 10px, #bec6c8 10px, #bec6c8 20px) !important; }

.agile-grid {
  display: grid;
  gap: 1px;
  background-color: var(--marine);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-top: 16px;
  margin-bottom: 24px;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.grid-rows-1 { grid-template-rows: auto; }
.grid-rows-2 { grid-template-rows: auto 1fr; }
.grid-rows-3 { grid-template-rows: auto 1fr 1fr; }

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-full { grid-column: 1 / -1; }

.row-span-1 { grid-row: span 1; }
.row-span-2 { grid-row: span 2; }
.row-span-3 { grid-row: span 3; }

.box-item {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 120px;
}

.box-item.box-nav {
  min-height: auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.box-item.box-hero {
  justify-content: center;
  padding: 2.5rem 2rem;
}

.box-item.box-hero h1 {
  font-size: clamp(2rem, 4.5vw, 4rem);
  margin: 0;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.box-item.box-quote {
  justify-content: center;
  padding: 2.25rem 2rem;
}

.box-item.box-nested {
  display: grid;
  gap: 1px;
  background-color: var(--marine);
  min-height: 140px;
}

.nested-cols-1 { grid-template-columns: 1fr; }
.nested-cols-2 { grid-template-columns: 1fr 1fr; }
.nested-cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.box-content {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-text {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  font-weight: 300;
}

.font-bold {
  font-weight: 700;
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-base);
}

.upper-right-widget {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
}

.watermelon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.watermelon-badge:hover {
  transform: scale(1.1) rotate(12deg);
  border-color: var(--border-active);
  box-shadow: var(--card-shadow-hover);
}

.watermelon-svg {
  width: 26px;
  height: 26px;
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px 20px 18px;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-smooth), background-color var(--transition-smooth), border-color var(--transition-smooth);
}

[data-theme="dark"] .sidebar {
  background-color: var(--midnight);
  border-right: 1px solid var(--border-subtle);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 6px;
  text-decoration: none;
}

.brand-logo-watermelon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(11, 14, 41, 0.08);
  transition: transform var(--transition-fast);
}

.sidebar-brand:hover .brand-logo-watermelon {
  transform: scale(1.08) rotate(-6deg);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-group {
  margin-bottom: 20px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  user-select: none;
}

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

.nav-item.active {
  background-color: var(--bg-elevated);
  color: var(--accent-main);
  font-weight: 600;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .nav-item.active {
  background-color: var(--marine);
  border-color: var(--border-active);
  color: var(--frost);
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.shortcut-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: var(--shortcut-bg);
  border: 1px solid var(--shortcut-border);
  color: var(--shortcut-text);
  min-width: 18px;
  text-align: center;
  opacity: 0.85;
}

.external-arrow {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-toggle-container {
  position: relative;
  display: flex;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  width: 100%;
}

.theme-btn {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 0;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  position: relative;
  z-index: 2;
  transition: color var(--transition-fast);
}

.theme-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}

.theme-glider {
  position: absolute;
  top: 3px;
  left: 3px;
  bottom: 3px;
  width: calc((100% - 6px) / 3);
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 4px rgba(11, 14, 41, 0.12);
  transition: transform var(--transition-smooth);
  z-index: 1;
}

[data-theme="dark"] .theme-glider {
  background-color: var(--marine);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

[data-theme-mode="light"] .theme-glider { transform: translateX(0%); }
[data-theme-mode="dark"] .theme-glider { transform: translateX(100%); }
[data-theme-mode="auto"] .theme-glider { transform: translateX(200%); }

.cmd-k-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cmd-k-hint:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 48px 48px 96px 48px;
  display: flex;
  justify-content: center;
  transition: margin var(--transition-smooth);
  background-color: var(--bg-base);
}

.content-container {
  width: 100%;
  max-width: 860px;
}

.page-view {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-view.active {
  display: block;
}

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

.hero-greeting {
  margin-bottom: 40px;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-subtext {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 680px;
}

.hero-subtext .highlight {
  color: var(--accent-main);
  font-weight: 600;
}

.onboarding-refresher {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px dashed var(--border-strong);
  transition: color var(--transition-fast);
}

.onboarding-refresher:hover {
  color: var(--accent-main);
  border-bottom-color: var(--accent-main);
}

.section-block {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-action-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.section-action-btn:hover {
  color: var(--accent-main);
}

.empty-section-placeholder {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background-color: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

[data-theme="dark"] .empty-section-placeholder {
  background-color: var(--midnight);
  border-color: rgba(137, 174, 200, 0.25);
}

.empty-placeholder-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-placeholder-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-tile {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
  text-decoration: none;
}

[data-theme="dark"] .update-tile {
  background-color: var(--midnight);
  border-color: rgba(137, 174, 200, 0.2);
}

.update-tile:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
}

.update-left {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.update-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-main);
  flex-shrink: 0;
  margin-top: 2px;
}

.update-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.update-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.update-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.update-external-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.update-tile:hover .update-external-icon {
  transform: translate(2px, -2px);
  color: var(--accent-main);
}

.update-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.update-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.update-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.update-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--border-subtle);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
}

[data-theme="dark"] .project-card {
  background-color: var(--midnight);
  border-color: rgba(137, 174, 200, 0.2);
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: var(--card-shadow-hover);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-banner {
  width: 100%;
  height: 90px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.project-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.project-role {
  font-size: 12px;
  color: var(--accent-main);
  font-weight: 500;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.project-metric {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.writing-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.writing-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
  cursor: pointer;
}

[data-theme="dark"] .writing-card {
  background-color: var(--midnight);
  border-color: rgba(137, 174, 200, 0.2);
}

.writing-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: var(--card-shadow-hover);
}

.writing-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.writing-date, .writing-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.writing-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.writing-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

.filter-btn.active {
  background-color: var(--accent-main);
  border-color: var(--accent-main);
  color: var(--accent-contrast);
  font-weight: 600;
}

.about-block {
  margin-bottom: 36px;
}

.about-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 2px solid var(--border-subtle);
  padding-left: 20px;
  margin-top: 16px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-main);
  border: 2px solid var(--bg-base);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.setup-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

[data-theme="dark"] .setup-card {
  background-color: var(--midnight);
  border-color: rgba(137, 174, 200, 0.2);
}

.setup-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.setup-card ul li {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.setup-card ul li::before {
  content: '•';
  color: var(--accent-subtle);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-backdrop);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(11, 14, 41, 0.25);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .modal-dialog {
  background-color: var(--midnight);
  border-color: rgba(137, 174, 200, 0.3);
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.markdown-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text-primary);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.markdown-body h1 { font-size: 24px; }
.markdown-body h2 { font-size: 20px; }
.markdown-body h3 { font-size: 16px; }
.markdown-body h4 { font-size: 14px; }

.markdown-body p {
  margin-bottom: 1em;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }

.markdown-body li {
  margin-bottom: 0.35em;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent-main);
  padding: 8px 16px;
  margin: 1.25em 0;
  background-color: var(--bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary);
  font-style: italic;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--accent-main);
}

.markdown-body pre {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.25em 0;
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text-primary);
}

.markdown-body a {
  color: var(--accent-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2em 0;
}

.cmd-palette-dialog {
  max-width: 600px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(11, 14, 41, 0.35);
}

[data-theme="dark"] .cmd-palette-dialog {
  background-color: var(--midnight);
}

.cmd-input-box {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.cmd-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
}

.cmd-results-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cmd-item:hover, .cmd-item.selected {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmd-item-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background-color: var(--midnight);
  color: var(--frost);
  border: 1px solid var(--timber);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(11, 14, 41, 0.25);
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

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

.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
}

[data-theme="dark"] .mobile-top-bar {
  background-color: var(--midnight);
}

.mobile-menu-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .mobile-top-bar {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 30px rgba(11, 14, 41, 0.3);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .upper-right-widget {
    display: none;
  }

  .main-wrapper {
    margin-left: 0;
    padding: 76px 20px 80px 20px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .agile-grid {
    grid-template-columns: 1fr !important;
  }

  .col-span-1, .col-span-2, .col-span-3, .col-span-full {
    grid-column: span 1 !important;
  }

  .box-item.box-nested {
    grid-template-columns: 1fr !important;
  }

  .box-item.box-nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .box-item.box-hero {
    padding: 2rem 1.25rem;
  }

  .box-content {
    padding: 1.75rem 1.25rem;
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}
