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

:root {
  --sidebar-w: 240px;
  --bottom-h: 0px;
  --fg: #1a1a1a;
  --fg-muted: #aaa;
  --bg: #fff;
  --accent: #7B2040;
  --font: 'Times New Roman', Times, serif;
  --font-size: 14px;
  --font-letter: 0.02em;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--font-size);
  font-weight: 300;
  letter-spacing: var(--font-letter);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; font-weight: inherit; letter-spacing: inherit; color: inherit; padding: 0; }
ul { list-style: none; }

/* ── Landing Page ─────────────────────────────── */
#landing {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1s ease;
}

#landing.exit {
  opacity: 0;
  pointer-events: none;
}

#landing-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1.6s ease;
}

#landing.loaded #landing-img {
  opacity: 1;
}

#landing-name {
  position: absolute;
  top: 60%;
  left: 40%;
  color: #fff;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  white-space: nowrap;
}

#landing-first,
#landing-last {
  display: inline;
  opacity: 0;
  transition: opacity 0.9s ease;
}

/* ── Custom Cursor ────────────────────────────── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(14px, -50%);
  transition: opacity 0.12s;
  color: var(--fg);
}

body.cursor-active .cursor { opacity: 1; }
body.cursor-active { cursor: none; }

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: calc(100% - var(--bottom-h));
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  z-index: 100;
}

.sidebar-name {
  font-family: 'LTC Goudy Oldstyle Pro', 'Cormorant Garamond', Georgia, serif;
  font-size: 23px;
  letter-spacing: 0.07em;
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: 24px;
  color: var(--fg);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-social {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 16px;
}

.sidebar-social a {
  color: var(--fg-muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

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

.nav-link {
  display: block;
  padding: 3px 0;
  color: var(--fg-muted);
  transition: color 0.15s;
  font-size: 15px;
  font-weight: 400;
}

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

.projects-arrow {
  display: inline-block;
  margin-left: 3px;
  transition: transform 0.2s ease;
  font-style: normal;
}

.projects-toggle.open .projects-arrow {
  transform: rotate(90deg);
}

.project-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.projects-toggle.open .project-list {
  max-height: 600px;
  margin-top: 2px;
}

.project-list li a {
  display: block;
  padding: 3px 0;
  color: var(--fg-muted);
  font-size: 15px;
  font-weight: 400;
  transition: color 0.15s;
}

.project-list li a:hover,
.project-list li a.active {
  color: var(--fg);
}

/* ── Photo Controls (sinistra, sopra il fondo) ── */
.photo-controls {
  position: fixed;
  left: 24px;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  z-index: 200;
}

.photo-controls-social {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.photo-controls-social a {
  color: var(--fg-muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.photo-controls-social a:hover { color: var(--fg); }

.photo-controls-nav {
  display: flex;
  align-items: center;
}

.btn-view {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 400;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

.btn-view:hover,
.btn-view.active {
  color: var(--fg);
}

.sep { color: var(--fg-muted); font-weight: 300; }

/* ── Viewer ───────────────────────────────────── */
.viewer {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: var(--bottom-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
}

.photo-img {
  display: block;
  max-width: 53vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  transition: opacity 0.25s ease;
}

.photo-img.fading { opacity: 0; }

.photo-label { display: none; }

/* ── Overlay (Index / Thumbs) ─────────────────── */
.overlay {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: var(--bottom-h);
  background: var(--bg);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overflow-y: auto;
}

.overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.overlay-inner {
  padding: 32px 40px;
}

/* Index list */
.index-list {
  display: flex;
  flex-direction: column;
}

.index-list li {
  border-top: 1px solid #ebebeb;
}

.index-list li:last-child {
  border-bottom: 1px solid #ebebeb;
}

.index-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.index-item:hover { opacity: 0.4; }

.index-item-title {
  font-size: 15px;
  font-weight: 400;
}

.index-item-count {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 300;
}

/* Thumbs grid — masonry columns */
.thumbs-grid {
  columns: 7;
  column-gap: 4px;
}

.thumb-item {
  break-inside: avoid;
  margin-bottom: 4px;
  cursor: pointer;
  display: block;
}

.thumb-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s;
}

.thumb-item:hover img { opacity: 0.6; }

/* ── About page ───────────────────────────────── */
.about-page {
  overflow: auto;
}

.about-main {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: var(--bottom-h);
  display: flex;
  align-items: center;
  padding: 48px;
}

.about-layout {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.about-photo {
  flex-shrink: 0;
}

.about-photo img {
  height: 65vh;
  width: auto;
  display: block;
  object-fit: cover;
}

.about-content {
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-content p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--fg);
  font-weight: 400;
}

.about-content a {
  border-bottom: 1px solid var(--fg-muted);
  transition: border-color 0.15s;
}

.about-content a:hover {
  border-color: var(--fg);
}

.about-copyright {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 400;
}
