:root {
  --warm-white: #faf8f5;
  --sand: #c4b5a2;
  --charcoal: #434343;
  --speckle: #8b7355;
  --stone: #d4cdc4;
  --clay: #b8a99a;
  --deep-white: #f2eeea;
  --sidebar-width: 360px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--warm-white);
  color: var(--charcoal);
  font-family: 'Josefin Sans', sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Grain overlay ─── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  z-index: 9999;
}

/* ─── Layout ─── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem 2.5rem;
  text-align: center;
  opacity: 0.005;
  animation: breatheIn 1.8s cubic-bezier(0.25, 0, 0.15, 1) 0.3s forwards;
}

/* ─── Logo ─── */
.sidebar-logo {
  display: flex;
  justify-content: center;
}

.logo-svg {
  width: 130px;
  height: 130px;
}

/* ─── About ─── */
.sidebar-about p {
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--charcoal);
  letter-spacing: 0.01em;
}

.sidebar-about p + p {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #6b6560;
}

.sidebar-about p em {
  font-style: italic;
}

/* ─── Links ─── */
.sidebar-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1.5rem;
  border: 1px solid var(--stone);
  background: transparent;
  color: var(--charcoal);
  text-decoration: none;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  transition: all 0.6s cubic-bezier(0.25, 0, 0.15, 1);
  position: relative;
}

.link-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--charcoal);
  transition: all 0.6s cubic-bezier(0.25, 0, 0.15, 1);
  transform: translateX(-50%);
}

.link-btn:hover {
  border-color: var(--charcoal);
  letter-spacing: 0.24em;
}

.link-btn:hover::before {
  width: 100%;
}

.link-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

.link-btn:hover svg {
  opacity: 1;
}

/* ─── Social icons (icon-only) ─── */
.social-icons {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--stone);
  color: var(--charcoal);
  text-decoration: none;
  transition: all 0.6s cubic-bezier(0.25, 0, 0.15, 1);
  position: relative;
}

.icon-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--charcoal);
  transition: all 0.6s cubic-bezier(0.25, 0, 0.15, 1);
  transform: translateX(-50%);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

.icon-btn:hover {
  border-color: var(--charcoal);
}

.icon-btn:hover::before {
  width: 100%;
}

.icon-btn:hover svg {
  opacity: 1;
}

/* ─── Contact ─── */
.sidebar-contact a {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--charcoal);
  text-decoration: none;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: all 0.5s ease;
}

.sidebar-contact a:hover {
  color: var(--charcoal);
  border-bottom-color: var(--stone);
}

/* ─── Footer ─── */
.sidebar-footer small {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: #736b68;
}

/* ─── Gallery (main content) ─── */
.gallery {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 100vh;
  opacity: 0.005;
  animation: breatheIn 2s cubic-bezier(0.25, 0, 0.15, 1) 0.8s forwards;
}

.gallery-item {
  overflow: hidden;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.02);
  transition: transform 6s cubic-bezier(0.25, 0, 0.15, 1), filter 2s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
  filter: saturate(1) contrast(1.02);
}

/* ─── Screen reader only ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Animations ─── */
@keyframes breatheIn {
  0% {
    opacity: 0.005;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive: tablet ─── */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 280px;
  }

  .logo-svg {
    width: 100px;
    height: 100px;
  }

  .sidebar-about p {
    font-size: 0.75rem;
  }

  .sidebar-about p + p {
    font-size: 0.8rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

/* ─── Responsive: mobile ─── */
@media (max-width: 640px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .sidebar-inner {
    padding: 2.5rem 2rem 1.5rem;
    gap: 1rem;
  }

  .sidebar-about {
    display: none;
  }

  .sidebar-contact {
    display: none;
  }

  .logo-svg {
    width: 110px;
    height: 110px;
  }

  .sidebar-links {
    flex-direction: row;
    gap: 0.75rem;
  }

  .gallery {
    margin-left: 0;
    grid-template-columns: 1fr;
    gap: 0;
    animation-delay: 0.1s;
  }

  .gallery-item {
    aspect-ratio: 4 / 5;
  }
}
