:root {
  color-scheme: light;
  --bg: #fff; --fg: #222; --fg-strong: #000; --fg-muted: #444; --fg-soft: #666; --fg-faint: #999;
  --border: #ccc; --line: #e6e6e6; --input-bg: #fafafa; --overlay: rgba(255,255,255,.97); --shadow: rgba(0,0,0,.08); --error: #b00020;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --fg: #e4e4e4; --fg-strong: #fff; --fg-muted: #c2c2c2; --fg-soft: #a6a6a6; --fg-faint: #8a8a8a;
  --border: #444; --line: #2c2c2c; --input-bg: #1c1c1c; --overlay: rgba(12,12,12,.97); --shadow: rgba(0,0,0,.6); --error: #ff7a8a;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: 'Abel', 'Helvetica Neue', Arial, sans-serif; font-size: 16px; line-height: 1.7; letter-spacing: .06em;
}
a { color: var(--fg); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-weight: 400; letter-spacing: .12em; line-height: 1.4; }
h1 { font-size: 25px; letter-spacing: 3px; }
h2 { font-size: 20px; }
.center { text-align: center; }
.button, button.button {
  display: inline-block; border: 1px solid var(--fg); background: var(--bg); color: var(--fg); padding: .7em 1.6em;
  font: inherit; letter-spacing: .15em; text-transform: uppercase; font-size: 13px; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--fg); color: var(--bg); }

/* Header */
.site-header {
  display: flex; align-items: center; gap: 1.5rem 2rem;
  padding: 50px 60px 30px; max-width: 1600px; margin: 0 auto;
}
.brand { margin-right: auto; display: flex; flex-direction: column; gap: 4px; }
.site-title { font-size: 25px; letter-spacing: 3px; text-decoration: none; }
.site-tagline { font-size: 12px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .2em; }
.site-nav { display: flex; align-items: center; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; }
.nav-list a, .folder-toggle {
  color: var(--fg-muted); text-decoration: none; font: inherit; letter-spacing: .1em; background: none; border: 0; padding: 0; cursor: pointer;
}
.nav-list a:hover, .nav-list a.active, .folder-toggle:hover, .folder.has-active > .folder-toggle { color: var(--fg-strong); border-bottom: 1px solid currentColor; }
.folder { position: relative; }
.subnav {
  display: none; position: absolute; right: 0; top: 100%; z-index: 20; list-style: none; margin: 0; padding: 12px 18px;
  background: var(--bg); box-shadow: 0 6px 20px var(--shadow); min-width: 220px; text-align: right;
}
.subnav li { padding: 3px 0; white-space: nowrap; }
.folder:hover > .subnav, .folder:focus-within > .subnav, .folder.open > .subnav { display: block; }
.subnav > .folder > .subnav { top: 0; right: 100%; }
.subnav > .folder > .folder-toggle { width: 100%; text-align: right; }
.nav-social { display: none; }
.menu-toggle { display: none; }

/* Content */
.content { max-width: 1500px; margin: 0 auto; padding: 10px 60px 60px; }
.content.narrow { max-width: 900px; }
.page-title { text-align: center; margin: 10px 0 20px; }
.page-description { max-width: 800px; margin: 0 auto 40px; text-align: center; }
.block { margin: 0 0 40px; }
.block-text { max-width: 900px; margin-left: auto; margin-right: auto; }
.block-text img { margin: 1em auto; }
.block-image { margin-left: 0; margin-right: 0; }
.block-image img { width: 100%; cursor: zoom-in; }
.block-image a img { cursor: pointer; }
figcaption { text-align: center; font-size: 14px; color: var(--fg-soft); margin-top: 10px; }
.block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.block-gallery figure { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; }
.block-gallery img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: opacity .2s; }
.block-gallery img:hover { opacity: .85; }
.video-frame { position: relative; padding-top: 56.25%; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
hr.block { border: 0; border-top: 1px solid var(--line); max-width: 900px; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 40px; }
.index-item { text-decoration: none; text-align: center; }
.index-item img { aspect-ratio: 3/2; object-fit: cover; width: 100%; margin-bottom: 8px; }
.admin-edit { text-align: center; }

/* Contact */
.block-contact { max-width: 640px; margin-left: auto; margin-right: auto; }
.contact-form label { display: block; margin-bottom: 18px; font-size: 14px; }
.contact-form .req { color: var(--fg-faint); font-size: 12px; }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; border: 1px solid var(--border); background: var(--input-bg);
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-success { text-align: center; font-size: 20px; padding: 40px 0; }
.form-error { color: var(--error); }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 30px; }
.post-card img { aspect-ratio: 3/2; object-fit: cover; width: 100%; margin-bottom: 14px; }
.post-card time, .post-header time { font-size: 13px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .15em; }
.post-card h2 { margin: 6px 0 10px; font-size: 20px; }
.post-card h2 a { text-decoration: none; }
.read-more { white-space: nowrap; }
.post-header { text-align: center; margin-bottom: 30px; }
.tags { font-size: 14px; color: var(--fg-soft); }
.post-nav, .pagination { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 40px; }
.post-nav a, .pagination a { text-decoration: none; }

/* Footer */
.site-footer { text-align: center; padding: 40px 20px 60px; font-size: 13px; color: var(--fg-soft); }
.footer-social { display: flex; justify-content: center; gap: 12px; margin-bottom: 10px; }
.social-icon { display: inline-flex; width: 34px; height: 34px; color: inherit; }
.social-icon svg { width: 100%; height: 100%; padding: 6px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 85vh; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; font-size: 46px; color: var(--fg); cursor: pointer; padding: 10px 20px; line-height: 1; }
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

/* Homepage splash */
body.home { background: #111; color: #fff; overflow: hidden; }
.slideshow { position: fixed; inset: 0; }
.slideshow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.5s ease; }
.slideshow img.active { opacity: 1; }
.slideshow::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.25); }
.splash {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 20px; font-family: 'Roboto', sans-serif;
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
.splash h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 500; letter-spacing: .02em; margin: 0 0 8px; }
.splash-subtitle { font-size: clamp(16px, 2vw, 22px); margin: 0 0 20px; letter-spacing: .04em; }
.splash-social { display: flex; gap: 12px; margin-bottom: 26px; }
.splash-social .social-icon { width: 40px; height: 40px; border: 1.5px solid #fff; border-radius: 50%; color: #fff; }
.splash-buttons { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.splash-button {
  background: #fff; color: #222; text-decoration: none; padding: 14px 30px; font-size: 14px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; text-shadow: none; transition: background .2s;
}
.splash-button:hover { background: #e8e8e8; }
.splash-admin { position: fixed; z-index: 2; right: 16px; bottom: 12px; color: #fff; font-size: 13px; }


/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  background: none; border: 1px solid var(--border); border-radius: 50%; color: var(--fg); cursor: pointer; padding: 0;
  position: relative; z-index: 60; transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--fg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
/* Homepage menu: the site header laid over the slideshow, always light-on-dark */
body.home .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 3; max-width: none; padding: 28px 40px; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
body.home .brand { visibility: hidden; }
body.home .nav-list a, body.home .folder-toggle { color: rgba(255,255,255,.88); }
body.home .nav-list a:hover, body.home .folder-toggle:hover { color: #fff; }
body.home .subnav { background: rgba(17,17,17,.88); box-shadow: none; }
body.home .theme-toggle { color: #fff; border-color: rgba(255,255,255,.6); }
body.home .theme-toggle:hover { border-color: #fff; }
body, .site-nav, .subnav { transition: background-color .25s, color .25s; }

/* Mobile */
@media (max-width: 900px) {
  .site-header { padding: 24px 20px; align-items: center; }
  .content { padding: 10px 16px 40px; }
  .menu-toggle {
    display: flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; z-index: 60;
  }
  .menu-toggle span { display: block; width: 26px; height: 2px; background: var(--fg); transition: transform .2s, opacity .2s; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    display: none; position: fixed; inset: 0; z-index: 50; background: var(--bg); padding: 90px 30px 30px;
    overflow-y: auto; align-items: center; gap: 24px;
  }
  .menu-open .site-nav { display: flex; }
  .nav-list { flex-direction: column; align-items: center; font-size: 20px; gap: 14px; }
  .folder:hover > .subnav { display: none; }
  .folder.open > .subnav { display: block; }
  .subnav { position: static; box-shadow: none; text-align: center; padding: 8px 0 0; font-size: 16px; }
  .subnav > .folder > .subnav { padding-top: 6px; }
  .subnav > .folder > .folder-toggle { text-align: center; }
  .nav-social { display: flex; gap: 10px; }
  .block { margin-bottom: 24px; }
  body.home .site-header { padding: 20px; }
  body.home .menu-toggle span { background: #fff; }
  body.home .site-nav { background: rgba(17,17,17,.96); }
  body.home .subnav { background: none; }
}
