/* ────────────────────────────────────────────────────────────
   global.css — shared across all four pages
   ──────────────────────────────────────────────────────────── */

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

:root {
  --ink:       #0d0b08;
  --parchment: #e8e0d0;
  --bone:      #c9bfa8;
  --gold:         #b8922a;
  --bright-gold:  #f9c639;
}

html, body {
  height: 100%;
  font-family: 'Cormorant Garamond', serif;
  color: var(--parchment);
  overflow: hidden;
  background: var(--ink);
}

/* ── FIXED BACKGROUND ───────────────────────────────────────── */
.bg-fixed { position: fixed; inset: 0; z-index: 0; }
.bg-fixed img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  /* filter applied inline per-page via PHP */
}
.bg-fixed::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(13,11,8,0.05);
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.layout { position: fixed; inset: 0; z-index: 1; display: flex; }

/* ── LEFT SIDEBAR ───────────────────────────────────────────── */
.left {
  user-select: none; -webkit-user-select: none;
  position: relative;
  width: 25%; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 8vh 5vw 8vh 3vw;
}
/* Legibility scrim: darkens behind the sidebar text, fades out to the right
   so the brighter background image stays visible across the rest of the page. */
.left::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(
    100deg,
    rgba(13,11,8,0.62) 0%,
    rgba(13,11,8,0.42) 55%,
    rgba(13,11,8,0) 100%
  );
  pointer-events: none;
}
.left-top {
  display: flex; flex-direction: row; align-items: flex-start;
  margin-bottom: 25px;
}

/* Avatar */
.hero-avatar-wrap {
  position: relative; width: 110px; height: 110px;
  flex-shrink: 0; opacity: 0; animation: fadeUp 1s 0.3s forwards;
}
.hero-avatar {
  width: 110px; height: 110px; border-radius: 50%; overflow: hidden;
  border: 1.5px solid rgba(184,146,42,0.5);
  box-shadow: 0 0 0 3px rgba(184,146,42,0.1), 0 4px 18px rgba(0,0,0,0.45);
}
.hero-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  -webkit-user-drag: none; user-drag: none;
  -webkit-user-select: none; user-select: none;
  pointer-events: none;
}
/* Words section: zoom the avatar in a bit more. */
.mc-page--words .hero-avatar img {
  transform: scale(1.18);
  transform-origin: center top;
}

/* Pulse ring on long-press */
.hero-avatar-wrap::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid transparent;
  pointer-events: none; transition: border-color 0.3s;
}
.hero-avatar-wrap.pressing::after,
.hero-avatar-wrap:has(.hero-avatar.pressing)::after {
  border-color: rgba(184,146,42,0.7);
  animation: avatarPulseRing 1.5s ease-in-out infinite;
}

/* Nav pills */
.hero-role-stack {
  opacity: 0; animation: fadeUp 1s 0.4s forwards;
  position: absolute; top: -7px; left: 0;
  width: 320px; height: 110px;
  display: flex; flex-direction: column;
  justify-content: space-around; gap: 4px;
  padding: 6px 0; pointer-events: none;
}
.hero-role-stack span,
.hero-role-stack a {
  font-size: clamp(0.78rem, 0.95vw, 0.92rem);
  font-style: italic; font-weight: 600;
  color: var(--parchment); letter-spacing: 0.12em;
  text-transform: uppercase; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  display: flex; align-items: center; gap: 0.4em;
  justify-content: space-between;
  white-space: nowrap; text-decoration: none;
  cursor: pointer; pointer-events: all;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  background: rgba(0,0,0,0.32);
  border: 1px solid #ffffff52;
  border-radius: 6px; padding: 4px 8px 4px 6px;
}
.hero-role-stack a:hover {
  border-color: var(--gold);
}
.hero-role-stack .nav-active {
  color: var(--ink); cursor: pointer;
  background: var(--gold);
  border-color: var(--gold);
  text-shadow: none;
}
.hero-role-stack .nav-active::after {
  content: '‣'; font-style: normal; font-size: 1.3em;
  color: inherit; margin-left: auto;
  line-height: 0; position: relative; top: 0.05em;
}

/* Crafts hidden nav */
.nav-crafts {
  pointer-events: none !important;
  color: transparent !important;
  background: rgba(0,0,0,0.1) !important;
  border-color: transparent !important;
  text-shadow: none !important;
  transition: color 0.4s, background 0.4s, border-color 0.4s;
  opacity: 1 !important;
}
.nav-crafts.revealed {
  pointer-events: all !important;
  color: var(--parchment) !important;
  background: rgba(0,0,0,0.32) !important;
  border-color: #ffffff52 !important;
  cursor: pointer;
}
.nav-crafts.revealed:hover {
  border-color: var(--gold) !important;
}
.nav-crafts.nav-active.revealed {
  color: var(--ink) !important;
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  text-shadow: none;
}

/* Hero name & bio */
.left-bottom {
  display: flex; flex-direction: column; justify-content: flex-end;
  width: fit-content;
}
.hero-name {
  font-family: 'Playfair Display', serif; font-weight: 900;
  font-size: clamp(1.8rem, 3.2vw, 4rem); line-height: 0.95;
  letter-spacing: -0.02em; color: var(--parchment);
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  opacity: 0; animation: fadeUp 1s 0.6s forwards;
}
/* Logo wordmark variant: matches the visual size of the text name. */
.hero-name--logo { margin: 0; }
.hero-name-logo {
  display: block;
  height: clamp(2.2rem, 5vw, 6.8rem);
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
}
.hero-name em { font-style: italic; color: var(--bone); display: block; }
.hero-about {
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  font-style: italic; font-weight: 300;
  color: var(--parchment); line-height: 1.7;
  text-shadow: 0 1px 4px rgba(0,0,0,0.75);
  opacity: 0; animation: fadeUp 1s 0.5s forwards;
  margin-top: 1rem;
}
.hero-about p + p { margin-top: 0.8rem; }

/* Bilingual bio toggling */
.bio-ro { display: none; }
.bio-en { display: block; }
.lang-ro .bio-ro { display: block; }
.lang-ro .bio-en { display: none; }

/* Contact pill under the bio — mirrors .hero-role-stack pills */
.hero-contact-nav {
  margin-top: 1.6rem;
  display: flex; justify-content: flex-end;
  opacity: 0; animation: fadeUp 1s 0.7s forwards;
}
.hero-contact-pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  justify-content: space-between;
  font-size: clamp(0.78rem, 0.95vw, 0.92rem);
  font-style: italic; font-weight: 600;
  color: var(--bright-gold); letter-spacing: 0.12em;
  text-transform: uppercase; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap; text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(184,146,42,0.7);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  border-radius: 6px; padding: 7px 10px 7px 12px;
}
.hero-contact-pill:hover {
  border-color: var(--gold);
}
.hero-contact-pill.nav-active {
  color: var(--ink); cursor: default;
  background: var(--gold); border-color: var(--gold);
  text-shadow: none;
}
.hero-contact-pill.nav-active::after {
  content: '‣'; font-style: normal; font-size: 1.3em;
  color: inherit; margin-left: 0.3em;
  line-height: 0; position: relative; top: 0.05em;
}

/* ── RIGHT PANEL (shared base) ──────────────────────────────── */
.right {
  flex: 1; overflow-y: scroll; overflow-x: hidden;
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,146,42,0.25) transparent;
}
.right::-webkit-scrollbar { width: 4px; }
.right::-webkit-scrollbar-track { background: transparent; }
.right::-webkit-scrollbar-thumb { background: rgba(184,146,42,0.2); border-radius: 2px; }

/* ── PAGE TITLE + SUBTITLE (shared across all pages) ─────────── */
.page-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 400; font-style: italic;
  color: var(--parchment);
  margin-bottom: 0.2em; flex-shrink: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.page-sub {
  font-size: 0.95rem; color: var(--parchment); font-style: italic;
  opacity: 0.9; flex-shrink: 0;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

/* ── SCROLL HINT ────────────────────────────────────────────── */
.scroll-hint {
  position: fixed; bottom: 3rem; right: 1.8rem; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.scroll-hint.visible { opacity: 1; }
.scroll-hint span {
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bone); writing-mode: vertical-rl; opacity: 0.6;
}
.scroll-line {
  width: 1px; height: 50px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: pulse-line 2s 2s infinite;
}

/* ── ANIMATIONS ─────────────────────────────────────────────── */

/* After the first page load in a session, the left rail appears instantly
   instead of replaying its entrance animation on every navigation. The
   `mc-seen` body class is set by an inline script in the footer. */
body.mc-seen .hero-avatar-wrap,
body.mc-seen .hero-role-stack,
body.mc-seen .hero-name,
body.mc-seen .hero-about,
body.mc-seen .hero-contact-nav {
  opacity: 1;
  animation: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-line { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes avatarPulseRing {
  0%, 100% { box-shadow: 0 0 0 0px rgba(184,146,42,0.4); border-color: rgba(184,146,42,0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(184,146,42,0);   border-color: rgba(184,146,42,0.9); }
}

@media (max-width: 1520px) {
  html, body { overflow: hidden auto; }
  .layout { position: relative; flex-direction: column; overflow: visible; }

  /* Mobile/tablet browsers resize the visual viewport when the URL bar hides
     on scroll. A viewport-sized position:fixed background gets resized with it,
     causing the image to shift then snap back. Pin it to the LARGE viewport
     height (the tallest the viewport ever gets) so URL-bar changes don't move
     it, and over-size slightly to hide any sub-pixel seam at the edges. */
  .bg-fixed {
    height: 100lvh;
    min-height: 100vh;
    top: 0; left: 0; right: 0; bottom: auto;
  }
  .bg-fixed img {
    height: 100lvh;
    min-height: 100vh;
  }

  .left {
    width: 100%; min-height: 0;
    padding: 2vh 6vw 1.5vh;
    justify-content: flex-start; gap: 1rem;
  }
  .left-bottom { margin-top: 0; }
  .right { overflow: visible; flex: none; }
  .scroll-hint { display: none; }
}

/* ── PHONE-ONLY OVERRIDES ───────────────────────────────────── */
@media (max-width: 640px) {
  /* On phones the sidebar is full-width and stacked above the content, so the
     desktop's left-to-right fade leaves the right edge of the bio over a bright
     area. Use an even vertical scrim behind the left text instead. */
  .left::before {
    background: linear-gradient(
      to bottom,
      rgba(13,11,8,0.72) 0%,
      rgba(13,11,8,0.55) 100%
    );
  }

  /* Right-pane panels: no left border or rounded corners on phones. */
  .words-section-wrap,
  .images-section-wrap,
  .video-section-wrap,
  .crafts-section-wrap,
  .contact-section-wrap {
    border-left: none !important;
    border-radius: 0 !important;
  }

  /* Move CONTACT up next to the name, right-aligned on the same row.
     DOM order in .left-bottom is: name → bio → contact. Flex + order
     pulls the contact pill up onto the name's row, pushed to the right. */
  .left-bottom {
    width: 100%;
    flex-direction: row; flex-wrap: wrap;
    align-items: center;
  }
  .hero-name--logo {
    order: 1; margin-right: auto;
  }
  .hero-contact-nav {
    order: 2; margin: 0;
    width: auto; justify-content: flex-end;
  }
  .hero-about {
    order: 3; width: 100%;
  }
}
