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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Radio Canada', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  padding: 1rem 0 0.5rem;
  display: flex;
  justify-content: center;
  background: transparent;
  color: #000000;
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  background: #ffffff;
}

/* Leaf Canvas */
#leaves-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


/* Container */
.container {
  max-width: 42rem;
  width: 100%;
  padding: 0 2.5rem;
  position: relative;
  z-index: 3;
}

/* Navigation */
nav {
  margin-bottom: 3rem;
}

.nav-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: #888888;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
  position: relative;
}

/* Animated underline */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #000000;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: #000000;
}

.resume-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Hero */
.hero {
  margin-top: 1rem;
  margin-bottom: 3.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.tagline {
  color: #555;
  font-family: 'Geist', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tagline-logo {
  height: 1.8em;
  width: auto;
}

.tagline-link {
  color: #555;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease;
}

.tagline-link:hover {
  color: #7A003C;
}

/* Sections */
.section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #888888;
  margin-bottom: 1.5rem;
  text-transform: none;
}

/* Entries */
.entry {
  margin-bottom: 1.75rem;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.entry-role {
  font-weight: 600;
  font-size: 1rem;
}

.entry-separator {
  color: #cccccc;
}

.entry-company {
  color: #555555;
  font-weight: 400;
}

.entry-date {
  color: #888888;
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 1rem;
}

.entry-description {
  color: #555555;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Project entries with hover bg */
.project-entry {
  position: relative;
  padding: 1.25rem;
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  border-radius: 12px;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.project-entry:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.project-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  mask-image: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 35%, rgba(255,255,255,0.4) 65%, rgba(255,255,255,0) 100%);
  -webkit-mask-image: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 35%, rgba(255,255,255,0.4) 65%, rgba(255,255,255,0) 100%);
}

.project-entry:hover .project-bg,
.project-entry.touched .project-bg {
  opacity: 0.35;
}

.entry-content {
  position: relative;
  z-index: 1;
}

.entry-tech {
  color: #888;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

/* Project Links */
.project-links {
  margin-left: 0.75rem;
}

.project-link {
  color: #888888;
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  transition: color 0.2s ease;
  position: relative;
}

.project-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: #000000;
  transition: width 0.3s ease;
}

.project-link:hover::after {
  width: 100%;
}

.project-link:hover {
  color: #000000;
}

/* About */
.about-text {
  color: #555555;
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 36rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-bottom: 2rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: #888888;
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  display: inline-block;
  will-change: transform;
}

.social-link:hover {
  color: #000000;
}

/* Signature Section */
/* ── Book View ── */
.book-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 242, 238, 0.96);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.book-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.book-scene {
  display: flex;
  width: min(900px, 96vw);
  height: min(580px, 88vh);
  box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 8px 20px rgba(0,0,0,0.1);
  border-radius: 4px 12px 12px 4px;
}

.book-page {
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.book-left {
  background: #faf8f5;
  border-radius: 4px 0 0 4px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.book-left-inner {
  padding: 2rem 2rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.book-spine {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 18px;
  background: linear-gradient(to right, #e0dcd6, #c8c4be, #dedad4);
  box-shadow: inset -3px 0 6px rgba(0,0,0,0.08);
}

.book-right {
  background: #fff;
  border-radius: 0 12px 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 1rem;
  border-left: 1px solid #eee;
}

.book-close {
  background: none;
  border: none;
  font-size: 0.82rem;
  color: #888;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  text-align: left;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
  align-self: flex-start;
}

.book-close:hover { color: #222; }

.book-info {
  flex: 1;
}

.book-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.book-date {
  color: #aaa;
  font-size: 0.82rem;
  display: block;
  margin-bottom: 1rem;
}

.book-desc {
  color: #444;
  font-size: 0.88rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.book-tech {
  color: #999;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.book-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.book-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid #ddd;
  color: #1a1a1a;
  transition: border-color 0.2s, background 0.2s;
}

.book-link:hover {
  background: #f0ede8;
  border-color: #bbb;
}

/* Gallery (right page) */
.book-gallery {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.gallery-track-wrap {
  flex: 1;
  overflow: hidden;
  border-radius: 8px;
  height: 100%;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-img {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 6px;
  background: #f5f5f5;
}

.gallery-arrow {
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #555;
  flex-shrink: 0;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-arrow:hover { background: rgba(0,0,0,0.12); }
.gallery-arrow:disabled { opacity: 0.2; cursor: default; }

.gallery-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.gallery-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.gallery-dot.active {
  background: #555;
  transform: scale(1.3);
}


.signature-section {
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.signature-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.signature-canvas-wrap {
  width: 280px;
  height: 80px;
}

.signature-svg {
  width: 100%;
  height: 100%;
}

.replay-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.replay-btn:hover {
  color: #000;
  border-color: #999;
  transform: rotate(-45deg);
}

/* Owl */
.owl {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  z-index: 10;
  pointer-events: none;
  cursor: pointer;
  filter: drop-shadow(1px 2px 4px rgba(0,0,0,0.25));
  transition: opacity 0.5s ease;
}

.owl svg {
  width: 100%;
  height: 100%;
}

.owl-wing-l, .owl-wing-r {
  transition: none;
}

.owl.flapping .owl-wing-l {
  animation: wing-flap-l 0.18s ease-in-out infinite alternate;
}
.owl.flapping .owl-wing-r {
  animation: wing-flap-r 0.18s ease-in-out infinite alternate;
}

.owl.gliding .owl-wing-l {
  animation: wing-glide-l 1.2s ease-in-out infinite alternate;
}
.owl.gliding .owl-wing-r {
  animation: wing-glide-r 1.2s ease-in-out infinite alternate;
}

@keyframes wing-flap-l {
  0% { transform: rotate(15deg); }
  100% { transform: rotate(-35deg); }
}
@keyframes wing-flap-r {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(35deg); }
}

@keyframes wing-glide-l {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(-15deg); }
}
@keyframes wing-glide-r {
  0% { transform: rotate(8deg); }
  100% { transform: rotate(15deg); }
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .entry-header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .entry-date {
    margin-left: 0;
  }

  .owl {
    width: 36px;
    height: 36px;
  }
}
