/* Home links custom style */
.home-links {
  font-size: 1rem;
  margin: 0 0 0 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.home-links li {
  margin-bottom: 0;
  flex: 1 1 0;
  min-width: 10px;
  max-width: 100px;
}

.home-links a {
  display: block;
  width: 100%;
  color: var(--text-dim);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 10px 10px 10px;
  font-weight: 500;
  font-size: 0.98em;
  text-align: center;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.08);
}

.home-links a:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Notion-like base styling overrides */
:root {
  --font-sans: system-ui,-apple-system,Segoe UI,Inter,Roboto,sans-serif;
  --font-mono: ui-monospace,Menlo,Consolas,monospace;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #222;
  --text-dim: #555;
  --border: #e3e5e7;
  --radius: 6px;
  --code-bg: #f5f7f9;
  --accent: #2563eb;
  --accent-bg: #e0edff;
  --shadow: 0 1px 2px rgba(0,0,0,.06),0 4px 16px -4px rgba(0,0,0,.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:#121413;
    --bg-alt:#1b1d1c;
    --text:#e8e9ea;
    --text-dim:#a0a4a7;
    --border:#2b2f31;
    --code-bg:#1f2426;
    --accent-bg:#1d3b66;
  }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
}

.main-content, .content, main {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 48px);
}

/* Notion-like cover (approx 20% viewport height) */
.page-cover {
  width: 100%;
  height: 20vh; /* target ~20% of viewport */
  min-height: 180px;
  max-height: 320px;
  background: linear-gradient(135deg, #dbeafe, #f1f5f9);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  .page-cover {
    background: linear-gradient(135deg, #0f2338, #1e2932);
  }
}
/* Footer centering */
.site-footer {
  display: flex;
  justify-content: center;
  padding: 24px clamp(16px, 4vw, 48px);
  max-width: 860px;
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--text-dim);
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
}

code, pre {
  background: var(--code-bg);
  font-family: var(--font-mono);
}

pre {
  padding: 12px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Project listing */
.project-grid {
  list-style: none;
  margin: 32px 0;
  padding: 0;
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg-alt);
  transition: 0.15s border-color, 0.15s transform;
}

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

.project-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.project-card .summary {
  margin: 0 0 12px;
  color: var(--text-dim);
}

.project-card .meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Tags */
.tag {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 999px;
  margin: 0 6px 6px 0;
  text-transform: uppercase;
}

/* Status */
.status {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.6px;
  background: var(--border);
  padding: 3px 6px;
  border-radius: 4px;
}

.status-active {
  background: #d1f5e2;
  color: #0b6b3a;
}

.status-archived {
  background: #eee;
  color: #666;
}

/* Project page */
.project-header {
  margin-bottom: 40px;
}

.project-header h1 {
  margin-bottom: 8px;
  font-size: 2.2rem;
}

.project-header .project-icon {
  font-size: 4.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  margin: 0 0 10px;
}

.project-summary {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-top: 0;
}

.project-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 4px 0 8px;
}

.project-body img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Project drawer */
.project-drawer-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  font-weight: 500;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(5px) saturate(170%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.project-drawer-toggle.drawer-open {
  display: none !important;
}

.project-drawer-toggle:hover {
  color: var(--text);
}

.project-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 80%;
  background: var(--bg);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 18px -6px rgba(0, 0, 0, 0.2);
  transform: translateX(-102%);
  transition: transform 0.4s cubic-bezier(0.4, 0.2, 0.2, 1);
  z-index: 95;
  display: flex;
  flex-direction: column;
}

.project-drawer.open {
  transform: translateX(0);
}

.project-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.project-drawer__header h2 {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}

.project-drawer-close {
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px 6px;
  border-radius: 6px;
}

.project-drawer-close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.project-drawer__nav {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 0 28px;
}

.project-drawer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-drawer__nav li {
  margin: 0;
}

.project-drawer__nav a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-left: 3px solid transparent;
  transition: 0.18s background, 0.18s color, 0.18s border-color;
}

.project-drawer__nav a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.project-drawer__nav li.active a {
  font-weight: 600;
  color: var(--text);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-bg), transparent);
}

@media (max-width: 860px) {
  .project-drawer-toggle {
    top: unset;
    bottom: 10px;
  }
}
/* Callout example */
.callout {
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: 24px 0;
}

/* Notion-like gallery */
.gallery-grid {
  list-style: none;
  margin: 40px 0;
  padding: 0;
  display: grid;
  row-gap: 32px;
  column-gap: 48px;
}

@media (min-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(221px, 1fr));
  }
}
.gallery-card {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  height: clamp(170px, 20.4vw, 221px); /* 15% smaller overall */
  display: flex;
}

.gallery-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.gallery-card .cover {
  flex: 0 0 30%;
  height: 30%; /* half the card height for flatter look */
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: 0.3s filter, 0.3s transform;
  filter: saturate(92%);
}

.gallery-card .meta {
  flex: 1 1 auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
}

.gallery-card h2 {
  font-size: 1rem;
  margin: 0 0 6px;
  font-weight: 600;
  line-height: 1.25;
}

.gallery-card .summary {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.3;
  flex: 0 0 auto;
}

.gallery-card .tags {
  margin-top: auto;
}

.gallery-card .tag {
  font-size: 0.55rem;
  padding: 3px 6px 2px;
  margin: 0 4px 4px 0;
}

.gallery-card:hover .cover {
  filter: saturate(105%) brightness(1.02);
  transform: scale(1.015);
}

/* Notion-like page icon */
.page-icon {
  font-size: 3rem;
  line-height: 1;
  margin: 0 0 12px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Overlapping page icon (Notion-style) */
.page-cover {
  position: relative;
}

.page-icon.overlap {
  position: absolute;
  bottom: -36px; /* slightly less downward overlap to compensate for bigger size */
  /* Positioned 5% from the left edge for requested horizontal shift */
  left: 5%;
  font-size: 72px; /* increased size */
  line-height: 1;
  margin: 0;
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Align in split layout with same 5% base (can customize separately if needed) */
body.home-split .page-icon.overlap {
  left: 5%;
}

body.has-icon .page {
  padding-top: 78px;
} /* tighter spacing below icon */
/* Home split layout */
body.home-split .page {
  max-width: none;
  padding: 0;
}

body.home-split .home-split__wrap {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 120px); /* minus approx cover+footer */
}

body.home-split .home-split__left {
  flex: 0 0 40%;
  max-width: 600px;
  padding: 48px clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

body.home-split .home-split__intro {
  max-width: 460px;
}

body.home-split .home-split__intro h1 {
  margin-top: 0;
  font-size: 2.4rem;
}

body.home-split .home-split__intro .lead {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.45;
}

body.home-split .home-split__right {
  flex: 1 1 auto;
  padding: 48px clamp(24px, 4vw, 56px) 56px;
  overflow: auto;
}

body.home-split .gallery-grid {
  margin: 0;
}

@media (max-width: 1100px) {
  body.home-split .home-split__wrap {
    flex-direction: column;
  }
  body.home-split .home-split__left, body.home-split .home-split__right {
    flex: 1 1 auto;
    max-width: none;
    padding: 32px clamp(20px, 5vw, 40px);
  }
  body.home-split .home-split__left {
    border-bottom: 1px solid var(--border);
  }
}
/* Repo hover preview */
.repo-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 80;
  display: block;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.48s cubic-bezier(0.4, 0.2, 0.2, 1), background 0.48s ease;
}

.repo-preview.hidden {
  display: none;
}

.repo-preview.visible {
  opacity: 1;
  pointer-events: auto;
}

.repo-preview__inner {
  width: 420px;
  height: 340px;
  position: absolute;
  left: var(--popup-x, 50vw);
  top: var(--popup-y, 30vh);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 8px 32px -6px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(0) scale(0.92);
  will-change: transform, opacity, filter;
  transition: left 0.18s cubic-bezier(0.4, 0.2, 0.2, 1), top 0.18s cubic-bezier(0.4, 0.2, 0.2, 1), opacity 0.3s, transform 0.3s;
}

.repo-preview.visible .repo-preview__inner {
  opacity: 1;
  transform: translateY(-8px) scale(1);
  animation: none;
}

.repo-preview.closing .repo-preview__inner {
  animation: popupOut 0.24s cubic-bezier(0.4, 0.1, 0.3, 1) forwards;
}

@keyframes popupIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.9);
    filter: blur(5px) saturate(140%);
  }
  55% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
    filter: blur(0) saturate(110%);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) saturate(100%);
  }
}
@keyframes popupOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(14px) scale(0.95);
    filter: blur(3px);
  }
}
.repo-preview.expanded .repo-preview__inner {
  width: min(1440px, 96vw);
  height: min(90vh, 900px);
}

.repo-preview iframe {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

.repo-preview__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg);
}

.repo-preview-md {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 24px 28px 48px;
  display: none;
}

.repo-preview-md h1 {
  font-size: 1.1rem;
  margin-top: 0;
}

.repo-preview-md pre {
  font-size: 0.7rem;
}

.repo-preview-md code {
  font-size: 0.7rem;
}

.repo-preview.show-md #repo-preview-frame {
  display: none;
}

.repo-preview.show-md .repo-preview-md {
  display: block;
}

.repo-preview.loading #repo-preview-frame {
  opacity: 0;
}

.repo-preview.loading .repo-preview__loader {
  opacity: 1;
}

.repo-preview:not(.loading) .repo-preview__loader {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .repo-preview__inner {
    background: #161817;
  }
}
/* Smooth content switching */
.repo-preview iframe, .repo-preview .repo-preview-md {
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.repo-preview.switching iframe, .repo-preview.switching .repo-preview-md {
  opacity: 0 !important;
  transform: translateY(8px) scale(0.985);
  filter: blur(2px);
}

.repo-preview.switching .repo-preview__loader {
  display: flex;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .repo-preview iframe, .repo-preview .repo-preview-md {
    transition: none;
  }
}
/* Expand button */
.repo-preview__expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  background: var(--bg);
  color: #777;
  border: 1px solid var(--border);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.25);
  font-weight: 500;
  backdrop-filter: blur(4px) saturate(180%);
  transition: background 0.25s, color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.repo-preview__expand:hover {
  color: var(--text);
  box-shadow: 0 6px 22px -6px rgba(0, 0, 0, 0.35);
}

.repo-preview__expand:active {
  transform: scale(0.9);
}

.repo-preview.expanded .repo-preview__expand {
  background: var(--bg-alt);
}

/* Project tabs */
.project-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--border);
}

.project-tab {
  background: transparent;
  border: 0;
  padding: 10px 16px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  border-radius: 8px 8px 0 0;
}

.project-tab.active {
  color: var(--text);
  background: var(--bg-alt);
}

.project-tab:not(.active):hover {
  color: var(--text);
  background: var(--bg-alt);
}

.project-panels {
  border: 1px solid var(--border);
  border-radius: 0 10px 10px 10px;
  padding: 28px 30px;
  background: var(--bg-alt);
  margin-bottom: 40px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* README styling override */
.project-readme h2 {
  margin-top: 0;
}

/* Document navigation */
.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
}

.doc-nav-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font: inherit;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-dim);
}

.doc-nav-btn.active, .doc-nav-btn:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}

.project-doc:not(:first-of-type) {
  display: none;
}

.doc-title {
  font-size: 1rem;
  margin: 0 0 12px;
  font-weight: 600;
}

.doc-viewer-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.doc-viewer-wrap object {
  display: block;
}
