:root {
  --bg: #fafafa;
  --text: #111111;
  --muted: #555555;
  --border: #e2e2e2;
  --code-bg: #f0f0f0;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.home-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.home-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5rem;
  max-width: 960px;
  width: 100%;
}

.home-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-domain {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.nav-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  transform: translateX(4px);
}

.home-photo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 460px;
  max-width: 100%;
  flex-shrink: 0;
}

.home-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 460px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.home-photo.is-loaded {
  opacity: 1;
}

.page-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.page-header-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 0;
}

.gallery-wrapper {
  width: 100%;
  padding: 0 2.5rem 6rem;
}

.sub-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.sub-header .brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.sub-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.sub-header nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.sub-header nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sub-header nav a.active::before {
  content: "\2192\00a0";
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.post-item a {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.post-item a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

article h2, .prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 0.75rem;
}

article h3, .prose h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}

article p, .prose p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

article ul, article ol, .prose ul, .prose ol {
  margin: 0 0 1.25rem 1.5rem;
  font-size: 1.05rem;
}

article li, .prose li {
  margin-bottom: 0.4rem;
}

article blockquote, .prose blockquote {
  border-left: 3px solid var(--text);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
}

article code, .prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

article pre, .prose pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

article pre code, .prose pre code {
  background: none;
  padding: 0;
}

article img, .prose img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.prose a, article a {
  color: var(--text);
  font-weight: 600;
  text-underline-offset: 3px;
}

.back-link {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link a {
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

.pdf-frame {
  width: 100%;
  height: 820px;
  border: 1px solid var(--border);
  margin-top: 1.25rem;
  background: #ffffff;
}

.gallery-grid {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
}

.gallery-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  background-color: #eaeaea;
}

.gallery-item figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

dialog.lightbox {
  border: none;
  padding: 0;
  margin: auto;
  width: min(80vw, 860px);
  height: 76dvh;
  max-width: 80vw;
  max-height: 76dvh;
  background: transparent;
  overflow: visible;
  cursor: pointer;
}

dialog.lightbox[open] {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

dialog.lightbox::backdrop {
  background: rgba(17, 17, 17, 0.86);
  cursor: pointer;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  cursor: default;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  flex-shrink: 0;
  color: #fafafa;
  font-size: 0.9rem;
  cursor: default;
}

.lightbox-controls {
  display: flex;
  gap: 0.75rem;
}

.lightbox-controls button {
  background: none;
  border: 1px solid rgba(250, 250, 250, 0.4);
  color: #fafafa;
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
}

.lightbox-controls button:hover {
  background: rgba(250, 250, 250, 0.15);
}

@media (max-width: 820px) {
  .home-container {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 2.5rem;
    max-width: 480px;
  }

  .home-photo-link {
    width: 100%;
    align-self: center;
  }

  .home-photo {
    max-height: 380px;
  }

  .post-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .pdf-frame {
    height: 560px;
  }
}

@media (max-width: 600px) {
  .gallery-wrapper {
    padding: 0 1.5rem 6rem;
  }

  dialog.lightbox {
    width: 84vw;
    height: 68dvh;
    max-width: 84vw;
    max-height: 68dvh;
  }
}

.lightbox-stage {
  touch-action: pan-y;
}

html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}
