/*
 * BIΛNNΛ ARCHITECTURE
 * Singurul fișier CSS pentru index.html, index2.html, index3.html și proiect.html.
 * Modifică aici culorile și dimensiunile imaginilor.
 */

:root {
  --paper: #fdfaf5;
  --blue: #1b3b50;
  --gold: #8b6838;
  --muted: #59616a;
  --line: #1b3b5026;
  --surface: #f1eee7;
  --font-body: "Jost", "Segoe UI", Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-base: 1rem;
  --text-lg: clamp(1.25rem, 1.1rem + 0.4vw, 1.5rem);
  --text-xl: clamp(1.75rem, 1.3rem + 1.5vw, 2.25rem);
  --text-hero: clamp(2.25rem, 1.5rem + 3vw, 4.375rem);
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-20: 5rem;

  /* Limite imagini: fără decupare, indiferent de proporția fișierului. */
  --image-main-width: 760px;
  --image-main-height: 430px;
  --image-gallery-width: 360px;
  --image-gallery-height: 250px;
}

/* Bază comună */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--blue);
  font: var(--text-base)/1.7 var(--font-body);
}

img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

a {
  color: inherit;
  text-underline-offset: 5px;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: var(--space-3);
  background: var(--blue);
  color: var(--paper);
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-8));
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--space-4);
  gap: var(--space-6);
}

.logo {
  width: 245px;
  max-width: 55vw;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 2px;
}

nav a:hover {
  text-decoration: underline;
}

section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  scroll-margin-top: 150px;
}

.eyebrow,
.note,
figcaption,
small,
.back-link {
  font-size: var(--text-xs);
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
}

h1,
h2,
h3 {
  font-weight: 400;
}

h1 {
  max-width: 900px;
  margin-block: var(--space-6);
  font-size: var(--text-hero);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 var(--space-6);
  font-size: var(--text-xl);
  line-height: 1.25;
}

h3 {
  font-size: var(--text-lg);
  line-height: 1.35;
}

p {
  max-width: 670px;
  color: var(--muted);
}

.hero {
  padding-block: clamp(var(--space-12), 7vw, 6rem);
  border-bottom: 1px solid var(--line);
}

.button {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  margin: var(--space-4) var(--space-2) 0 0;
  background: var(--blue);
  color: var(--paper);
  text-decoration: none;
}

.outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}

/* Portofoliu, servicii și prezentare */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.project-card {
  border: 1px solid var(--line);
}

.project-link {
  display: block;
  height: 100%;
  text-decoration: none;
}

.project-link:hover h3 {
  text-decoration: underline;
}

.card-image {
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--surface);
}

.card-image img {
  max-height: 220px;
}

.text {
  padding: var(--space-6);
}

.text h3 {
  margin-top: 0;
}

.text p {
  margin-bottom: 0;
}

.services,
.contact {
  border-top: 1px solid var(--line);
}

.services {
  border-bottom: 1px solid var(--line);
}

.service {
  border-top: 2px solid var(--blue);
  padding-top: var(--space-6);
}

.service small {
  color: var(--gold);
}

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.brand {
  width: 100%;
}

footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-6);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}

footer .logo {
  width: 185px;
}

/* Pagina proiectului */
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: var(--space-6);
  text-decoration: none;
}

.project-heading {
  padding-top: var(--space-8);
}

.project-heading h1 {
  font-size: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--space-8) 0 0;
  padding-block: var(--space-6);
  border-block: 1px solid var(--line);
  gap: var(--space-6);
}

.project-facts dt {
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-facts dd {
  margin: var(--space-2) 0 0;
}

figure {
  min-width: 0;
  margin: 0;
}

.photo-link {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: var(--space-4);
  background: var(--surface);
  text-decoration: none;
  cursor: zoom-in;
}

/* Imaginile păstrează ambele dimensiuni automate.
   Max-width și max-height micșorează fără să taie sau să deformeze. */
.main-photo {
  width: 100%;
  max-width: var(--image-main-width);
  margin: var(--space-8) auto var(--space-12);
}

.main-photo img {
  max-width: 100%;
  max-height: var(--image-main-height);
  object-fit: contain;
}

figcaption {
  padding-top: var(--space-2);
  color: var(--muted);
}

.project-body {
  max-width: 860px;
  margin-inline: auto;
}

.project-body section {
  padding-block: var(--space-8);
}

.project-body p {
  max-width: 68ch;
}

.inline-gallery,
.final-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
  align-items: start;
  margin-block: var(--space-8);
}

.inline-gallery figure,
.final-gallery figure {
  width: 100%;
  max-width: calc(var(--image-gallery-width) + 32px);
  margin-inline: auto;
}

.inline-gallery img,
.final-gallery img {
  max-width: 100%;
  max-height: var(--image-gallery-height);
  object-fit: contain;
}

.gallery-section {
  margin-top: var(--space-8);
  border-top: 1px solid var(--line);
}

.final-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-end {
  padding-bottom: var(--space-12);
}

/* Galerie mărită: aceleași proporții integrale, fără decupare. */
.lightbox {
  width: min(1060px, 95vw);
  max-height: 95dvh;
  padding: var(--space-4);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--blue);
}

.lightbox::backdrop {
  background: #102531d9;
}

.lightbox-bar,
.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.lightbox h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.lightbox button {
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

.lightbox img {
  max-width: 100%;
  max-height: 66dvh;
  margin: var(--space-4) auto;
  object-fit: contain;
}

.lightbox-caption {
  text-align: center;
  max-width: none;
}

body.gallery-open {
  overflow: hidden;
}

/* Tablete și telefoane */
@media (max-width: 800px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .final-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    gap: var(--space-2);
  }

  .logo {
    max-width: 75vw;
    width: 225px;
  }

  nav {
    justify-content: center;
    gap: var(--space-4);
  }

  nav a {
    letter-spacing: 1px;
  }

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

  .project-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-gallery figure,
  .final-gallery figure {
    max-width: 300px;
  }

  .main-photo img {
    max-height: 320px;
  }

  .inline-gallery img,
  .final-gallery img {
    max-height: 230px;
  }

  footer .wrap {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================
   INDEX2.HTML: INTRO VIDEO + ANTET VIZIBIL LA SCROLL
   Aceste reguli nu modifică index.html sau proiect.html.
   ========================================================== */

.video-page {
  --text-intro: clamp(3rem, 7vw, 6.75rem);
  --intro-inset: clamp(20px, 4.5vw, 64px);
  --intro-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.video-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  padding: var(--intro-inset);
  overflow: hidden;
  background: #102632 url("imagini/intro-poster.jpg") center / cover no-repeat;
  color: var(--paper);
}

.intro-film {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.video-intro::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    #10263240 0%,
    #10263208 30%,
    #10263259 52%,
    #102632eb 100%
  );
  content: "";
  pointer-events: none;
}

.intro-top,
.intro-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
}

.intro-top {
  align-items: center;
}

.intro-brand {
  display: block;
  flex-shrink: 0;
  width: 260px;
  max-width: 65vw;
  padding: 14px 18px;
  background: var(--paper);
}

.intro-brand img {
  width: 100%;
  height: auto;
}

.intro-caption,
.intro-eyebrow {
  color: var(--paper);
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
}

.intro-eyebrow {
  margin: 0 0 var(--space-6);
  text-transform: uppercase;
}

.intro-title {
  margin: 0 0 var(--space-8);
  color: var(--paper);
  font-size: var(--text-intro);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
}

.intro-enter {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: var(--space-8);
  padding-block: var(--space-2);
  border-bottom: 1px solid #fdfaf599;
  text-decoration: none;
}

.intro-enter span {
  display: inline-block;
  transition: transform 220ms var(--intro-ease);
}

.intro-enter:hover span {
  transform: translateY(4px);
}

.intro-meta {
  max-width: 310px;
  text-align: right;
}

.intro-controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.intro-controls[hidden] {
  display: none;
}

.intro-controls button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid #fdfaf599;
  background: #102632a6;
  color: var(--paper);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background 180ms ease;
}

.intro-controls button:hover {
  background: #24435c;
}

.intro-status {
  margin: var(--space-3) 0 0;
  color: var(--paper);
  font-size: var(--text-xs);
}

.intro-status:empty {
  display: none;
}

.video-page .intro-header {
  position: sticky;
}

/* Fără JavaScript, antetul rămâne sticky în fluxul normal al paginii.
   JS activează regulile de mai jos după instalarea controalelor. */
.video-page.intro-enhanced .intro-header {
  position: fixed;
  inset: 0 0 auto;
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition:
    opacity 280ms var(--intro-ease),
    transform 280ms var(--intro-ease);
}

.video-page.intro-enhanced.header-visible .intro-header {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 700px) {
  .intro-brand {
    width: 215px;
    padding: 12px 14px;
  }

  .intro-top > .intro-caption {
    display: none;
  }

  .intro-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
  }

  .intro-meta {
    max-width: 100%;
    text-align: left;
  }

  .intro-controls {
    justify-content: flex-start;
    margin-top: var(--space-2);
  }

  .intro-eyebrow {
    margin-bottom: var(--space-4);
  }

  .intro-title {
    margin-bottom: var(--space-6);
  }
}

@media (max-height: 620px) {
  .video-page {
    --text-intro: clamp(2rem, 9vh, 4rem);
    --intro-inset: 20px;
  }

  .intro-eyebrow,
  .intro-top > .intro-caption {
    display: none;
  }

  .intro-brand {
    width: 180px;
    padding: 8px 12px;
  }

  .intro-title {
    margin-bottom: var(--space-4);
  }

  .intro-bottom {
    flex-direction: row;
    align-items: flex-end;
    gap: var(--space-4);
  }

  .intro-meta {
    max-width: 46%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-page *,
  .video-page *::before,
  .video-page *::after {
    transition: none;
  }
}

/* INDEX3.HTML: player YouTube integral, fără decuparea clipului. */
.youtube-intro {
  background-image: url("imagini/youtube-poster.jpg");
}

.youtube-film {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 500ms ease;
}

/* Păstrează scrollul paginii și pe suprafața playerului. */
.youtube-intro[data-video-started="true"] .youtube-film {
  opacity: 1;
}

.youtube-intro[data-playback="unavailable"] .youtube-film {
  opacity: 0;
}

.youtube-enhanced .youtube-film {
  pointer-events: none;
}

/* Fără JavaScript, lasă accesibile controalele native ale playerului. */
.youtube-page:not(.youtube-enhanced) .youtube-film {
  opacity: 1;
}

.youtube-credit {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
}

.youtube-alternatives {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
}

.youtube-alternatives a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.intro-controls button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 700px) {
  .youtube-alternatives {
    justify-content: flex-start;
  }
}

@media (max-height: 620px) {
  .youtube-page .intro-meta > .intro-caption {
    display: none;
  }

  .youtube-page .youtube-credit {
    margin-top: 0;
  }
}
