/* =========================================================
   portfolio.css – Minimal CSS for /portofoliu (mobile perf)
   Goal: reduce render-blocking vs homepage.css, no redesign.
========================================================= */

/* Self-hosted fonts (WOFF2) – latin + latin-ext (Romanian diacritics), font-display: swap */
/* Inter 400 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/inter-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Inter 500 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/assets/fonts/inter-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Inter 600 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/assets/fonts/inter-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Inter 700 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/inter-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/inter-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Playfair Display 700 (headings) */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/playfair-display-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/playfair-display-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  /* EMERALD ELEGANCE / WHITE tokens (keep identical) */
  --color-bg: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-surface-2: #F7F8F7;
  --color-text: #1E2A1F;
  --color-text-2: #3B4A3C;
  --color-muted: #6A776B;
  --color-accent: #046307;
  --color-accent-hover: #034F06;
  --color-accent-soft: rgba(4, 99, 7, 0.10);
  --color-gold: #D4AF37;
  --color-gold-subtle: rgba(212, 175, 55, 0.18);
  --color-border: rgba(4, 99, 7, 0.14);

  --shadow-sm: 0 1px 2px rgba(30, 42, 31, 0.08);
  --shadow-md: 0 6px 18px rgba(30, 42, 31, 0.10);
  --shadow-lg: 0 14px 32px rgba(30, 42, 31, 0.12);
  --shadow-xl: 0 22px 48px rgba(30, 42, 31, 0.14);

  --bg-primary: var(--color-bg);
  --bg-secondary: var(--color-surface-2);
  --bg-card: var(--color-surface);
  --bg-elevated: #FFFFFF;
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text-2);
  --text-muted: var(--color-muted);
  --accent: var(--color-accent);
  --accent-hover: var(--color-accent-hover);
  --gold: var(--color-gold);
  --gold-subtle: var(--color-gold-subtle);
  --border: var(--color-border);

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  --z-sticky: 100;
  --z-overlay: 998;
  --z-modal: 999;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100vw; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; font-weight: 700; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  transform: translateY(-200%);
  transition: transform var(--transition-base);
  z-index: calc(var(--z-modal) + 1);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header (fixed) */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
  border-bottom: 1px solid transparent;
}
.header.scrolled { box-shadow: var(--shadow-md); border-bottom-color: var(--border); }
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.desktop-nav { display: none; }
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-full);
  border: 1px solid rgba(4, 99, 7, 0.22);
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent);
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover,
.nav-toggle:focus-visible { border-color: rgba(4, 99, 7, 0.45); background: #fff; outline: none; }
.nav-toggle:focus-visible { box-shadow: 0 0 0 3px rgba(4, 99, 7, 0.18); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--transition-base), opacity var(--transition-base); }
.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); }

@media (min-width: 1024px) {
  .desktop-nav { display: block; margin-left: auto; margin-right: var(--space-lg); }
  .desktop-nav ul { display: flex; align-items: center; gap: var(--space-lg); list-style: none; }
  .desktop-nav a { font-weight: 600; color: var(--text-secondary); }
  .desktop-nav a:hover { color: var(--accent); }
  .nav-toggle { display: none; }
}

.nav-icon-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(4, 99, 7, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base);
}
.nav-icon-link:hover { border-color: rgba(4, 99, 7, 0.32); background: rgba(255, 255, 255, 0.92); }
.nav-icon-link svg { width: 18px; height: 18px; }

/* Mobile nav */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 400px;
  height: 100vh;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  z-index: var(--z-modal);
  overflow-y: auto;
}
.mobile-nav.active { transform: translateX(0); }
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-nav-links { padding: var(--space-lg); }
.mobile-nav-links ul { list-style: none; display: grid; gap: 0.5rem; }
.mobile-nav-links a {
  display: block;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(4, 99, 7, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-primary);
  font-weight: 600;
}
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 99, 7, 0.14);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: var(--z-overlay);
}
.nav-overlay.active { opacity: 1; visibility: visible; }

/* Layout primitives */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-lg); }
.section { padding: var(--space-3xl) 0; }
.section-header { text-align: center; margin-bottom: var(--space-2xl); }
.section-subtitle { color: var(--text-secondary); max-width: 820px; margin: 0.75rem auto 0; line-height: 1.75; }
.portfolio-context { max-width: 860px; }

/* Ensure content clears fixed header */
#main { padding-top: calc(80px + var(--space-2xl)); }
@media (max-width: 767px) { #main { padding-top: calc(80px + var(--space-2xl)); } }

/* Portfolio masonry / puzzle */
.page-portfolio .portfolio-masonry { columns: 2; column-gap: var(--space-md); }
@media (min-width: 768px) { .page-portfolio .portfolio-masonry { columns: 3; } }
@media (min-width: 1100px) { .page-portfolio .portfolio-masonry { columns: 4; } }

.portfolio-item {
  break-inside: avoid;
  margin: 0 0 var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  content-visibility: auto;
  contain-intrinsic-size: 320px 420px;
  contain: layout paint;
}

.portfolio-trigger { display: block; width: 100%; padding: 0; border: 0; background: transparent; }
.portfolio-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.portfolio-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
}

@media (hover: hover) {
  .portfolio-item:hover { box-shadow: var(--shadow-md); }
  .portfolio-item:hover img { transform: scale(1.01); transition: transform var(--transition-slow); }
}

/* Lightbox styles live in /lightbox.css (shared with the homepage). */

/* Footer (needed for shared footer) */
.footer { background: var(--bg-secondary); padding: var(--space-3xl) 0 var(--space-lg); border-top: 2px solid rgba(4, 99, 7, 0.32); }
.footer-grid { display: grid; gap: var(--space-2xl); margin-bottom: var(--space-2xl); }
.footer-column h4 { color: var(--text-primary); font-size: 1.125rem; margin-bottom: var(--space-lg); font-weight: 600; }
.footer-column p { color: var(--text-muted); font-size: 0.9375rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: var(--space-sm); }
.footer-links a { color: var(--text-muted); font-size: 0.9375rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { padding-top: var(--space-lg); border-top: 1px solid var(--border); text-align: center; font-size: 0.875rem; color: var(--text-muted); }

@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

@media (max-width: 767px) {
  .footer { padding: var(--space-2xl) 0 var(--space-lg); }
  .footer-grid { gap: var(--space-xl); margin-bottom: var(--space-xl); }
  .footer-grid > .footer-column { padding-top: var(--space-lg); border-top: 1px solid rgba(4, 99, 7, 0.14); }
  .footer-grid > .footer-column:first-child { padding-top: 0; border-top: 0; }
  .footer-column h4 { margin-bottom: 0.65rem; padding-bottom: 0.5rem; }
  .footer-column h4::after { content: ''; display: block; width: 44px; height: 2px; margin-top: 0.5rem; border-radius: 999px; background: rgba(4, 99, 7, 0.55); }
  .footer-links li { margin-bottom: 0; }
  .footer-links a { display: block; padding: 0.55rem 0; font-size: 1rem; }
}


