/* Fede Nigro — portfolio styles */
:root {
  --bg: #f9f9f9;
  --ink: #233330;        /* logo green-charcoal */
  --heading: #2d2d2e;
  --text: #575757;
  --muted: #737373;
  --line: #dcdcdc;
  --card: #ffffff;
  --max: 980px;
  --gutter: clamp(16px, 5vw, 48px);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 19px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
a:hover { opacity: .75; }

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

/* Header */
.site-header { padding: 40px 0 24px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo img { height: 24px; width: auto; }
.nav { display: flex; gap: 24px; }
.nav a {
  text-decoration: none; text-transform: uppercase; letter-spacing: .12em;
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.nav a[aria-current="page"] { border-bottom: 1px solid currentColor; }

/* Type */
h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 300; letter-spacing: -.01em; }
h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 400; margin: 72px 0 16px; }
h3 { font-size: clamp(19px, 2.4vw, 23px); font-weight: 600; margin: 40px 0 8px; color: var(--heading); }
h4 { font-size: 15px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { font-weight: 600; color: var(--heading); }

/* Home */
.intro { padding: 72px 0 40px; }
.intro h1 { max-width: 18em; }
.section-label { font-size: 17px; font-weight: 500; color: var(--muted); margin: 56px 0 8px; }
.work-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.work-list li { margin: 0; border-bottom: 1px solid var(--line); }
.work-item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 22px 0; text-decoration: none; }
a.work-item:hover { opacity: 1; }
a.work-item:hover .work-title { text-decoration: underline; text-underline-offset: 4px; }
.work-title { font-size: clamp(20px, 2.6vw, 26px); font-weight: 400; color: var(--heading); }
.work-meta { font-size: 15px; color: var(--muted); text-align: right; white-space: nowrap; }
.work-item .soon { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 640px) {
  .work-item { flex-direction: column; gap: 4px; }
  .work-meta { text-align: left; white-space: normal; }
}
.tags { font-size: 17px; color: var(--text); max-width: 40em; }

/* Case study */
.case-head { padding: 56px 0 32px; text-align: center; }
.case-head p { font-size: 21px; color: var(--muted); margin-top: 12px; }
.case figure { margin: 40px 0; }
.case figure a { display: block; }
.case figcaption { font-size: 15px; color: var(--muted); margin-top: 10px; text-align: center; }
.case .hero { margin-top: 0; }
.case .narrow { max-width: 720px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px 40px; margin: 40px 0; font-size: 17px; }
.meta-grid ul { list-style: none; padding: 0; margin: 0; }
.grid { display: grid; gap: 20px; margin: 40px 0; }
.grid figure { margin: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
.badges { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 20px; }
.badges img { height: 40px; width: auto; }
.brand-logo { width: 180px; margin: 0 auto; }
.embed { position: relative; aspect-ratio: 16 / 10; margin: 40px 0; border: 1px solid var(--line); background: #fff; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.callout { margin: 72px 0 0; padding: 32px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.callout p { margin: 0; }

.next-case { margin-top: 96px; padding-top: 32px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 17px; }
.next-case a { text-decoration: none; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; padding: 56px 0 0; }
.about img { border-radius: 4px; }
.about h1 { margin-bottom: 24px; }
.button {
  display: inline-block; margin-top: 12px; padding: 12px 24px; border: 1px solid var(--ink);
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.button:hover { background: var(--ink); color: var(--bg); opacity: 1; }
@media (max-width: 720px) { .about { grid-template-columns: 1fr; gap: 32px; } }

/* Footer */
.site-footer { margin-top: 120px; padding: 32px 0 48px; border-top: 1px solid var(--line); font-size: 15px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; }

/* ===== Interactions (see js/site.js) ===== */

/* 1. Fade-in on scroll. Only active when the head snippet added .js-motion
   (script running, motion allowed); otherwise everything is simply visible. */
.js-motion :is(.intro > *, .section-label, .work-list li, .tags, .about > *, .case-head > *,
  .meta-grid > div, .narrow > *, .case > figure, .grid > figure, .embed, .callout):not(.in) {
  opacity: 0;
  transform: translateY(28px);
}
.js-motion :is(.intro > *, .section-label, .work-list li, .tags, .about > *, .case-head > *,
  .meta-grid > div, .narrow > *, .case > figure, .grid > figure, .embed, .callout) {
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
}

/* 2. Home page project rows */
a.work-item { transition: padding-left .35s cubic-bezier(.2, .7, .2, 1); }
a.work-item .work-title::after {
  content: "→";
  display: inline-block;
  margin-left: .45em;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .3s ease, transform .35s cubic-bezier(.2, .7, .2, 1);
}
a.work-item:hover, a.work-item:focus-visible { padding-left: 12px; }
a.work-item:hover .work-title, a.work-item:focus-visible .work-title { text-decoration: none; }
a.work-item:hover .work-title::after, a.work-item:focus-visible .work-title::after { opacity: 1; transform: none; }
.work-list li { transition: background-color .3s ease; }
.work-list li:has(a.work-item:hover) { background: rgba(35, 51, 48, .035); }

/* 3. Reading progress bar */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50;
  background: var(--ink);
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
}

/* 4. Full-screen images */
.zoomable { cursor: zoom-in; }
a.zoomable:hover { opacity: 1; }
.case figure img { transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease; }
.case figure .zoomable:hover img, .case figure img.zoomable:hover {
  transform: scale(1.01);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .35);
}
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 56px 72px; border: 0;
  background: rgba(20, 24, 23, .94);
  display: none; align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; animation: lb-in .25s ease; }
.lightbox::backdrop { background: transparent; }
.lightbox img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; cursor: zoom-out; border-radius: 2px;
}
.lightbox button {
  position: absolute; border: 0; background: none; color: #fff; cursor: pointer;
  font: 300 44px/1 var(--font); padding: 8px 14px; opacity: .75;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; color: rgba(255,255,255,.7); font-size: 14px; letter-spacing: .08em; }
@media (max-width: 640px) { .lightbox { padding: 56px 12px; } }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
