@font-face {
  font-family: 'OfeliaText';
  src: url('../fonts/OfeliaText-Light.otf') format('opentype');
  font-weight: 300;
}
@font-face {
  font-family: 'OfeliaText';
  src: url('../fonts/OfeliaText-Regular.otf') format('opentype');
  font-weight: 400;
}
@font-face {
  font-family: 'OfeliaText';
  src: url('../fonts/OfeliaText-Medium.otf') format('opentype');
  font-weight: 500;
}
@font-face {
  font-family: 'OfeliaText';
  src: url('../fonts/OfeliaText-Bold.otf') format('opentype');
  font-weight: 700;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --g1: #26e3c2;
  --g2: #635cff;
  --g3: #a273ff;
  --gradient: linear-gradient(135deg, #26e3c2, #635cff, #a273ff);
  --black: #111111;
  --grey: #888888;
  --light: #f4f4f4;
  --white: #ffffff;
  --nav-h: 72px;
  --filter-h: 48px;
}

body {
  font-family: 'OfeliaText', 'Segoe UI', Arial, sans-serif;
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--white);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.nav-logo img { height: 38px; }

.nav-tagline {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 3px;
}

.burger {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--black);
  transition: all 0.3s;
}

.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-links-desktop {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links-desktop a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-links-desktop a:hover { opacity: 0.45; }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  z-index: 99;
  flex-direction: column;
  padding: 40px 32px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-size: 28px;
  font-weight: 300;
  color: var(--black);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* ── FILTER BAR ── */
.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  height: var(--filter-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-prev {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px 0 0;
  font-size: 14px;
  color: var(--grey);
  flex-shrink: 0;
}

.filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'OfeliaText', sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--grey);
  padding: 0 14px;
  height: 100%;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.filter-btn:hover { color: var(--black); }

.filter-btn.active {
  color: var(--black);
  font-weight: 700;
  border-bottom-color: var(--black);
}

.filter-sep {
  width: 1px;
  height: 18px;
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
  margin: 0 4px;
}

.filter-btn[data-type="tag"].active {
  color: var(--g2);
  border-bottom-color: var(--g2);
}

/* ── PORTFOLIO GRID ── */
.grid-wrap { padding-top: 2px; }

.masonry {
  columns: 3;
  column-gap: 3px;
  padding: 3px;
  width: 100%;
}

/* Ken Burns keyframes — 6 variante diferite */
@keyframes kb1 { 0%{transform:scale(1)    translate(0%,0%)}    100%{transform:scale(1.18) translate(-3%,-2%)} }
@keyframes kb2 { 0%{transform:scale(1.15) translate(-2%,0%)}   100%{transform:scale(1)    translate(2%,2%)} }
@keyframes kb3 { 0%{transform:scale(1)    translate(2%,1%)}    100%{transform:scale(1.20) translate(-1%,-3%)} }
@keyframes kb4 { 0%{transform:scale(1.18) translate(0%,-2%)}   100%{transform:scale(1)    translate(-2%,2%)} }
@keyframes kb5 { 0%{transform:scale(1)    translate(-2%,0%)}   100%{transform:scale(1.16) translate(2%,-2%)} }
@keyframes kb6 { 0%{transform:scale(1.15) translate(2%,2%)}    100%{transform:scale(1)    translate(-1%,-1%)} }

/* Stagger fade-in la load */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  break-inside: avoid;
  margin-bottom: 3px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
  max-height: 520px;
  max-width: 100%;
  animation: cardIn 0.7s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.25s; }
.card:nth-child(4) { animation-delay: 0.35s; }
.card:nth-child(5) { animation-delay: 0.45s; }
.card:nth-child(6) { animation-delay: 0.55s; }

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.5s ease;
}

/* Ken Burns — durată diferită per card, loop alternativ */
.card:nth-child(1) img { animation: kb1 8s  ease-in-out infinite alternate; }
.card:nth-child(2) img { animation: kb2 11s ease-in-out infinite alternate; }
.card:nth-child(3) img { animation: kb3 9s  ease-in-out infinite alternate; }
.card:nth-child(4) img { animation: kb4 10s ease-in-out infinite alternate; }
.card:nth-child(5) img { animation: kb5 12s ease-in-out infinite alternate; }
.card:nth-child(6) img { animation: kb6 7s  ease-in-out infinite alternate; }

/* Hover: pauză Ken Burns + luminozitate usor mai mare */
.card:hover img {
  animation-play-state: paused;
  filter: brightness(1.08);
}

.card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 36px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%);
}

.card-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}

.card-sub {
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card[hidden] { display: none !important; }

/* ── PROJECT PAGE ── */
.project-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  margin-top: var(--nav-h);
  align-items: start;
}

.project-photos {
  padding: 3px;
}

.project-photos .masonry {
  columns: 2;
  column-gap: 3px;
  padding: 0;
}

.project-photos .masonry img {
  width: 100%;
  display: block;
  margin-bottom: 3px;
}

.project-info {
  padding: 48px 40px 48px 32px;
  position: sticky;
  top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-left: 1px solid rgba(0,0,0,0.07);
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.project-back:hover { color: var(--black); }

.project-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 20px;
  line-height: 1.25;
}

.project-desc {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: #444;
  margin-bottom: 32px;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.meta-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.meta-label {
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
}

.meta-value {
  font-weight: 400;
  color: #555;
}

.project-share {
  display: flex;
  gap: 14px;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 24px;
}

.share-link {
  color: var(--grey);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.share-link:hover { color: var(--black); }

.share-link svg { width: 16px; height: 16px; fill: currentColor; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 40px;
}

footer img { height: 26px; flex-shrink: 0; }

.footer-links {
  list-style: none;
  display: flex;
  gap: 24px;
  flex: 1;
}

.footer-links a {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--black); }

.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.footer-right p {
  font-size: 10.5px;
  color: rgba(0,0,0,0.35);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.footer-dev {
  font-size: 10.5px;
  color: rgba(0,0,0,0.25);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.footer-dev a {
  color: rgba(0,0,0,0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-dev a:hover { color: var(--black); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .project-layout {
    grid-template-columns: 1fr;
  }
  .project-info {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.07);
    padding: 32px 24px;
  }
  .project-photos .masonry { columns: 2; }
}

@media (max-width: 768px) {
  .nav-links-desktop { display: none; }
  .masonry { columns: 2; }
}

@media (max-width: 480px) {
  .masonry { columns: 1; }
  .project-photos .masonry { columns: 1; }
  footer { padding: 16px 24px; height: auto; flex-wrap: wrap; gap: 12px; }
  .footer-links { gap: 16px; flex-wrap: wrap; }
  .footer-right { width: 100%; }
  .footer-right p { display: none; }
  .footer-dev { font-size: 10px; }
}

@media (min-width: 769px) {
  .burger { display: none; }
}
