:root {
  --bg: #f7f5f1;
  --fg: #14130f;
  --muted: #7c786f;
  --line: rgba(20, 19, 15, 0.12);
  --shade: rgba(20, 19, 15, 0.04);
  --scrim: rgba(247, 245, 241, 0.94);
  --glass: rgba(247, 245, 241, 0.72);
  --frame: #ffffff;
  --logo-invert: 0;
  --accent: #c98a4b;
}

[data-theme="dark"] {
  --bg: #0b0b0c;
  --fg: #f5f3ef;
  --muted: #a8a6a2;
  --line: rgba(245, 243, 239, 0.16);
  --shade: rgba(245, 243, 239, 0.05);
  --scrim: rgba(11, 11, 12, 0.94);
  --glass: rgba(11, 11, 12, 0.66);
  --frame: #ffffff;
  --logo-invert: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  height: 100%;
}

body {
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

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

button {
  font-family: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  transition: background 400ms ease, color 400ms ease;
}

/* Sidebar */

.sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 300px;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 36px 40px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  transition: inset 500ms cubic-bezier(0.22, 0.61, 0.36, 1), border-radius 500ms ease,
    box-shadow 500ms ease, background 400ms ease;
}

.sidebar.is-floating {
  inset: 18px auto 18px 18px;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.logo-link {
  display: block;
  width: 46px;
}

.logo-link img {
  width: 46px;
  height: auto;
  display: block;
  filter: invert(var(--logo-invert));
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav a {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 200ms ease;
}

.nav a.active,
.nav a:hover {
  color: var(--fg);
}

.sub-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.sub-links a {
  font-size: 13px;
  color: var(--muted);
}

.sub-links a.active,
.sub-links a:hover {
  color: var(--fg);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.sidebar-footer .socials {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.sidebar-footer a {
  color: var(--muted);
}

.sidebar-footer a:hover {
  color: var(--fg);
}

/* Main column */

.main {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.text-view[hidden],
.gallery-view[hidden] {
  display: none;
}

.topbar {
  flex: none;
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 32px 48px 16px;
}

.theme-toggle {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* Text views (About / Contact) */

.text-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 48px 96px 348px;
  max-width: 968px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.text-view h1 {
  margin: 0 0 6px;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.01em;
}

.text-view .lede {
  margin: 0 0 10px;
  max-width: 560px;
  font-family: "DM Serif Display", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.4;
  color: var(--fg);
}

.text-view p.body {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

/* Gallery view */

.gallery-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.strip {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 48px 24px 348px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.frame {
  margin: 0;
  flex: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-snap-align: center;
  animation: fadeUp 700ms ease both;
}

.frame img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  background: var(--shade);
  cursor: zoom-in;
  min-height: 0;
  flex: 1;
  border: 10px solid var(--frame);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.14);
}

.frame figcaption {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.strip-spacer {
  flex: none;
  width: 8px;
  height: 100%;
}

.strip-controls {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 48px 32px 348px;
}

.strip-controls button {
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
}

.strip-controls button:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.strip-controls .hint {
  margin-left: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  cursor: zoom-out;
  animation: fadeUp 300ms ease both;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox[hidden] {
  display: none;
}

/* Small screens: sidebar becomes a top bar, strip clears it from the top instead of the left */

@media (max-width: 720px) {
  .sidebar {
    width: auto;
    inset: 0 0 auto 0 !important;
    max-height: 46vh;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .text-view,
  .strip,
  .strip-controls {
    padding-left: 24px;
    padding-right: 24px;
  }
  .text-view {
    padding-top: 24px;
  }
  .main {
    padding-top: 46vh;
  }
  .topbar {
    position: absolute;
    top: 0;
    right: 0;
    padding: 16px 20px;
  }
}
