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

/* ── Variables ─────────────────────────────────────── */
:root {
  --black: #000;
  --white: #fff;
  --gray: #888;
  --light: #f0f0f0;
  --accent: #0038ff;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
  --sans: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --border: 2px solid var(--black);
  --gap: clamp(1rem, 3vw, 2rem);
}

/* ── Base ──────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--black); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

/* ── Header ────────────────────────────────────────── */
header {
  border-bottom: var(--border);
  padding: var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 100;
}
.logo {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
nav { display: flex; gap: clamp(0.8rem, 2vw, 2rem); align-items: center; }
nav a {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}
nav a:hover, nav a.active { border-bottom-color: var(--black); color: var(--black); }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--black); margin: 5px 0; transition: 0.2s; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  nav {
    position: fixed; top: 0; right: -100%; width: 70vw; height: 100vh;
    background: var(--white); flex-direction: column; justify-content: center;
    align-items: center; gap: 2rem; border-left: var(--border);
    transition: right 0.3s;
  }
  nav.open { right: 0; }
  nav a { font-size: 1.1rem; }
}

/* ── Main ──────────────────────────────────────────── */
main { flex: 1; }

/* ── Footer ────────────────────────────────────────── */
footer {
  border-top: var(--border);
  padding: var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
}
footer a { color: var(--gray); }
footer a:hover { color: var(--black); }

/* ── Home ──────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 80px);
}
@media (max-width: 768px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 50vh;
  border-right: var(--border);
}
.home-tile:last-child { border-right: none; }
@media (max-width: 768px) {
  .home-tile { border-right: none; border-bottom: var(--border); }
  .home-tile:last-child { border-bottom: none; }
}
.home-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.home-tile:hover img { transform: scale(1.03); }
.home-tile .overlay {
  position: relative;
  z-index: 2;
  padding: var(--gap);
  width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--white);
}
.home-tile .overlay span {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.7;
}
.home-tile .overlay h2 {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  margin-top: 0.3rem;
}

/* ── Photography ───────────────────────────────────── */
.gallery {
  column-count: 3;
  column-gap: 0;
  padding: 0;
}
@media (max-width: 1024px) { .gallery { column-count: 2; } }
@media (max-width: 600px) { .gallery { column-count: 1; } }
.gallery-item {
  break-inside: avoid;
  border-bottom: var(--border);
  border-right: var(--border);
  cursor: pointer;
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: opacity 0.3s;
}
.gallery-item:hover img { opacity: 0.85; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  font-family: var(--mono);
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ── Blog ──────────────────────────────────────────── */
.blog-list { max-width: 800px; margin: 0 auto; padding: var(--gap); }
.blog-entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--light);
}
.blog-entry:first-child { padding-top: 0; }
.blog-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
}
.blog-entry h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 900;
  margin: 0.3rem 0 0.5rem;
  line-height: 1.2;
}
.blog-entry h2 a:hover { color: var(--accent); }
.blog-entry p { color: #444; line-height: 1.7; }
.page-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  padding: var(--gap);
  border-bottom: var(--border);
  line-height: 1.1;
}

/* ── Post ──────────────────────────────────────────── */
.post { max-width: 800px; margin: 0 auto; padding: var(--gap); }
.post-header { margin-bottom: 2rem; }
.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.post-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.post-content h2 { font-size: 1.5rem; font-weight: 800; margin: 2rem 0 0.8rem; }
.post-content h3 { font-size: 1.2rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.post-content p { margin: 0.8rem 0; line-height: 1.8; }
.post-content ul, .post-content ol { margin: 0.8rem 0; padding-left: 1.5rem; }
.post-content li { margin: 0.3rem 0; line-height: 1.7; }
.post-content blockquote {
  border-left: 4px solid var(--black);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  font-style: italic;
  background: var(--light);
}
.post-content a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.post-content a:hover { opacity: 0.7; }
.post-content code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--light);
  padding: 0.15em 0.4em;
}
.post-content pre {
  background: var(--black);
  color: var(--white);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
}
.post-content pre code { background: none; color: inherit; padding: 0; }

/* ── Page (books, links) ──────────────────────────── */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--gap);
}
.page-content h2 { font-size: 1.4rem; font-weight: 800; margin: 2rem 0 0.5rem; border-bottom: 1px solid var(--light); padding-bottom: 0.3rem; }
.page-content h3 { font-size: 1.1rem; font-weight: 700; margin: 1.2rem 0 0.3rem; }
.page-content ul { list-style: none; padding: 0; }
.page-content li { padding: 0.3rem 0; }
.page-content li::before { content: '→ '; font-family: var(--mono); color: var(--gray); }
.page-content a { color: var(--accent); }
.page-content a:hover { border-bottom: 1px solid var(--accent); }
.page-content p { margin: 0.8rem 0; line-height: 1.7; }

/* ── About ─────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }
.about-text { padding: calc(var(--gap) * 2); }
.about-text h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}
.about-text p { line-height: 1.8; margin-bottom: 1rem; }
.about-text a { color: var(--accent); border-bottom: 1px solid transparent; }
.about-text a:hover { border-bottom-color: var(--accent); }
.contact-form {
  padding: calc(var(--gap) * 2);
  border-left: var(--border);
  background: var(--light);
}
@media (max-width: 768px) {
  .contact-form { border-left: none; border-top: var(--border); }
}
.contact-form h2 {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}
.contact-form label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  margin-top: 1rem;
}
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: var(--border);
  background: var(--white);
  font-family: var(--sans);
  font-size: 1rem;
  outline: none;
}
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--accent);
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form button {
  margin-top: 1.5rem;
  padding: 0.8rem 2rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s;
}
.contact-form button:hover { background: var(--accent); }
.sent-message {
  background: var(--black);
  color: var(--white);
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ── Pagination ────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem var(--gap);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.pagination a {
  padding: 0.5rem 1rem;
  border: var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pagination a:hover { background: var(--black); color: var(--white); }

/* ── 404 ───────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  font-family: var(--mono);
  text-align: center;
}
.error-page h1 { font-size: clamp(5rem, 15vw, 12rem); font-weight: 900; line-height: 1; }
.error-page p { font-size: 1rem; color: var(--gray); margin-top: 0.5rem; }
