/* ============================================
   JACOPO MAIO — PORTFOLIO
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Tokens ────────────────────────────────── */
:root {
  --ink:       #231E1D;
  --secondary: #4A4040;
  --muted:     #898073;
  --pale:      #F0F2F1;
  --white:     #FFFFFF;
  --blue:      #2563EB;
  --blue-bg:   #EBF1FD;
  --line:      rgba(35, 30, 29, 0.1);

  --font: 'Inter', system-ui, sans-serif;

  --ease:     cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  --max-w:  1160px;
  --gutter: clamp(24px, 5vw, 80px);
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--white); color: var(--ink); font-size: 16px; line-height: 1.6; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ─── Layout ─────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(64px, 10vw, 120px) 0; }

/* ─── Nav ────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 16px rgba(35,30,29,0.05); }

.nav__logo { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.nav__logo span { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }

.nav__links { display: flex; gap: 32px; align-items: center; }
.nav__links a { font-size: 13px; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.nav__links a:hover { color: var(--ink); }
.nav__links .btn-nav { background: var(--blue); color: var(--white); padding: 8px 18px; border-radius: 100px; font-size: 13px; font-weight: 500; transition: background 0.2s; }
.nav__links .btn-nav:hover { background: #1D4ED8; color: var(--white); }

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 100px;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.2s var(--ease);
}
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: #1D4ED8; transform: translateY(-1px); }
.btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--outline:hover { border-color: var(--ink); }
.btn svg { transition: transform 0.2s; }
.btn:hover svg { transform: translateX(3px); }

/* ─── Tags ───────────────────────────────────── */
.tag { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; background: var(--pale); color: var(--secondary); }
.tag--blue { background: var(--blue-bg); color: var(--blue); }
.tag--platform { display: inline-flex; align-items: center; gap: 4px; }

/* ─── Typography ─────────────────────────────── */
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.eyebrow--blue { color: var(--blue); }

h1, .h1 { font-size: clamp(44px, 6.5vw, 88px); line-height: 1.0; letter-spacing: -0.03em; font-weight: 700; }
h2, .h2 { font-size: clamp(28px, 3.5vw, 48px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }
h3, .h3 { font-size: clamp(20px, 2vw, 28px); line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
h4, .h4 { font-size: 14px; font-weight: 600; }

p { color: var(--secondary); line-height: 1.75; }
p + p { margin-top: 16px; }
.lead { font-size: clamp(16px, 1.8vw, 19px); line-height: 1.65; color: var(--secondary); }

/* ─── Hero ───────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 140px var(--gutter) clamp(56px, 8vw, 88px);
  background: var(--white);
}
.hero__inner { max-width: var(--max-w); margin: 0 auto; width: 100%; display: grid; grid-template-columns: 280px minmax(auto, 520px); gap: 48px; align-items: center; justify-content: center; }
.hero__headline { font-size: clamp(48px, 7.5vw, 100px); line-height: 0.97; letter-spacing: -0.03em; font-weight: 700; color: var(--ink); }
.hero__headline em { font-style: italic; font-weight: 300; color: var(--muted); }
.hero__meta p { font-size: 15px; line-height: 1.7; color: var(--secondary); margin-bottom: 28px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Stats bar ──────────────────────────────── */
.stats-bar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; background: var(--white); }
.stats-bar__inner { display: flex; gap: 0; }
.stat { flex: 1; border-right: 1px solid var(--line); padding: 0 clamp(16px, 2.4vw, 36px); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: none; padding-right: 0; }
.stat__num { font-size: clamp(20px, 2.2vw, 30px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.stat__num--positive { color: #16a34a; }
.stat__label { font-size: 11px; color: var(--muted); line-height: 1.4; max-width: 120px; }
.stat__platforms { display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* ─── Section header ─────────────────────────── */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: clamp(40px, 5vw, 56px); gap: 24px; }
.section-header h2 { margin-top: 6px; }

/* ─── Work list ──────────────────────────────── */
.work-list { display: flex; flex-direction: column; gap: 12px; }

.work-card {
  display: grid; grid-template-columns: 52px 1fr 40px;
  align-items: center; gap: 28px;
  padding: 28px 32px;
  border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: inherit;
  background: var(--white);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.work-card:hover {
  box-shadow: 0 8px 40px rgba(35,30,29,0.09);
  border-color: rgba(35,30,29,0.18);
  transform: translateY(-2px);
}

.work-card__num { font-size: 12px; color: var(--muted); font-weight: 400; align-self: flex-start; padding-top: 4px; }
.work-card__logo {
  width: 52px; height: 52px; flex-shrink: 0; align-self: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 8px; overflow: hidden;
}
.work-card__logo img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.work-card__body { min-width: 0; }
.work-card__tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.work-card__title { font-size: clamp(18px, 2vw, 24px); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 8px; line-height: 1.2; transition: color 0.2s; }
.work-card:hover .work-card__title { color: var(--blue); }
.work-card__desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; max-width: 640px; }
.work-card__outcomes { display: flex; gap: 20px; flex-wrap: wrap; }
.work-card__outcome { font-size: 12px; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 5px; }
.work-card__outcome::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }

.work-card__arrow {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; align-self: center;
  transition: all 0.2s; color: var(--muted);
}
.work-card:hover .work-card__arrow { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ─── About ──────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }

.profile-photo { border-radius: 12px; overflow: hidden; aspect-ratio: 4/5; background: var(--pale); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.skill-group__label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.skill-group__items { display: flex; flex-direction: column; gap: 6px; }
.skill-item { font-size: 13px; color: var(--secondary); padding: 6px 0; border-bottom: 1px solid var(--line); }

.experience-list { margin-top: 32px; }
.exp-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.exp-item:first-child { border-top: 1px solid var(--line); }
.exp-item__company { font-size: 14px; font-weight: 600; color: var(--ink); }
.exp-item__role { font-size: 13px; color: var(--muted); margin-top: 2px; }
.exp-item__period { font-size: 11px; color: var(--blue); font-weight: 500; margin-top: 3px; }

/* ─── CTA section ────────────────────────────── */
.cta-section { border-top: 1px solid var(--line); padding: clamp(64px, 8vw, 96px) 0; }

/* ─── Footer ─────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 40px var(--gutter); }
.footer__inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__logo { font-size: 14px; font-weight: 600; color: var(--ink); }
.footer__links { display: flex; gap: 24px; }
.footer__links a { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.footer__links a:hover { color: var(--ink); }
.footer__copy { font-size: 12px; color: var(--muted); }

/* ─── Case Study Hero ────────────────────────── */
.cs-hero { padding: 160px var(--gutter) 72px; }
.cs-hero--dark { background: var(--ink); }
.cs-hero--fandom { background: linear-gradient(135deg, #0D1B4B 0%, #162A5A 60%, #1A3580 100%); }
.cs-hero--app { background: linear-gradient(135deg, #0F0F1E 0%, #1A1A2E 60%, #16213E 100%); }
.cs-hero--web { background: linear-gradient(135deg, #062014 0%, #0F4C35 60%, #0D5C3A 100%); }

.cs-hero__inner { max-width: var(--max-w); margin: 0 auto; }
.cs-hero__back { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.5); margin-bottom: 40px; transition: color 0.2s; }
.cs-hero__back:hover { color: var(--white); }
.cs-hero__back svg { transition: transform 0.2s; }
.cs-hero__back:hover svg { transform: translateX(-3px); }
.cs-hero--dark .tag, .cs-hero--fandom .tag, .cs-hero--app .tag, .cs-hero--web .tag { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.cs-hero--dark .tag--blue, .cs-hero--fandom .tag--blue, .cs-hero--app .tag--blue, .cs-hero--web .tag--blue { background: rgba(37,99,235,0.3); color: #93B4F8; }
.cs-hero__tags { margin-bottom: 20px; display: flex; gap: 6px; flex-wrap: wrap; }
.cs-hero h1 { color: var(--white); }
.cs-hero .lead { color: rgba(255,255,255,0.7); max-width: 640px; margin-top: 20px; }
.cs-hero .eyebrow { color: rgba(255,255,255,0.4); }

.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; margin-top: 48px; }
.cs-meta__item { background: rgba(255,255,255,0.05); padding: 18px 22px; }
.cs-meta__label { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 5px; }
.cs-meta__value { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.9); }

/* ─── Case Study Content ─────────────────────── */
.cs-content { padding: 72px var(--gutter); }
.cs-content__inner { max-width: 760px; margin: 0 auto; }
.cs-section { margin-bottom: 64px; }
.cs-section h2 { margin-bottom: 20px; }
.cs-section h3 { margin-bottom: 14px; font-size: clamp(17px, 1.8vw, 22px); }
.cs-section p { font-size: 16px; line-height: 1.8; color: var(--secondary); }
.cs-section p + p { margin-top: 14px; }

.cs-section ul { margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.cs-section ul li { font-size: 15px; color: var(--secondary); padding-left: 16px; position: relative; line-height: 1.6; }
.cs-section ul li::before { content: ''; position: absolute; left: 0; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }

.cs-full-width { padding: 0 var(--gutter); max-width: var(--max-w); margin: 0 auto 64px; }

.cs-image { border-radius: 10px; overflow: hidden; background: var(--pale); }
.cs-image img { width: 100%; height: auto; }
.cs-caption { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; font-style: italic; }

.cs-image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cs-image-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.cs-callout { background: var(--pale); border-left: 3px solid var(--blue); padding: 20px 24px; border-radius: 0 8px 8px 0; margin: 28px 0; }
.cs-callout p { font-size: 18px; font-style: italic; color: var(--ink); line-height: 1.55; font-weight: 400; }
.cs-callout cite { display: block; margin-top: 10px; font-size: 11px; color: var(--muted); font-style: normal; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

.cs-outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; margin: 40px 0; }
.cs-outcome { background: var(--white); padding: 24px; }
.cs-outcome__num { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; color: var(--blue); line-height: 1; margin-bottom: 6px; }
.cs-outcome__label { font-size: 13px; color: var(--secondary); line-height: 1.4; }

.cs-process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; margin: 28px 0; }
.cs-process__step { background: var(--pale); padding: 20px; }
.cs-process__step-num { font-size: 28px; font-weight: 700; color: rgba(35,30,29,0.1); margin-bottom: 6px; line-height: 1; }
.cs-process__step-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.cs-process__step-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ─── Full-width image band ───────────────────── */
.cs-full-images { padding: clamp(40px, 5vw, 72px) var(--gutter); }
.cs-full-images__inner { max-width: var(--max-w); margin: 0 auto; }
.img-showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.img-showcase img { width: 100%; height: auto; border-radius: 8px; object-fit: cover; }
.img-showcase .img-wide { grid-column: span 2; }

.research-slides { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0; }
.research-slide { border-radius: 8px; overflow: hidden; background: var(--pale); }
.research-slide img { width: 100%; height: auto; display: block; }

/* ─── Insight grid ───────────────────────────── */
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.insight-card { background: var(--pale); border-radius: 10px; padding: 20px; }
.insight-card__icon { font-size: 24px; margin-bottom: 10px; }
.insight-card__title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.insight-card__text { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ─── Next project ───────────────────────────── */
.next-project { border-top: 1px solid var(--line); padding: clamp(48px, 6vw, 80px) var(--gutter); text-align: center; }
.next-project h2 { margin: 10px 0 20px; }

/* ─── Fade in ────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out); }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up:nth-child(2) { transition-delay: 0.08s; }
.fade-up:nth-child(3) { transition-delay: 0.16s; }
.fade-up:nth-child(4) { transition-delay: 0.24s; }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .cs-meta { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-card__visual { min-height: 200px; }
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .work-card { grid-template-columns: 1fr; gap: 12px; padding: 22px 20px; }
  .work-card__num { display: none; }
  .work-card__logo { display: none; }
  .work-card__arrow { display: none; }
  .work-card__outcomes { gap: 10px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .stats-bar__inner { flex-wrap: wrap; gap: 24px 0; }
  .stat { border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 20px 0; flex-basis: 48%; }
  .stat:nth-child(odd) { padding-right: 16px; }
  .stat:nth-last-child(-n+2) { border-bottom: none; padding-bottom: 0; }
  .stat__label { max-width: none; }
  .skills-grid { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: repeat(2, 1fr); }
  .cs-outcomes { grid-template-columns: 1fr; }
  .cs-process { grid-template-columns: repeat(2, 1fr); }
  .cs-image-grid, .research-slides { grid-template-columns: 1fr; }
  .cs-image-grid-3, .img-showcase { grid-template-columns: 1fr; }
  .img-showcase .img-wide { grid-column: span 1; }
  .insight-grid { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; }
}
