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

:root {
  --sidebar-width: 240px;
  --bg: #ffffff;
  --text: #333333;
  --muted: #777777;
  --accent: #1a1a1a;
  --border: #e8e8e8;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --sidebar-bg: #fafafa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a2e;
    --text: #b0b0b0;
    --muted: #888888;
    --accent: #e0e0e0;
    --border: #333333;
    --link: #6aaddb;
    --link-hover: #90c8ed;
    --sidebar-bg: #12121f;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.site {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 44px 28px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-logo {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.site-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.site-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.4;
}

nav.site-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: auto;
}

nav.site-nav a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s;
}

nav.site-nav a:hover {
  color: var(--accent);
}

nav.site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.sidebar-social {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-social a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.sidebar-social a:hover {
  color: var(--link);
}

/* Main content */
.content {
  flex: 1;
  min-width: 0;
  padding: 52px 56px;
}

.content-inner {
  max-width: 820px;
  margin: 0 auto;
}

/* Typography */
h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 36px 0 12px;
}

h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin: 28px 0 10px;
}

h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 24px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p { margin-bottom: 16px; }

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

ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

li { margin-bottom: 6px; }

/* Portfolio card grid */
.portfolio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 32px;
}

.portfolio-card {
  width: 160px;
}

.portfolio-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--border);
  transition: opacity 0.15s;
}

.portfolio-card img:hover {
  opacity: 0.85;
}

.portfolio-card p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text);
}

.portfolio-card a {
  text-decoration: none;
  color: var(--text);
}

.portfolio-card a:hover {
  color: var(--link);
}

/* Maps grid */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin: 24px 0;
}

.map-item {
  display: flex;
  flex-direction: column;
}

.map-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.map-item img:hover {
  opacity: 0.9;
}

.map-item h3 {
  margin: 10px 0 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.map-item p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 3px;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 22px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Home page */
.home-intro {
  max-width: 520px;
  padding-top: 8px;
}

.home-intro h1 {
  font-size: 1.7rem;
  margin-bottom: 18px;
}

.home-intro p {
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 14px;
}

/* Blog list */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 24px;
}

.post-list-item {
  display: flex;
  flex-direction: column;
}

.post-list-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.post-list-title:hover {
  color: var(--link);
}

.post-list-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.post-list-excerpt {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.6;
}

/* Single post */
.post {
  max-width: 660px;
}

.post-back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
}

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

.post-title {
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.post-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.post-content {
  line-height: 1.75;
}

.post-content p {
  margin-bottom: 18px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-img-right,
.post-img-left {
  width: 46%;
  max-width: 320px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.post-img-right {
  float: right;
  margin-left: 22px;
}

.post-img-left {
  float: left;
  margin-right: 22px;
}

.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 16px;
  color: var(--muted);
  margin: 0 0 18px;
}

/* Responsive */
@media (max-width: 768px) {
  .site {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    flex: none;
    height: auto;
    padding: 20px 20px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .site-tagline {
    display: none;
  }

  nav.site-nav {
    flex-direction: row;
    gap: 20px;
    margin-bottom: 0;
  }

  .sidebar-social {
    display: none;
  }

  .content {
    padding: 28px 20px;
  }

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

  .portfolio-card {
    width: calc(50% - 7px);
  }

  .post-img-right,
  .post-img-left {
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 18px;
  }
}
