/* ============================================
   FRANCESCO D'ISA — PORTFOLIO
   Design system: editorial minimalism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Jost:wght@300;400;500&display=swap');

/* ---- Variables ---- */
:root {
  --bg:        #F8F6F2;
  --text:      #111110;
  --muted:     #888580;
  --accent:    #111110;
  --border:    #DDD9D3;
  --serif:     'Cormorant Garamond', Georgia, serif;
  --sans:      'Jost', sans-serif;
  --max:       1100px;
  --gutter:    clamp(1.5rem, 5vw, 4rem);
  --nav-h:     72px;
  --transition: 0.3s ease;
}

/* ---- 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-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* ---- Navigation ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
}

nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  list-style: none;
}

.nav-links a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--text);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text);
  transition: all var(--transition);
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
  }

  .nav-links.open { display: flex; }
  .nav-links a { font-size: 0.85rem; }
}

/* ---- Page wrapper ---- */
main {
  flex: 1;
  padding-top: var(--nav-h);
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Page header (used in inner pages) ---- */
.page-header {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.page-header h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.page-header p {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Home hero ---- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--gutter);
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}

.hero-text h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.9s ease forwards 0.2s;
}

.hero-text h1 em {
  font-style: italic;
  font-weight: 300;
}

.hero-text .hero-sub {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.5s;
}

.hero-text .hero-nav-links {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  list-style: none;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.7s;
}

.hero-text .hero-nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
}

.hero-text .hero-nav-links a:hover {
  color: var(--text);
  border-color: var(--text);
}

.hero-image {
  opacity: 0;
  animation: fadeIn 1.2s ease forwards 0.4s;
}

.hero-image img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: grayscale(8%);
}

@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
  }
  .hero-image { order: -1; }
  .hero-image img { aspect-ratio: 3/2; }
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.about-bio p {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 300;
  line-height: 1.75;
  margin-bottom: 1.6rem;
  color: var(--text);
}

.about-bio p:last-child { margin-bottom: 0; }

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo img { aspect-ratio: 3/2; }
}

/* ---- Artworks grid ---- */
.artworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  margin-bottom: clamp(4rem, 8vw, 7rem);
  background: var(--border);
}

.artwork-item {
  background: var(--bg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.artwork-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.4s ease;
  filter: grayscale(5%);
}

.artwork-item:hover img {
  transform: scale(1.03);
  filter: grayscale(0%);
}

.artwork-caption {
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.artwork-caption h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.2;
}

.artwork-caption span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,17,16,0.95);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem; right: 1.5rem;
  background: none;
  border: none;
  color: #F8F6F2;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover { opacity: 1; }

/* ---- Books ---- */
.books-list {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.book-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--border);
}

.book-item:last-child { border-bottom: none; }

.book-cover img {
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.book-info h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.book-info .book-meta {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.book-info p {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 1.2rem;
}

.book-info a.btn-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
}

.book-info a.btn-link:hover {
  color: var(--muted);
  border-color: var(--muted);
}

@media (max-width: 600px) {
  .book-item { grid-template-columns: 1fr; }
  .book-cover { max-width: 140px; }
}

/* ---- Articles ---- */
.articles-list {
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.article-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.5rem 2rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: background var(--transition);
}

.article-item:first-child { border-top: 1px solid var(--border); }

.article-item:hover { background: rgba(0,0,0,0.015); }

.article-date {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.25rem;
}

.article-info h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.article-info h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.article-info .article-source {
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-info p {
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
}

@media (max-width: 500px) {
  .article-item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ---- Videos ---- */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.video-item h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  margin-top: 0.8rem;
  line-height: 1.3;
}

.video-item span {
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #1a1a1a;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.4s, transform 0.5s;
}

.video-thumb:hover img { opacity: 1; transform: scale(1.03); }

.video-thumb .play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.video-thumb:hover .play-btn { opacity: 1; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer small {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
}

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

/* ---- Animations ---- */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
