/* mugurmihai.com: carries over the look of the 2024 Blocs site. */
:root {
  --bg: #000;
  --text: rgba(255, 255, 255, .8);
  --heading: #fff;
  --muted: rgba(255, 255, 255, .6);
  --light: #ebebeb;
  --accent: #ffc300; /* the one site yellow: active menu and filter, buttons, highlights */
  --accent-hover: #d9a600;
  --header-bg: rgba(0, 0, 0, .63);
  --max: 1400px;
  --tile-pad: 5px; /* space around each card: cards and project images sit 2 × this (10px) apart on every page */
  --radius: 6px; /* corners of every card and image: tiles, poster/project images, pager cards, contact band */
  --font: "IBM Plex Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1 { color: var(--heading); font-weight: 400; font-size: clamp(2rem, 4vw, 2.5rem); line-height: 1.2; margin: 0 0 1.5rem; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding-top: 50px; padding-bottom: 50px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.header-inner { display: flex; align-items: center; flex-wrap: wrap; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-size: 1.25rem; font-weight: 400; }
.brand:hover { color: #ccc; }
.site-nav ul, .site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav { margin-left: auto; }
.site-nav a, .site-footer nav a {
  display: block; padding: .5rem; font-weight: 400; font-size: .95rem;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
  transition: color .3s;
}
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current] { color: var(--accent); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-toggle path { stroke: rgba(255, 255, 255, .6); stroke-width: 2; }
@media (max-width: 767px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; padding-bottom: 1rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

/* Image grids */
/* Side padding keeps the outer edge of the cards in line with the filter pills (20px container + 10px). */
.grid { display: grid; padding: calc(10px - var(--tile-pad)) calc(30px - var(--tile-pad)); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 991px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }
.tile {
  position: relative; display: block; margin: 0; padding: var(--tile-pad);
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.tile-img { width: 100%; background: var(--light); border-radius: var(--radius); }
.tile-caption {
  position: absolute; left: calc(var(--tile-pad) + 20px); bottom: calc(var(--tile-pad) + 16px); right: calc(var(--tile-pad) + 50px);
  font-size: 12px; font-weight: 400; color: #fff; opacity: 0; transition: opacity .3s;
}
.tile-caption.dark { color: #000; }
.tile:hover .tile-caption, .tile:focus-visible .tile-caption { opacity: 1; }
.tile-icon { position: absolute; right: 30px; bottom: 26px; width: 22px; height: 22px; fill: #fff; opacity: .9; }
.logo-tile { cursor: default; }
.tile.plain img { width: 100%; border-radius: var(--radius); }

/* Project pages */
.project-intro { display: grid; gap: 2rem; align-items: start; padding-top: 100px; padding-bottom: 20px; }
.project-intro.has-logo { grid-template-columns: minmax(0, 330px) 1fr; }
.project-logo img, .project-logo video { border-radius: var(--radius); }
.prose p { margin: 0 0 1rem; max-width: 70ch; }
.project-images { display: grid; grid-template-columns: repeat(12, 1fr); gap: calc(2 * var(--tile-pad)); padding-bottom: 40px; }
.project-images > div { grid-column: span 12; }
.project-images .span-6 { grid-column: span 6; }
.project-images .span-4 { grid-column: span 4; }
.shot { width: 100%; border-radius: var(--radius); box-shadow: 0 0 12px rgba(0, 0, 0, .4); }
@media (max-width: 767px) {
  .project-intro.has-logo { grid-template-columns: 1fr; padding-top: 30px; }
  .project-logo { max-width: 260px; }
  .project-images .span-6, .project-images .span-4 { grid-column: span 12; }
}

/* About & contact */
.about { padding-top: 100px; padding-bottom: 100px; }
.about-photo { max-width: 580px; margin-bottom: 1.5rem; }
.about .prose { max-width: 66%; }
@media (max-width: 991px) { .about .prose { max-width: none; } .about { padding-top: 40px; } }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding-top: 70px; padding-bottom: 70px; }
@media (max-width: 991px) { .contact { grid-template-columns: 1fr; } }
.contact-email a { color: #fff; border-bottom: 1px solid var(--muted); }
.contact-form label { display: block; margin-bottom: 1rem; font-weight: 400; }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; margin-top: .5rem; padding: .6rem .75rem;
  font: inherit; font-weight: 400; color: #212529; background: #fff;
  border: 1px solid rgba(0, 0, 0, .1); border-radius: 6px;
}
.btn {
  display: inline-block; padding: .6rem 1.25rem; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--accent); color: rgba(0, 0, 0, .6); font: 400 1.1rem var(--font);
  text-transform: uppercase; letter-spacing: 1px; transition: background .3s;
}
.btn:hover { background: var(--accent-hover); }
.contact-form .btn { width: 100%; margin-top: 1rem; padding: .8rem; }
.contact-form .btn:disabled { opacity: .6; cursor: wait; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-status { margin: 1rem 0 0; min-height: 1.5em; }
.form-thanks { align-self: center; padding: 2.5rem 2rem; border: 1px solid var(--muted); border-radius: 6px; text-align: center; animation: thanks-in .4s ease-out; }
.form-thanks h2 { margin: 0 0 .75rem; font-size: 2rem; color: var(--accent); outline: none; }
.form-thanks p { margin: 0 0 1.75rem; }
.btn-outline { background: transparent; color: #fff; border: 1px solid var(--muted); }
.btn-outline:hover { background: rgba(255, 255, 255, .08); }
@keyframes thanks-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .form-thanks { animation: none; } }

/* Footer */
.site-footer { padding: 20px; text-align: center; }
.site-footer ul { justify-content: center; }
.site-footer nav a { color: var(--light); }
.site-footer nav a:hover { color: #b8b8b8; }
.social { display: flex; justify-content: center; gap: 10px; margin: .5rem 0; }
.social svg { fill: #646464; transition: transform .3s; }
.social a:hover svg { transform: scale(1.2); }
.copyright { margin: .5rem 0 0; font-size: .9rem; color: var(--muted); }

/* Scroll-to-top & lightbox */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 36px; height: 36px; padding: 7px; z-index: 50;
  border: 0; border-radius: 6px; background: rgba(0, 0, 0, .3); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.lightbox { padding: 10px; border: 0; border-radius: 3px; background: var(--light); max-width: min(1100px, 95vw); }
.lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.lightbox img { max-height: 88vh; width: auto; margin: 0 auto; }
.lightbox-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; z-index: 1;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}

/* Home intro, services and the contact band */
.hero { padding-top: 70px; padding-bottom: 50px; }
/* Line the intro text up with the outer edge of the filter pills and cards (20px container + 10px). */
.hero, .category-head { padding-left: 30px; padding-right: 30px; }
.eyebrow { margin: 0 0 1rem; font-size: .85rem; font-weight: 400; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }
.hero h1 { max-width: 18ch; font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.1; }
.lede { max-width: 60ch; font-size: 1.15rem; margin: 0 0 2rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin: 0; }
.link-arrow { color: #fff; font-weight: 400; border-bottom: 1px solid var(--muted); transition: border-color .3s; }
.link-arrow:hover { border-color: #fff; }
h2 { color: var(--heading); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.2; margin: 0 0 1rem; }
.services { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; padding-top: 90px; padding-bottom: 70px; }
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li { display: grid; grid-template-columns: 3rem 1fr; column-gap: 1rem; padding: 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, .15); }
.service-list li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .15); }
.service-list .num { grid-row: span 2; color: var(--accent); font-weight: 400; padding-top: .2rem; }
.service-list h3 { margin: 0 0 .25rem; color: #fff; font-weight: 400; font-size: 1.2rem; }
.service-list p { margin: 0; max-width: 60ch; }
@media (max-width: 767px) { .services { grid-template-columns: 1fr; gap: .5rem; padding-top: 60px; } .hero { padding-top: 40px; } }
.cta { background: #111; }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 60px; padding-bottom: 60px; }
.cta p { margin: 0; }
.prose a { color: #fff; border-bottom: 1px solid var(--muted); }
.prose a.btn { color: #000; border-bottom: 0; }
.services { scroll-margin-top: 80px; }

/* Work filters, breadcrumbs, category pages and project pager */
.filters { margin-bottom: 10px; } /* a little air between the pills and the cards below */
.filters ul { list-style: none; margin: 0; padding: 0 10px; display: flex; flex-wrap: wrap; gap: .5rem; }
.filters a {
  display: block; padding: .35rem .9rem; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px;
  font-size: .9rem; font-weight: 400; color: var(--muted); transition: color .3s, border-color .3s;
}
.filters a:hover { color: #fff; border-color: rgba(255, 255, 255, .6); }
.filters a[aria-current] { color: #000; background: var(--accent); border-color: var(--accent); }
.breadcrumb { margin: 0 auto; padding-top: 30px; font-size: .9rem; color: var(--muted); }
.breadcrumb a { color: var(--text); border-bottom: 1px solid rgba(255, 255, 255, .25); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { margin: 0 .4rem; opacity: .6; }
.breadcrumb + .project-intro { padding-top: 40px; }
.category-head { padding-bottom: 30px; }
.category-head .breadcrumb { padding-top: 40px; margin-bottom: 1.5rem; }
.category-head h1 { margin-bottom: .5rem; }
.category-head .lede { margin-bottom: 0; }
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding-top: 40px; padding-bottom: 60px; border-top: 1px solid rgba(255, 255, 255, .15);
}
.pager-card { position: relative; display: block; overflow: hidden; border-radius: var(--radius); color: #fff; aspect-ratio: 16 / 7; }
.pager-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--light); filter: brightness(.45); transition: filter .5s, transform .8s; }
.pager-card:hover .pager-img, .pager-card:focus-visible .pager-img { filter: brightness(.6); transform: scale(1.04); }
.pager-label, .pager-title { position: relative; display: block; padding: 0 24px; }
.pager-label { padding-top: 24px; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); transition: color .3s; }
.pager-card:hover .pager-label { color: var(--accent); }
.pager-title { font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.2; margin-top: .25rem; }
.pager .next { text-align: right; }
.pager .all { grid-column: 1 / -1; justify-self: center; font-size: .9rem; color: var(--muted); border-bottom: 1px solid rgba(255, 255, 255, .25); }
@media (max-width: 575px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}

/* Keep tile captions and icons readable on light images: a dark fade behind the caption on hover,
   and a dark disc behind the stack icon. */
.tile::after {
  content: ""; position: absolute; left: var(--tile-pad); right: var(--tile-pad); bottom: var(--tile-pad); height: 35%;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  opacity: 0; transition: opacity .3s; pointer-events: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile-caption, .tile-caption.dark { z-index: 1; color: #fff; }
.tile-icon {
  z-index: 1; width: 34px; height: 34px; padding: 7px; right: calc(var(--tile-pad) + 14px); bottom: calc(var(--tile-pad) + 10px);
  border-radius: 50%; background: rgba(0, 0, 0, .45);
}
.tile.plain::after { display: none; }

/* Tighter line spacing for intro and description text */
.lede, .prose p, .service-list p, .cta p { line-height: 1.4; }

/* Home heading spans three of the four grid columns */
.hero h1 { max-width: 75%; }
@media (max-width: 767px) { .hero h1 { max-width: none; } }

/* Descriptions span three of the four grid columns, like the home heading */
.lede, .about .prose { max-width: 75%; }
.prose p, .service-list p { max-width: none; }
.project-intro:not(.has-logo) .prose { max-width: 75%; }
@media (max-width: 767px) { .lede, .about .prose, .project-intro:not(.has-logo) .prose { max-width: none; } }

/* Project facts (type, year, client) sit together as one compact block */
.facts { list-style: none; margin: 0 0 1rem; padding: 0; line-height: 1.5; }

/* More breathing room around the contact band */
.cta { margin: 80px 0; }
.cta-inner { padding-top: 48px; padding-bottom: 48px; }

/* Case study blocks on project pages (optional "story" in site.json) */
.story { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; padding-bottom: 40px; }
.story h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin: 0 0 .5rem; }
.story p { margin: 0; line-height: 1.5; }

/* Project images: same gap as the cards (set on .project-images above), more room below */
.project-images { padding-bottom: 80px; }
video.shot, video.tile-img { display: block; height: auto; }

/* Scroll reveals: main.js adds .reveal to elements and .in once they enter the viewport.
   Without JS, or with reduced motion, nothing is hidden. */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--delay, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .pager-img { transition: none; }
}

/* Contact band as a card that lines up with the content above it */
.cta { background: none; max-width: var(--max); margin: 80px auto; padding: 0 20px; }
.cta-inner { max-width: none; background: #111; border-radius: var(--radius); padding: 48px 40px; }
@media (max-width: 575px) { .cta-inner { padding: 36px 24px; } }

/* Dark logos on transparent backgrounds sit on a light panel so they stay legible */
.project-logo.on-light img { background: var(--light); }

/* 3D tilt on hover for every card: the card tilts toward the pointer (main.js sets --rx / --ry) and the
   caption and icon rise in front of the image, so they move at a different rate. Caption and a lighter
   shade show at rest; the icon shows on hover. Off with reduced motion. */
.tile { transform-style: preserve-3d; }
.tile:not(.reveal), .tile.in {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: opacity .7s ease, transform .6s cubic-bezier(.2, .9, .3, 1.1);
}
.tile.is-live { transition: opacity .7s ease, transform .1s ease-out; }
.tile.is-live .tile-caption, .tile.is-live .tile-icon { transition: opacity .3s, transform .3s ease-out; }
.tile picture {
  display: block; position: relative; overflow: hidden; border-radius: var(--radius);
  transition: box-shadow .4s ease;
}
.tile.is-live picture { box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .75); }
.tile .tile-img { display: block; }
.tile::after { opacity: 1; background: linear-gradient(to top, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0)); } /* shade and caption always shown, so hover only adds the tilt */
/* The caption and icon only rise in front of the image while the card tilts. Kept flat at rest because the
   fade-in (opacity) flattens 3D, which made a raised caption jump when the card finished loading. */
/* No overshoot here: dipping below the image plane hid the caption for a moment on mouse leave. */
.tile .tile-caption { opacity: 1; transition: transform .5s cubic-bezier(.2, .8, .3, 1); }
.tile.is-live .tile-caption { transform: translateZ(40px); }
.tile .tile-icon { opacity: 0; transition: opacity .3s, transform .5s cubic-bezier(.2, .8, .3, 1); }
.tile.is-live .tile-icon { transform: translateZ(30px); } /* icon only on hover */
.tile:hover .tile-icon, .tile:focus-visible .tile-icon { opacity: .9; }
@media (prefers-reduced-motion: reduce) {
  .tile:not(.reveal), .tile.in { transform: none; transition: none; }
}
