/* 1) Self-hosted Bahnschrift */
@font-face {
  font-family: 'Bahnschrift';
  src: url('fonts/Bahnschrift.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* 2) Variables & Reset */
:root {
  --bg-color: #f5f5f5;
  --text-color: #333;
  --accent-color: #000000;
  --heading-scale: 1.1;
  --heading-size: 2rem;
  --main-heading-size: 3rem;
  --gravity-duration: 0.6s;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Global Overscroll Behavior */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

/* 3) Base */
body {
  font-family: 'Bahnschrift', sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  overflow-x: hidden;
  font-size: 1rem;
  cursor: url('images/cursor-pointer.svg'), pointer;
}

/* --- Cursor Styles --- */
/* Default pointer cursor for all clickable elements */
a,
button,
.book-arrow,
.project-item,
.nav-dropdown a,
.page,
.site-name,
.landing-heading {
  cursor: url('images/cursor-pointer.svg'), pointer;
}

/* Use hover cursor for all interactive states (hover, focus, active, click) */
a:hover,
a:focus,
a:active,
button:hover,
button:focus,
button:active,
.book-arrow:hover,
.book-arrow:focus,
.book-arrow:active,
.project-item:hover,
.project-item:focus,
.project-item:active,
.nav-dropdown a:hover,
.nav-dropdown a:focus,
.nav-dropdown a:active,
.page:hover,
.page:focus,
.page:active,
.site-name:hover,
.site-name:focus,
.site-name:active,
#cover-img:hover,
#cover-img:focus,
#cover-img:active,
.landing-heading:hover,
.landing-heading:focus,
.landing-heading:active {
  cursor: url('images/cursor-hover.svg'), pointer;
}

/* --- Header Layout --- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: rgba(255,255,255,0.8);
  padding: 1rem 2vw;
  z-index: 100;
}
.site-name {
  flex: 0 0 auto;
  text-align: left;
  font-weight: bold;
  margin: 0;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}
.site-name:hover,
.site-name:focus {
  color: var(--accent-color);
  cursor: url('images/cursor-hover.svg'), pointer;
}
.nav-dropdown {
  flex: 0 0 auto;
  display: flex !important;
  flex-direction: row;
  position: relative;
  margin-left: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  top: auto;
  right: auto;
  align-items: center;
  transition: background 0.2s;
}
.nav-dropdown a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-color);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-dropdown a:hover,
.nav-dropdown a:focus {
  background: #f5f5f5;
  color: var(--accent-color);
  border-radius: 4px;
}

/* --- Responsive for Mobile --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1vw;
  }
  .site-name {
    text-align: left;
    font-size: 0.95rem;
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-dropdown {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
  .nav-dropdown a {
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
  }
}

/* --- Main Content & Utility --- */
main {
  margin-top: 4rem;
}
.headings-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
}
.landing-heading {
  display: block;
  font-weight: bold;
  font-size: var(--heading-size);
  margin: 0.5rem 0;
  transition: transform 0.3s ease;
  cursor: pointer;
  text-align: center;
}
.landing-heading.main-heading {
  font-size: var(--main-heading-size);
}
.landing-heading:hover {
  transform: scale(var(--heading-scale));
}
.nav-dropdown a:hover {
  color: var(--accent-color);
}

/* --- Projects Page --- */
body.projects-page {
  padding-top: 4rem;
  padding-bottom: 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.project-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8vw;
  margin: 0 auto;
  width: 70vw;
  max-width: 1200px;
  justify-content: center;
}
.project-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  overflow: hidden;
  cursor: url('images/cursor-pointer.svg'), pointer;
  user-select: auto;
  transition: transform 0.2s ease;
  background: #fff;
}
.project-item img,
.project-item .preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  display: block;
}
.project-item .preview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
}
.project-item .preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-item .title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(184, 183, 183, 0.461);
  text-align: center;
  padding: 0.75rem 0;
  font-size: 1.2rem;
  font-weight: light;
  color: #222;
  letter-spacing: 0.05em;
  border-top: 2px solid #1d1d1d00;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.116);
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-item .preview,
.project-item .title {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  display: flex;
}
.project-item:hover .preview,
.project-item:hover .title {
  opacity: 1;
  pointer-events: auto;
}

/* --- About & Contact Pages --- */
body.other-page {
  padding-top: 4rem;
}
.content-page {
  width: 100%;
  max-width: 1800px;      /* Match gallery max-width */
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}
.content-page form {
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: stretch;
}

.content-page label {
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.content-page input,
.content-page textarea,
.content-page button {
  font-size: 1rem;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.content-page button[type="submit"] {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.8rem 1.2rem;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
}

.content-page button[type="submit"]:hover,
.content-page button[type="submit"]:focus {
  background: #222;
}

/* --- Book/Portfolio Styles --- */
#cover-container {
  width: 100vw;
  max-width: 100vw;
  display: block;
  margin: 0 auto;
}
#cover-img {
  width: 50vw;
  max-width: 50vw;
  height: auto;
  display: block;
  cursor: pointer;
  margin: 0 auto;
}
.book-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 95vw;
  max-width: 95vw;
  min-height: 0;
}
.book {
  display: flex;
  position: relative;
  background: #fff;
  max-width: 95vw;
  width: 100%;
  margin: 0 auto;
}
.page {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}
.book-controls button.book-arrow {
  background: none;
  color: #636363;
  border: none;
  border-radius: 50%;
  font-size: 2.2rem;
  width: 2.8rem;
  height: 2.8rem;
  margin: 0 0.5rem;
  cursor: url('images/cursor-pointer.svg'), pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.book-controls button.book-arrow:hover,
.book-controls button.book-arrow:focus,
.book-controls button.book-arrow:active {
  background: #eee;
  color: #7b7b7b;
  transform: scale(1.12);
  cursor: url('images/cursor-hover.svg'), pointer;
}

/* --- Unified Arrow Styles --- */
.book-arrow,
.slideshow-arrow {
  background: none;
  color: #636363;
  border: none;
  border-radius: 50%;
  font-size: 2.2rem;
  width: 2.8rem;
  height: 2.8rem;
  margin: 0 0.5rem;
  cursor: url('images/cursor-pointer.svg'), pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.book-arrow:hover,
.book-arrow:focus,
.book-arrow:active,
.slideshow-arrow:hover,
.slideshow-arrow:focus,
.slideshow-arrow:active {
  background: #eee;
  color: #7b7b7b;
  transform: scale(1.12);
  cursor: url('images/cursor-hover.svg'), pointer;
}

/* --- Utility --- */
a:hover {
  color: var(--accent-color);
}

/* --- Remove aspect-ratio and height from .page and .book for desktop --- */
@media (max-width: 768px) {
  .book {
    flex-direction: column;
    width: 98vw;
    max-width: 100vw;
    height: auto;
    max-height: 70vh;
  }
  .page {
    width: 100%;
    height: auto;
    flex: none;
    align-items: center;
    justify-content: center;
  }
  .page.right {
    display: none;
  }
}
.page.flipping-left,
.page.flipping-right {
  z-index: 4;
}
.book::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 2vw;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.10) 40%,
    rgba(0,0,0,0.18) 50%,
    rgba(0,0,0,0.10) 60%,
    rgba(0,0,0,0) 100%
  );
  opacity: 0.45;
  border-radius: 0 0 12px 12px;
  max-width: min(2vw, 20px);
  overflow: hidden;
  clip-path: inset(0);
}
a:focus,
button:focus,
input:focus,
textarea:focus,
.site-name:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* --- Slideshow Styles --- */
.slideshow-container {
  width: 95vw;
  max-width: 1400px;
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slideshow-image {
  width: 100%;
  max-width: 1200px;
  height: 400px;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  background: none;
  border: none;
  display: block;
}

/* --- Gallery Styles --- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2.5rem auto 0 auto;
  justify-content: center;
  align-items: flex-start;
  width: 80vw;
  max-width: 1800px;
  background: none;
  border: none;
  box-shadow: none;
  position: relative;
}
.gallery img {
  max-width: 420px;
  width: 420px;
  height: 290px;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.2s;
  cursor: url('images/cursor-pointer.svg'), pointer;
  background: none;
  border: none;
  object-fit: contain;
  margin: 0;
  padding: 0;
  display: block;
}

/* --- Lightbox Styles --- */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(0,0,0,0.7); /* Dim background */
}

.lightbox-img {
  max-width: 60vw;
  max-height: 80vh;
  width: 60vw;
  height: auto;
  border-radius: 0;
  box-shadow: none; /* No dropshadow in lightbox mode */
  background: none;
  border: none;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
  background: none;
  border: none;
  display: block;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: var(--accent-color);
}

/* Dim gallery when lightbox is open */
.gallery.lightbox-active {
  opacity: 0.3;
  pointer-events: none;
}
button.slideshow-arrow,
button.book-arrow {
  background: none !important;
  color: #636363 !important;
  border: none !important;
  border-radius: 50% !important;
  font-size: 2.2rem !important;
  width: 2.8rem !important;
  height: 2.8rem !important;
  margin: 0 0.5rem !important;
  cursor: url('images/cursor-pointer.svg'), pointer !important;
  transition: background 0.2s, color 0.2s, transform 0.1s !important;
  outline: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
button.slideshow-arrow:hover,
button.slideshow-arrow:focus,
button.slideshow-arrow:active,
button.book-arrow:hover,
button.book-arrow:focus,
button.book-arrow:active {
  background: #eee !important;
  color: #7b7b7b !important;
  transform: scale(1.12) !important;
  cursor: url('images/cursor-hover.svg'), pointer !important;
}

/* --- Heading Styles --- */
h1, .main-title, .about-heading {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1.5em;
  text-align: center;
  opacity: 0.9;
  letter-spacing: 0.02em;
}
h2, .section-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 1em;
  text-align: left;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

/* --- Header Font Size --- */
.site-name,
.nav-dropdown a {
  font-size: 1.25rem;
}

/* --- Main Body Font Size (larger everywhere except landing page and header) --- */
body:not(.landing) .content-page,
body:not(.landing) .about-content,
body:not(.landing) .project-item .title,
body:not(.landing) .landing-heading,
body:not(.landing) {
  font-size: 1.15rem;
}

/* --- Larger fonts for landing page only --- */
body.landing .landing-heading {
  font-size: 2.5rem;
}
body.landing .site-name {
  font-size: 1.7rem;
}

/* Remove font-size from .landing-heading and .project-item .title if present */
.landing-heading {
  font-size: 1rem;
  /* ...existing code... */
}
.project-item .title {
  font-size: 1rem;
  /* ...existing code... */
}