/* ============================================================
   Riccardo Moricone — Portfolio
   Editorial dark theme
   ============================================================ */

:root {
  --bg:        #0b0b0c;
  --bg-soft:   #141416;
  --bg-card:   #161618;
  --text:      #e9e5de;
  --muted:     #9a948b;
  --line:      rgba(233, 229, 222, 0.14);
  --line-soft: rgba(233, 229, 222, 0.07);
  --accent:    #c2a878;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1320px;
  --gap: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #0b0b0c; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.section { padding-block: clamp(72px, 11vw, 150px); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  padding-block: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.16em;
  font-weight: 600;
  line-height: 1;
}
.brand span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: clamp(20px, 3vw, 42px); list-style: none; }
.nav-links a {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  transition: color 0.3s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1px; background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* mobile toggle */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 22px; position: relative; }
.nav-toggle span { position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--text); transition: transform 0.35s var(--ease), opacity 0.25s var(--ease); }
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { top: 18px; }
body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding-bottom: clamp(48px, 8vw, 96px);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(11,11,12,0.92) 0%, rgba(11,11,12,0.35) 45%, rgba(11,11,12,0.55) 100%);
}
.hero-inner { max-width: 900px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(54px, 12vw, 150px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  margin: 18px 0 0;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub {
  margin-top: 26px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.hero-sub .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue .line { width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0%,100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- Intro / about strip ---------- */
.intro p {
  font-family: var(--serif);
  font-size: clamp(24px, 3.6vw, 42px);
  line-height: 1.32;
  font-weight: 300;
  max-width: 19ch;
}
.intro .lead-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(32px, 6vw, 90px); align-items: end; }
.intro .meta { color: var(--muted); font-size: 15px; }
.intro .meta strong { color: var(--text); font-weight: 600; }
.intro .meta p + p { margin-top: 16px; }

/* ---------- Featured / category cards ---------- */
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(34px, 5vw, 60px); flex-wrap: wrap; }
.work-head h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 5vw, 56px); line-height: 1; }

.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.cat {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 3/4; background: var(--bg-card);
}
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter 0.6s var(--ease); filter: grayscale(0.15) brightness(0.82); }
.cat:hover img { transform: scale(1.06); filter: grayscale(0) brightness(0.9); }
.cat-label { position: absolute; left: 0; bottom: 0; right: 0; padding: 26px; display: flex; align-items: flex-end; justify-content: space-between; background: linear-gradient(to top, rgba(11,11,12,0.8), transparent); }
.cat-label h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; }
.cat-label .arrow { font-size: 20px; color: var(--accent); transform: translateX(-6px); opacity: 0; transition: 0.4s var(--ease); }
.cat:hover .cat-label .arrow { transform: translateX(0); opacity: 1; }
.cat .count { position: absolute; top: 18px; right: 20px; font-size: 11px; letter-spacing: 0.2em; color: var(--text); opacity: 0.7; }

/* ---------- Gallery (masonry) ---------- */
.page-head { padding-top: clamp(130px, 16vw, 190px); padding-bottom: clamp(28px, 5vw, 56px); }
.page-head h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(44px, 9vw, 104px); line-height: 0.95; margin-top: 12px; }
.page-head p { color: var(--muted); max-width: 56ch; margin-top: 22px; font-size: 16px; }

.masonry { columns: 3; column-gap: var(--gap); }
.masonry .shot { break-inside: avoid; margin-bottom: var(--gap); position: relative; overflow: hidden; background: var(--bg-card); cursor: zoom-in; }
.masonry .shot img { width: 100%; transition: transform 1s var(--ease), filter 0.6s var(--ease); filter: brightness(0.92); }
.masonry .shot:hover img { transform: scale(1.045); filter: brightness(1); }
.masonry .shot::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  pointer-events: none;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.masonry .shot.reveal { transition-delay: var(--d, 0s); }

/* ---------- Notice (boudoir) ---------- */
.notice {
  border: 1px solid var(--line); border-radius: 2px;
  padding: 20px 24px; margin-top: 30px;
  color: var(--muted); font-size: 14px; max-width: 60ch;
  display: flex; gap: 14px; align-items: flex-start;
}
.notice b { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line-soft); }
.contact .big { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 8vw, 96px); line-height: 1; }
.contact .big a { transition: color 0.3s var(--ease); }
.contact .big a:hover { color: var(--accent); }
.contact-row { display: flex; flex-wrap: wrap; gap: 40px 70px; margin-top: clamp(40px, 6vw, 70px); }
.contact-item .eyebrow { display: block; margin-bottom: 10px; }
.contact-item a, .contact-item span { font-size: 17px; }
.contact-item a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-soft); padding-block: 34px; }
.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer .brand { font-size: 19px; }
.footer small { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
.footer nav { display: flex; gap: 24px; }
.footer nav a { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); transition: color 0.3s var(--ease); }
.footer nav a:hover { color: var(--text); }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(8,8,9,0.97); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.35s var(--ease); }
.lb.open { display: flex; opacity: 1; }
.lb img { max-width: 92vw; max-height: 86vh; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,0.6); user-select: none; }
.lb-close, .lb-nav { position: absolute; background: none; border: 0; color: var(--text); cursor: pointer; opacity: 0.7; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.lb-close:hover, .lb-nav:hover { opacity: 1; }
.lb-close { top: 24px; right: 28px; font-size: 30px; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 40px; padding: 16px; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-nav.prev:hover { transform: translateY(-50%) translateX(-4px); }
.lb-nav.next:hover { transform: translateY(-50%) translateX(4px); }
.lb-counter { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: 0.24em; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cats { grid-template-columns: 1fr 1fr; }
  .masonry { columns: 2; }
  .intro .lead-grid { grid-template-columns: 1fr; align-items: start; gap: 30px; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center;
    background: rgba(11,11,12,0.97); backdrop-filter: blur(10px);
    gap: 34px; transform: translateY(-100%); transition: transform 0.5s var(--ease);
  }
  body.menu-open .nav-links { transform: none; }
  .nav-links a { font-size: 17px; letter-spacing: 0.18em; }
  .cats { grid-template-columns: 1fr; }
  .cat { aspect-ratio: 4/5; }
  .masonry { columns: 1; }
  .lb-nav { font-size: 30px; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
