/* style.css */

/* Import custom font */
@font-face {
  font-family: 'Aller Display';
  src: url('../../assets/fonts/Aller Display.woff2') format('woff2'),
       url('../../assets/fonts/Aller Display.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Root variables */
:root {
  --color-dark: #333;
  --color-light: #eee;
  --color-bordeaux: #800020;
  --gap: 30px;
  --frame-width: 15px;
  --transition-fast: 0.3s ease;
  --transition-mid: 0.5s ease;
  --font-heading: 'Aller Display', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Playfair Display', serif;
  --font-nav: 'Aller Display', sans-serif;
  --font-label: 'Aller Display', sans-serif;
}

/* Reset & base */
* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
html  { height: 100%; background: #fff; overscroll-behavior: none; overflow-x: clip; }
body  { min-height: 100%; background: #fff; overscroll-behavior: none; margin: var(--gap); font-family: var(--font-body); }

/* ── Sticky frame bars — top & bottom white strips that stay in place on iOS ── */
.frame-bar {
  position: sticky;
  margin-left: calc(-1 * var(--gap));
  width: calc(100% + 2 * var(--gap));
  background: #fff;
  z-index: 9999;
  flex-shrink: 0;
  pointer-events: none;
}
.frame-bar-top    { top: 0;    height: var(--gap); margin-top:    calc(-1 * var(--gap)); }
.frame-bar-bottom { bottom: 0; height: var(--gap); margin-bottom: calc(-1 * var(--gap)); }

/* Navigation */
.nav-container {
  position: fixed;
  top: var(--gap);
  left: var(--gap);
  z-index: 10000;
  background: #fff;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--transition-fast);
}
.nav-container.hidden { transform: translateX(-200%); }

.logo {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-dark);
  text-decoration: none;
  padding: 8px 16px;
  transition: color var(--transition-fast);
}
.logo:hover { color: var(--color-bordeaux); }

.nav-item {
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 1rem;
  color: #999;
  text-decoration: none;
  padding: 8px 16px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.nav-item:hover { color: var(--color-bordeaux); }

/* ── Hero (index.html – scrollable) ─────────────────────────── */
.hero {
  position: relative;
  margin: calc(-1 * var(--gap));
  padding: var(--frame-width);
  height: 100vh;
  overflow: hidden;
}
.hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Full-page layout (contact.html, workflow.html) ──────────── */
body.fullscreen {
  margin: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}
body.fullscreen .hero {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  margin: 0;
  padding: var(--gap);
  background: #fff;
}
body.fullscreen .hero video,
body.fullscreen .hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contact page — outer wrapper handles absolute positioning */
.contact-wrap {
  position: absolute;
  bottom: var(--gap);
  left: var(--gap);
  width: 500px;
  max-width: calc(100% - 2 * var(--gap));
}

/* Contact page — white panel, clips the slide animation */
.contact-info {
  background: #fff;
  padding: 32px;
  overflow: hidden;
}
.contact-info h1,
.contact-info h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: normal;
  margin: 0 0 14px;
  color: var(--color-dark);
}
.contact-info p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 4px;
}
.contact-info a {
  color: var(--color-bordeaux);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.contact-info a:hover { border-bottom-color: var(--color-bordeaux); }

/* Section slide animations */
@keyframes sectionExit {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(80px); opacity: 0; }
}
@keyframes sectionEnter {
  from { transform: translateX(-40px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
.contact-section.section-exit  { animation: sectionExit  0.28s ease forwards; pointer-events: none; }
.contact-section.section-enter { animation: sectionEnter 0.30s ease forwards; }

/* Arrow — sibling of .contact-info, fully outside the white panel */
.contact-next {
  position: absolute;
  top: 50%;
  right: -60px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--color-bordeaux);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 14px rgba(0,0,0,0.28);
  transition: background var(--transition-fast), color var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 10;
}
.contact-next:hover {
  background: var(--color-bordeaux);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 18px rgba(0,0,0,0.38);
}

/* Workflow page panel */
.info-panel {
  position: absolute;
  bottom: var(--gap);
  left: var(--gap);
  width: 400px;
  max-width: calc(100% - 2 * var(--gap));
  background: #fff;
  padding: 32px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.info-panel p.call-to-action {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-dark);
  margin-bottom: 16px;
  font-style: italic;
}
.info-panel p.contact-email {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--color-dark);
}
.info-panel p.contact-email a {
  font-weight: 600;
  color: var(--color-bordeaux);
  text-decoration: none;
}

/* ── Projects layout ─────────────────────────────────────────── */
.projects-section {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-top: var(--gap);
}
.project-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.project-card.full {
  flex: 0 0 100%;
  height: calc(100vh - var(--gap));
}
.project-card.half {
  flex: 0 0 calc((100% - var(--gap)) / 2);
  height: calc(50vh - 0.5 * var(--gap));
}
.project-card.third {
  flex: 0 0 calc((100% - 2*var(--gap)) / 3);
  height: calc(50vh - 0.5 * var(--gap));
}
.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-mid);
  will-change: transform;
}
.project-card:hover img { transform: scale(1.05); }
.project-card.half:hover img { transform: scale(1.15); }
.scierie img { object-position: bottom center; }

/* Project info overlay */
.project-info {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 10px 25px;
  text-align: center;
}
.project-info h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-dark);
  margin-bottom: 4px;
  white-space: nowrap;
}
.project-info p { font-size: 1rem; color: var(--color-dark); font-family: var(--font-label); white-space: nowrap; }

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  top: 0; left: 0;
  z-index: 2000;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.lightbox.active,
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-content {
  display: flex;
  align-items: center;
  gap: 36px;
  max-width: 92%;
  max-height: 88%;
  z-index: 1;
}
.lightbox-content img {
  max-height: 82vh;
  max-width: 68vw;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}
.lightbox-text {
  width: 220px;
  flex-shrink: 0;
  color: #fff;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.65;
}
.lightbox-text h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: normal;
  font-style: normal;
  margin: 0 0 10px;
  letter-spacing: 0.03em;
}
.lightbox-caption {
  display: block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}
.lightbox-close,
.lightbox-nav {
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  position: absolute;
  line-height: 1;
}
.lightbox-close {
  top: 20px;
  right: 20px;
  background: none;
  padding: 4px 8px;
  transition: opacity var(--transition-fast);
}
.lightbox-close:hover { opacity: 0.7; }

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Hidden carousel pool */
.hidden { display: none; }

.spacer-bottom { height: var(--gap); }

/* ── Responsive ──────────────────────────────────────────────── */
/* Safe-area extension for iOS Safari (viewport-fit=cover) */
@supports (padding: env(safe-area-inset-top)) {
  body {
    margin-top:    calc(var(--gap) + env(safe-area-inset-top));
    margin-right:  calc(var(--gap) + env(safe-area-inset-right));
    margin-bottom: calc(var(--gap) + env(safe-area-inset-bottom));
    margin-left:   calc(var(--gap) + env(safe-area-inset-left));
  }
  .frame-bar-top    { height: calc(var(--gap) + env(safe-area-inset-top)); }
  .frame-bar-bottom { height: calc(var(--gap) + env(safe-area-inset-bottom)); }
  .nav-container {
    top:  calc(var(--gap) + env(safe-area-inset-top));
    left: calc(var(--gap) + env(safe-area-inset-left));
  }
}

@media (max-width: 768px) {
  :root {
    --gap: 15px;
    --frame-width: 2px;
  }

  .project-card.full,
  .project-card.half,
  .project-card.third {
    flex: 0 0 100%;
    height: 45vh;
  }
  .project-card.full { height: 60vh; }

  .project-info { padding: 6px 14px; }
  .project-info h3 { font-size: 1.25rem; }
  .project-info p  { font-size: 0.78rem; }

  .project-card img { will-change: auto; }

  .lightbox-content {
    flex-direction: column;
    gap: 20px;
    max-width: 94vw;
  }
  .lightbox-content img {
    max-width: 94vw;
    max-height: 62vh;
  }
  .lightbox-text {
    width: 94vw;
    font-size: 0.85rem;
  }
  .lightbox-text h3 { font-size: 1.1rem; }

  .contact-wrap { width: calc(100% - 2 * var(--gap)); }
  .contact-info { padding: 24px; }
  .contact-next { right: -52px; }
  .info-panel   { width: 90%; padding: 24px; }
}

@media (max-width: 480px) {
  :root {
    --gap: 10px;
    --frame-width: 1px;
  }
  .contact-info { padding: 16px; }
  .info-panel   { padding: 16px; }
}

/* Custom cursor — hide native pointer on real mouse devices */
@media (hover: hover) and (pointer: fine) {
  html, html * { cursor: none !important; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Performance hints */
img { will-change: auto; }
