@font-face {
  font-family: 'Curlz';
  src: url('/fonts/Curlz.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:          #f5f0e8;
  --bg-light:    #faf7f2;
  --plum:        #6b5068;
  --plum-light:  #9a8898;
  --rose:        #c8969e;
  --text:        #4a3a48;

  --font-curlz: 'Curlz', cursive;
  --font-body:  'Cormorant Garamond', Georgia, serif;

  --ease: all 0.35s ease;
  --shadow: 0 8px 32px rgba(74, 58, 72, 0.14);
  --shadow-sm: 0 2px 12px rgba(74, 58, 72, 0.08);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ===== Language toggle logic ===== */
.lang-et .lang-en-text { display: none; }
.lang-en .lang-et-text { display: none; }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  transition: var(--ease);
}
.nav.scrolled {
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(10px);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: var(--font-curlz);
  font-size: 2rem;
  color: var(--plum);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}
.nav-menu a {
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--plum-light);
  transition: color 0.25s ease;
}
.nav-menu a:hover { color: var(--plum); }

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0.1em;
  color: var(--plum-light);
  padding: 0.15rem 0.3rem;
  transition: color 0.25s ease;
}
.lang-btn:hover { color: var(--plum); }
.lang-btn.active {
  color: var(--plum);
  border-bottom: 1px solid var(--rose);
}
.lang-sep {
  color: var(--plum-light);
  font-size: 0.8rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--plum);
  border-radius: 2px;
  transition: var(--ease);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 5% 5rem;
  position: relative;
}
.hero-content { animation: fadeIn 1.2s ease; }
.hero-logo {
  width: clamp(90px, 12vw, 160px);
  margin: 0 auto 2rem;
}
.hero-title {
  font-family: var(--font-curlz);
  font-size: clamp(4rem, 11vw, 7.5rem);
  color: var(--plum);
  font-weight: normal;
  margin-bottom: 1rem;
  line-height: 1;
}
.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-style: italic;
  color: var(--plum-light);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}
.btn {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  border: 1px solid var(--rose);
  color: var(--plum);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.06em;
  transition: var(--ease);
}
.btn:hover {
  background: var(--rose);
  color: var(--bg);
}
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.hero-scroll span {
  font-size: 1.1rem;
  color: var(--plum-light);
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--rose), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===== Project nav (TOC) ===== */
.project-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2rem;
  padding: 3rem 5% 2.5rem;
  border-bottom: 1px solid rgba(107, 80, 104, 0.12);
  max-width: 1400px;
  margin: 0 auto;
}
.project-nav a {
  font-style: italic;
  font-size: 1rem;
  font-weight: 500;
  color: var(--plum-light);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: var(--ease);
}
.project-nav a:hover {
  color: var(--plum);
  border-bottom-color: var(--rose);
}

/* ===== Project spread ===== */
.project {
  padding: 5rem 5% 4rem;
  border-bottom: 1px solid rgba(107, 80, 104, 0.1);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* override max-width centering for full-bleed border */
.portfolio > .project {
  max-width: none;
  padding-left: calc((100% - 1300px) / 2);
  padding-right: calc((100% - 1300px) / 2);
}
@media (max-width: 1400px) {
  .portfolio > .project {
    padding-left: 5%;
    padding-right: 5%;
  }
}

.project-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.project-title {
  font-family: var(--font-curlz);
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  color: var(--plum);
  font-weight: normal;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.project-supervisor {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--plum-light);
  letter-spacing: 0.03em;
}
.project-coop {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--plum-light);
  margin-top: 0.3rem;
}

.project-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4.5rem;
  align-items: start;
}

.project-images {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.project-main-img img {
  width: 100%;
  height: auto;
  box-shadow: var(--shadow);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
}
.project-grid .gallery-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.project-text {
  padding-top: 0.5rem;
}
.project-text p {
  font-style: italic;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 2;
  color: var(--text);
}

.project-year {
  font-family: var(--font-curlz);
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--plum-light);
  text-align: center;
  margin-top: 3rem;
  opacity: 0.75;
}

/* ===== Gallery item ===== */
.gallery-item {
  cursor: pointer;
  overflow: hidden;
}
.gallery-item img {
  transition: transform 0.45s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(25, 18, 25, 0.93);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 88%;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 38px; height: 38px;
  background: var(--bg-light);
  border: none; border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--plum);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s ease;
}
.lightbox-close:hover { background: var(--rose); color: white; }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: var(--bg-light);
  border: none; border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--plum);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s ease;
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--rose); color: white; }

/* ===== Footer ===== */
.footer {
  padding: 4rem 5%;
  text-align: center;
  background: var(--bg-light);
  border-top: 1px solid rgba(107, 80, 104, 0.1);
}
.footer-logo {
  font-family: var(--font-curlz);
  font-size: 2.8rem;
  color: var(--plum);
  margin-bottom: 0.75rem;
}
.footer-contact {
  font-style: italic;
  font-size: 1rem;
  font-weight: 500;
  color: var(--plum-light);
  margin-bottom: 0.75rem;
}
.footer-contact a {
  color: var(--plum);
  border-bottom: 1px solid var(--rose);
  transition: color 0.25s ease;
}
.footer-contact a:hover { color: var(--rose); }

.footer-copy {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--plum-light);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .project-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .project-main-img img {
    height: auto;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0; right: -100%;
    width: 100%; height: 100vh;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.35s ease;
    z-index: 100;
  }
  .nav-menu.active { right: 0; }
  .nav-menu a { font-size: 1.3rem; }
  .nav-toggle { display: flex; z-index: 101; }
  .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

  .project { padding: 3.5rem 5% 3rem; }
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); }
  .project-grid .gallery-item img { height: 85px; }
  .project-nav { gap: 0.3rem 1.2rem; padding: 2rem 5%; }
  .project-nav a { font-size: 0.9rem; }
}
